diff --git a/AST_VDhopper.pl b/AST_VDhopper.pl index ab55395c..414bdded 100644 --- a/AST_VDhopper.pl +++ b/AST_VDhopper.pl @@ -1,9 +1,10 @@ #!/usr/bin/perl # -# AST_VDhopper.pl version 0.9 +# AST_VDhopper.pl version 0.10 +# *** DBI version *** # # DESCRIPTION: -# uses Net::MySQL to update the VICIDIAL leads hopper for the new streamlined +# uses DBD::MySQL to update the VICIDIAL leads hopper for the streamlined # approach of allocating leads to client machines. # # SUMMARY: @@ -74,7 +75,7 @@ if (length($ARGV[0])>1) if ($args =~ /--help/i) { - 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"; + 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 { @@ -132,28 +133,20 @@ require("/home/cron/AST_SERVER_conf.pl"); # local configuration file if (!$DB_port) {$DB_port='3306';} -sleep(1); ### sleep for 5 seconds to stagger cron script load +use DBI; -#use lib './lib', '../lib'; -use Net::MySQL; - +$dbhA = DBI->connect("DBI:mysql:$DB_database:$DB_server:$DB_port", "$DB_user", "$DB_pass") + or die "Couldn't connect to database: " . DBI->errstr; - my $dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; ### Grab Server values from the database $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; -$dbhA->query("$stmtA"); -if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $DBSERVER_GMT = "$record->[0]"; - if (length($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - } - } - +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +@aryA = $sthA->fetchrow_array; +$DBSERVER_GMT = $aryA[0]; +if (length($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} +$sthA->finish(); $secX = time(); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($secX); @@ -161,7 +154,6 @@ $secX = time(); $LOCAL_GMT_OFF_STD = $SERVER_GMT; if ($isdst) {$LOCAL_GMT_OFF++;} - $GMT_now = ($secX - ($LOCAL_GMT_OFF * 3600)); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_now); $mon++; @@ -172,105 +164,93 @@ $GMT_now = ($secX - ($LOCAL_GMT_OFF * 3600)); if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} - if ($DB) {print "TIME DEBUG: $LOCAL_GMT_OFF_STD|$LOCAL_GMT_OFF|$isdst| GMT: $hour:$min\n";} if ($wipe_hopper_clean) { $stmtA = "DELETE from $vicidial_hopper;"; - $dbhA->query("$stmtA"); - my $affected_rows = $dbhA->get_affected_rows_length; + $affected_rows = $dbhA->do($stmtA); if ($DB) {print "Hopper Wiped Clean: $affected_rows\n";} $event_string = "|HOPPER WIPE CLEAN|"; &event_logger; 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++; - } - } +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +while ($sthArows > $inactive_lists_count) + { + @aryA = $sthA->fetchrow_array; + $inactive_list = $aryA[0]; + $inactive_lists .= "'$inactive_list',"; + $inactive_lists_count++; + } +$sthA->finish(); 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; + $affected_rows = $dbhA->do($stmtA); 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 $stmtA = "SELECT count(*) FROM vicidial_callbacks where callback_time <= '$now_date' and status='ACTIVE';"; -$dbhA->query("$stmtA"); -if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $CBHOLD_count = "$record->[0]"; - } - } - +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +@aryA = $sthA->fetchrow_array; +$CBHOLD_count = $aryA[0]; if ($DB) {print "CALLBACK HOLD: $CBHOLD_count|$stmtA|\n";} +$sthA->finish(); if ($CBHOLD_count > 0) { $update_leads=''; + $cbc=0; + $cba=0; $stmtA = "SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now FROM vicidial_callbacks,vicidial_list where callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE' and vicidial_callbacks.lead_id=vicidial_list.lead_id;"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + while ($sthArows > $cbc) { - $iter=$dbhA->create_record_iterator; - $cbc=0; - $cba=0; - while ( $record = $iter->each) + @aryA = $sthA->fetchrow_array; + $lead_ids[$cbc] = $aryA[0]; + $recipient = $aryA[1]; + $update_leads .= "'$lead_ids[$cbc]',"; + if ($recipient == 'ANYONE') { - $lead_ids[$cbc] = $record->[0]; - $recipient = $record->[1]; - $update_leads .= "'$lead_ids[$cbc]',"; - if ($recipient == 'ANYONE') - { - $CA_lead_id[$cba] = $record->[0]; - $CA_campaign_id[$cba] = $record->[2]; - $CA_list_id[$cba] = $record->[3]; - $CA_gmt_offset_now[$cba] = $record->[4]; - $cba++; - } - $cbc++; + $CA_lead_id[$cba] = $aryA[0]; + $CA_campaign_id[$cba] = $aryA[2]; + $CA_list_id[$cba] = $aryA[3]; + $CA_gmt_offset_now[$cba] = $aryA[4]; + $cba++; } + $cbc++; } + $sthA->finish(); if ($cbc > 0) { chop($update_leads); $stmtA = "UPDATE vicidial_list set status='CALLBK', called_since_last_reset='N' where lead_id IN($update_leads);"; - $dbhA->query("$stmtA"); - my $affected_rows = $dbhA->get_affected_rows_length; + $affected_rows = $dbhA->do($stmtA); if ($DB) {print "Scheduled Callbacks Activated: $affected_rows\n";} $event_string = "|CALLBACKS LISTACT|$affected_rows|"; &event_logger; $stmtA = "UPDATE vicidial_callbacks set status='LIVE' where lead_id IN($update_leads);"; - $dbhA->query("$stmtA"); - my $affected_rows = $dbhA->get_affected_rows_length; + $affected_rows = $dbhA->do($stmtA); if ($DB) {print "Scheduled Callbacks Activated: $affected_rows\n";} $event_string = "|CALLBACKS CB ACT |$affected_rows|"; &event_logger; @@ -279,14 +259,15 @@ if ($CBHOLD_count > 0) ### INSERT ANYONE CALLBACKS INTO HOPPER DIRECTLY ### if ( ($cba > 0) && ($insert_auto_CB_to_hopper) ) { - if ($DB) {print "ANYONE Scheduled Callbacks Inserted into hopper: $cba\n";} + if ($DB) {print "ANYONE Scheduled Callbacks to Insert into hopper: $cba\n";} $event_string = "|ANYONE CB HOPPER |$cba|"; &event_logger; $CAu=0; foreach(@CA_lead_id) { $stmtA = "INSERT INTO $vicidial_hopper SET lead_id='$CA_lead_id[$CAu]',campaign_id='$CA_campaign_id[$CAu]',list_id='$CA_list_id[$CAu]',gmt_offset_now='$CA_gmt_offset_now[$CAu]';"; - $dbhA->query("$stmtA"); + $affected_rows = $dbhA->do($stmtA); + if ($DB) {print "ANYONE Scheduled Callback Inserted into hopper: $affected_rows|$CA_lead_id[$CAu]\n";} $CAu++; } } @@ -294,7 +275,6 @@ if ($CBHOLD_count > 0) ### END Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed - @campaign_id=@MT; if ($CLIcampaign) @@ -305,48 +285,37 @@ else { $stmtA = "SELECT * from vicidial_campaigns where active='Y'"; } +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $campaign_id[$rec_count] = "$aryA[0]"; + $dial_status_a[$rec_count] = "$aryA[3]"; + $dial_status_b[$rec_count] = "$aryA[4]"; + $dial_status_c[$rec_count] = "$aryA[5]"; + $dial_status_d[$rec_count] = "$aryA[6]"; + $dial_status_e[$rec_count] = "$aryA[7]"; + $lead_order[$rec_count] = "$aryA[8]"; + if (!$CLIlevel) + {$hopper_level[$rec_count] = "$aryA[13]";} + else + {$hopper_level[$rec_count] = "$CLIlevel";} + $local_call_time[$rec_count] = "$aryA[16]"; + $lead_filter_id[$rec_count] = "$aryA[35]"; + $use_internal_dnc[$rec_count] = "$aryA[43]"; + $rec_count++; + } +$sthA->finish(); +if ($DB) {print "CAMPAIGNS TO PROCESSES HOPPER FOR: $rec_count|$#campaign_id\n";} -$dbhA->query("$stmtA"); -if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - $rec_count=0; - while ( $record = $iter->each) - { - $campaign_id[$rec_count] = "$record->[0]"; - $dial_status_a[$rec_count] = "$record->[3]"; - $dial_status_b[$rec_count] = "$record->[4]"; - $dial_status_c[$rec_count] = "$record->[5]"; - $dial_status_d[$rec_count] = "$record->[6]"; - $dial_status_e[$rec_count] = "$record->[7]"; - $lead_order[$rec_count] = "$record->[8]"; - if (!$CLIlevel) - {$hopper_level[$rec_count] = "$record->[13]";} - else - {$hopper_level[$rec_count] = "$CLIlevel";} - $local_call_time[$rec_count] = "$record->[16]"; - $lead_filter_id[$rec_count] = "$record->[35]"; - $use_internal_dnc[$rec_count] = "$record->[43]"; - $rec_count++; - } - } +##### LOOP THROUGH EACH CAMPAIGN AND PROCESS THE HOPPER ##### $i=0; foreach(@campaign_id) { - ### close out MySQL connection and re-connect to start new connection ### -# $dbhA->close(); -# my $dbhA = ''; - - ### Make sure this file is in a libs path or put the absolute path to it -# require("/home/cron/AST_SERVER_conf.pl"); # local configuration file -# if (!$DB_port) {$DB_port='3306';} -# use Net::MySQL; - -# my $dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") -# or die "Couldn't connect to database: $DB_server - $DB_database\n"; - - $VCSdialable_leads=0; $VCScalls_today=0; $VCSdrops_today=0; @@ -354,49 +323,56 @@ foreach(@campaign_id) $vicidial_log = 'vicidial_log'; $stmtA = "SELECT dialable_leads from vicidial_campaign_stats where campaign_id='$campaign_id[$i]';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - $rec_count=0; - while ( $record = $iter->each) - { - $VCSdialable_leads = "$record->[0]"; - } - } + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VCSdialable_leads = "$aryA[0]"; + $rec_count++; + } + $sthA->finish(); + $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_date';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - $rec_count=0; - while ( $record = $iter->each) - { - $VCScalls_today = "$record->[0]"; - } - } + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VCScalls_today = "$aryA[0]"; + $rec_count++; + } + $sthA->finish(); if ($VCScalls_today > 0) { $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_date' and status IN('DROP','XDROP');"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - $rec_count=0; - while ( $record = $iter->each) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $VCSdrops_today = "$aryA[0]"; + if ($VCSdrops_today > 0) { - $VCSdrops_today = "$record->[0]"; - if ($VCSdrops_today > 0) - { - $VCSdrops_today_pct = ( ($VCSdrops_today / $VCScalls_today) * 100 ); - $VCSdrops_today_pct = sprintf("%.2f", $VCSdrops_today_pct); - } + $VCSdrops_today_pct = ( ($VCSdrops_today / $VCScalls_today) * 100 ); + $VCSdrops_today_pct = sprintf("%.2f", $VCSdrops_today_pct); } - } + $rec_count++; + } + $sthA->finish(); } + + $stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today',drops_today='$VCSdrops_today',drops_today_pct='$VCSdrops_today_pct' where campaign_id='$campaign_id[$i]';"; - $dbhA->query("$stmtA"); + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "campaign stats updated: $affected_rows|$VCScalls_today|$VCSdrops_today|$VCSdrops_today_pct|$campaign_id[$i]|\n";} ##### BEGIN calculate what gmt_offset_now values are within the allowed local_call_time setting ### $g=0; @@ -422,31 +398,33 @@ foreach(@campaign_id) $stmtA = "SELECT * FROM vicidial_call_times where call_time_id='$local_call_time[$i]';"; if ($DBX) {print " |$stmtA|\n";} - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $Gct_default_start = "$record->[3]"; - $Gct_default_stop = "$record->[4]"; - $Gct_sunday_start = "$record->[5]"; - $Gct_sunday_stop = "$record->[6]"; - $Gct_monday_start = "$record->[7]"; - $Gct_monday_stop = "$record->[8]"; - $Gct_tuesday_start = "$record->[9]"; - $Gct_tuesday_stop = "$record->[10]"; - $Gct_wednesday_start = "$record->[11]"; - $Gct_wednesday_stop = "$record->[12]"; - $Gct_thursday_start = "$record->[13]"; - $Gct_thursday_stop = "$record->[14]"; - $Gct_friday_start = "$record->[15]"; - $Gct_friday_stop = "$record->[16]"; - $Gct_saturday_start = "$record->[17]"; - $Gct_saturday_stop = "$record->[18]"; - $Gct_state_call_times = "$record->[19]"; - } + @aryA = $sthA->fetchrow_array; + $Gct_default_start = "$aryA[3]"; + $Gct_default_stop = "$aryA[4]"; + $Gct_sunday_start = "$aryA[5]"; + $Gct_sunday_stop = "$aryA[6]"; + $Gct_monday_start = "$aryA[7]"; + $Gct_monday_stop = "$aryA[8]"; + $Gct_tuesday_start = "$aryA[9]"; + $Gct_tuesday_stop = "$aryA[10]"; + $Gct_wednesday_start = "$aryA[11]"; + $Gct_wednesday_stop = "$aryA[12]"; + $Gct_thursday_start = "$aryA[13]"; + $Gct_thursday_stop = "$aryA[14]"; + $Gct_friday_start = "$aryA[15]"; + $Gct_friday_stop = "$aryA[16]"; + $Gct_saturday_start = "$aryA[17]"; + $Gct_saturday_stop = "$aryA[18]"; + $Gct_state_call_times = "$aryA[19]"; + $rec_count++; } + $sthA->finish(); $ct_states = ''; $ct_state_gmt_SQL = ''; @@ -464,33 +442,35 @@ foreach(@campaign_id) { $stmtA = "SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; if ($DBX) {print " |$stmtA|\n";} - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $Gstate_call_time_id = "$record->[0]"; - $Gstate_call_time_state = "$record->[1]"; - $Gsct_default_start = "$record->[4]"; - $Gsct_default_stop = "$record->[5]"; - $Gsct_sunday_start = "$record->[6]"; - $Gsct_sunday_stop = "$record->[7]"; - $Gsct_monday_start = "$record->[8]"; - $Gsct_monday_stop = "$record->[9]"; - $Gsct_tuesday_start = "$record->[10]"; - $Gsct_tuesday_stop = "$record->[11]"; - $Gsct_wednesday_start = "$record->[12]"; - $Gsct_wednesday_stop = "$record->[13]"; - $Gsct_thursday_start = "$record->[14]"; - $Gsct_thursday_stop = "$record->[15]"; - $Gsct_friday_start = "$record->[16]"; - $Gsct_friday_stop = "$record->[17]"; - $Gsct_saturday_start = "$record->[18]"; - $Gsct_saturday_stop = "$record->[19]"; - $ct_states .="'$Gstate_call_time_state',"; - } + @aryA = $sthA->fetchrow_array; + $Gstate_call_time_id = "$aryA[0]"; + $Gstate_call_time_state = "$aryA[1]"; + $Gsct_default_start = "$aryA[4]"; + $Gsct_default_stop = "$aryA[5]"; + $Gsct_sunday_start = "$aryA[6]"; + $Gsct_sunday_stop = "$aryA[7]"; + $Gsct_monday_start = "$aryA[8]"; + $Gsct_monday_stop = "$aryA[9]"; + $Gsct_tuesday_start = "$aryA[10]"; + $Gsct_tuesday_stop = "$aryA[11]"; + $Gsct_wednesday_start = "$aryA[12]"; + $Gsct_wednesday_stop = "$aryA[13]"; + $Gsct_thursday_start = "$aryA[14]"; + $Gsct_thursday_stop = "$aryA[15]"; + $Gsct_friday_start = "$aryA[16]"; + $Gsct_friday_stop = "$aryA[17]"; + $Gsct_saturday_start = "$aryA[18]"; + $Gsct_saturday_stop = "$aryA[19]"; + $ct_states .="'$Gstate_call_time_state',"; + $rec_count++; } + $sthA->finish(); $r=0; $state_gmt=''; @@ -773,23 +753,23 @@ foreach(@campaign_id) ##### BEGIN lead recycling parsing and prep ### $stmtA = "SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id[$i]' and active='Y';"; - $dbhA->query("$stmtA"); + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @recycle_status=@MT; + @recycle_delay=@MT; + @recycle_maximum=@MT; + @RSQLdate=@MT; $rec_ct=0; - if ($dbhA->has_selected_record) + while ($sthArows > $rec_ct) { - @recycle_status=@MT; - @recycle_delay=@MT; - @recycle_maximum=@MT; - @RSQLdate=@MT; - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $recycle_status[$rec_ct] = $record->[2]; - $recycle_delay[$rec_ct] = $record->[3]; - $recycle_maximum[$rec_ct] = $record->[4]; - $rec_ct++; - } + @aryA = $sthA->fetchrow_array; + $recycle_status[$rec_ct] = "$aryA[2]"; + $recycle_delay[$rec_ct] = "$aryA[3]"; + $recycle_maximum[$rec_ct] = "$aryA[4]"; + $rec_ct++; } + $sthA->finish(); if ($rec_ct > 0) { @@ -834,36 +814,34 @@ foreach(@campaign_id) ### 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; + $affected_rows = $dbhA->do($stmtA); 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 ($del_gmtSQL);"; - $dbhA->query("$stmtA"); - my $affected_rows = $dbhA->get_affected_rows_length; + $affected_rows = $dbhA->do($stmtA); 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; $stmtA = "SELECT count(*) from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status='READY';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - $rec_countA=0; - while ( $record = $iter->each) - { - $hopper_ready_count = $record->[0]; - if ($DB) {print " hopper READY count: $hopper_ready_count\n";} - if ($DBX) {print " |$stmtA|\n";} - $rec_countA++; - } + @aryA = $sthA->fetchrow_array; + $hopper_ready_count = $aryA[0]; + if ($DB) {print " hopper READY count: $hopper_ready_count\n";} + if ($DBX) {print " |$stmtA|\n";} + $rec_count++; } - $event_string = "|$campaign_id[$i]|$hopper_level[$i]|$hopper_ready_count|$local_call_time[$i]||"; - &event_logger; + $sthA->finish(); + $event_string = "|$campaign_id[$i]|$hopper_level[$i]|$hopper_ready_count|$local_call_time[$i]||"; + &event_logger; ##### IF hopper level is below set minimum, then try to add more leads ##### if ($hopper_ready_count < $hopper_level[$i]) @@ -872,19 +850,21 @@ foreach(@campaign_id) ### Get list of the lists in the campaign ### $stmtA = "SELECT list_id FROM vicidial_lists where campaign_id='$campaign_id[$i]' and active='Y';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_countLISTS=0; + $camp_lists = ''; + while ($sthArows > $rec_countLISTS) { - $iter=$dbhA->create_record_iterator; - $rec_countLISTS=0; - $camp_lists = ''; - while ( $record = $iter->each) - { - $camp_lists .= "'$record->[0]',"; - $rec_countLISTS++; - } - chop($camp_lists); + @aryA = $sthA->fetchrow_array; + $camp_lists .= "'$aryA[0]',"; + $rec_countLISTS++; } + $sthA->finish(); + if (length($camp_lists)<3) {$camp_lists="''";} + else {chop($camp_lists);} + if ($DB) {print " campaign lists count: $rec_countLISTS | $camp_lists\n";} if ($DBX) {print " |$stmtA|\n";} @@ -892,15 +872,17 @@ foreach(@campaign_id) { ### Get SQL of lead filter for the campaign ### $stmtA = "SELECT lead_filter_sql FROM vicidial_lead_filters where lead_filter_id='$lead_filter_id[$i]';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $lead_filter_sql[$i] = "$record->[0]"; - } + @aryA = $sthA->fetchrow_array; + $lead_filter_sql[$i] = "$aryA[0]"; + $rec_count++; } + $sthA->finish(); $lead_filter_sql[$i] =~ s/^and|and$|^or|or$|^ and|and $|^ or|or $//gi; $lead_filter_sql[$i] = "and $lead_filter_sql[$i]"; if ($DB) {print " campaign lists count: $rec_countLISTS | $camp_lists\n";} @@ -916,33 +898,36 @@ foreach(@campaign_id) $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 ($all_gmtSQL) $lead_filter_sql[$i];"; if ($DBX) {print " |$stmtA|\n";} - $dbhA->query("$stmtA"); - $campaign_leads_to_call=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $campaign_leads_to_call = "$record->[0]"; - if ($DB) {print " leads to call count: $campaign_leads_to_call\n";} - if ($DBX) {print " |$stmtA|\n";} - } + @aryA = $sthA->fetchrow_array; + $campaign_leads_to_call = "$aryA[0]"; + if ($DB) {print " leads to call count: $campaign_leads_to_call\n";} + if ($DBX) {print " |$stmtA|\n";} + $rec_count++; } + $sthA->finish(); + if ($lead_order[$i] =~ /DOWN COUNT 2nd NEW|DOWN COUNT 3rd NEW|DOWN COUNT 4th NEW/) { $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and ($all_gmtSQL) $lead_filter_sql[$i];"; - $dbhA->query("$stmtA"); - $NEW_campaign_leads_to_call=0; - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $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";} - } + @aryA = $sthA->fetchrow_array; + $NEW_campaign_leads_to_call = "$aryA[0]"; + if ($DB) {print " NEW leads to call count: $NEW_campaign_leads_to_call\n";} + if ($DBX) {print " |$stmtA|\n";} + $rec_count++; } + $sthA->finish(); } ##### IF no NEW leads to be called, error out of this campaign ##### @@ -959,7 +944,8 @@ foreach(@campaign_id) if ($VCSdialable_leads > 0) { $stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0' where campaign_id='$campaign_id[$i]';"; - $dbhA->query("$stmtA"); + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";} } } else @@ -967,162 +953,170 @@ foreach(@campaign_id) if ($VCSdialable_leads != $campaign_leads_to_call) { $stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='$campaign_leads_to_call' where campaign_id='$campaign_id[$i]';"; - $dbhA->query("$stmtA"); + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";} } if ($DB) {print " Getting Leads to add to hopper\n";} ### grab leads already in hopper so we don't duplicate $stmtA = "SELECT lead_id FROM $vicidial_hopper where campaign_id='$campaign_id[$i]';"; if ($DBX) {print " |$stmtA|\n";} - $dbhA->query("$stmtA"); - $rec_countLISTS=0; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; $lead_id_lists = ''; - if ($dbhA->has_selected_record) + $rec_countLISTS=0; + while ($sthArows > $rec_countLISTS) { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $lead_id_lists .= "'$record->[0]',"; - $rec_countLISTS++; - } - $lead_id_lists .= "'0'"; + @aryA = $sthA->fetchrow_array; + $lead_id_lists .= "'$aryA[0]',"; + $rec_countLISTS++; } - - $order_stmt=''; - $NEW_count = 0; - $NEW_level = 0; - $OTHER_level = $hopper_level[$i]; - if ($lead_order[$i] eq "DOWN") {$order_stmt = 'order by lead_id asc';} - if ($lead_order[$i] eq "UP") {$order_stmt = 'order by lead_id desc';} - if ($lead_order[$i] eq "UP LAST NAME") {$order_stmt = 'order by last_name desc, lead_id asc';} - if ($lead_order[$i] eq "DOWN LAST NAME") {$order_stmt = 'order by last_name, lead_id asc';} - if ($lead_order[$i] eq "UP PHONE") {$order_stmt = 'order by phone_number desc, lead_id asc';} - if ($lead_order[$i] eq "DOWN PHONE") {$order_stmt = 'order by phone_number, lead_id asc';} - if ($lead_order[$i] eq "UP COUNT") {$order_stmt = 'order by called_count desc, lead_id asc';} - if ($lead_order[$i] eq "DOWN COUNT") {$order_stmt = 'order by called_count, lead_id asc';} - if ($lead_order[$i] eq "DOWN COUNT 2nd NEW") {$NEW_count = 2;} - if ($lead_order[$i] eq "DOWN COUNT 3rd NEW") {$NEW_count = 3;} - if ($lead_order[$i] eq "DOWN COUNT 4th NEW") {$NEW_count = 4;} + $sthA->finish(); + $lead_id_lists .= "'0'"; + $order_stmt=''; + $NEW_count = 0; + $NEW_level = 0; + $OTHER_level = $hopper_level[$i]; + if ($lead_order[$i] eq "DOWN") {$order_stmt = 'order by lead_id asc';} + if ($lead_order[$i] eq "UP") {$order_stmt = 'order by lead_id desc';} + if ($lead_order[$i] eq "UP LAST NAME") {$order_stmt = 'order by last_name desc, lead_id asc';} + if ($lead_order[$i] eq "DOWN LAST NAME") {$order_stmt = 'order by last_name, lead_id asc';} + if ($lead_order[$i] eq "UP PHONE") {$order_stmt = 'order by phone_number desc, lead_id asc';} + if ($lead_order[$i] eq "DOWN PHONE") {$order_stmt = 'order by phone_number, lead_id asc';} + if ($lead_order[$i] eq "UP COUNT") {$order_stmt = 'order by called_count desc, lead_id asc';} + if ($lead_order[$i] eq "DOWN COUNT") {$order_stmt = 'order by called_count, lead_id asc';} + if ($lead_order[$i] eq "DOWN COUNT 2nd NEW") {$NEW_count = 2;} + if ($lead_order[$i] eq "DOWN COUNT 3rd NEW") {$NEW_count = 3;} + if ($lead_order[$i] eq "DOWN COUNT 4th NEW") {$NEW_count = 4;} - ### BEGIN recycle grab leads ### - if ($rec_ct > 0) + ### BEGIN recycle grab leads ### + if ($rec_ct > 0) + { + if ($DB) {print " looking for RECYCLE leads, maximum of 100\n";} + + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where $recycle_SQL and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] limit 100;"; + if ($DBX) {print " |$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($DB) {print " RECYCLE leads to call count: $sthArows\n";} + if ($DBX) {print " |$stmtA|\n";} + $REC_rec_countLEADS=0; + @REC_leads_to_hopper=@MT; + @REC_lists_to_hopper=@MT; + @REC_phone_to_hopper=@MT; + while ($sthArows > $REC_rec_countLEADS) { - if ($DB) {print " looking for RECYCLE leads, maximum of 100\n";} - - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where $recycle_SQL and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] limit 100;"; - if ($DBX) {print " |$stmtA|\n";} - $REC_rec_countLEADS=0; - @REC_leads_to_hopper=@MT; - @REC_lists_to_hopper=@MT; - @REC_phone_to_hopper=@MT; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $REC_leads_to_hopper[$REC_rec_countLEADS] = "$record->[0]"; - $REC_lists_to_hopper[$REC_rec_countLEADS] = "$record->[1]"; - $REC_gmt_to_hopper[$REC_rec_countLEADS] = "$record->[2]"; - $REC_phone_to_hopper[$REC_rec_countLEADS] = "$record->[3]"; - $REC_state_to_hopper[$REC_rec_countLEADS] = "$record->[4]"; - if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} - $REC_rec_countLEADS++; - } - } - if ($DB) {print " RECYCLE leads to call count: $REC_rec_countLEADS\n";} - if ($DBX) {print " |$stmtA|\n";} + @aryA = $sthA->fetchrow_array; + $REC_leads_to_hopper[$REC_rec_countLEADS] = "$aryA[0]"; + $REC_lists_to_hopper[$REC_rec_countLEADS] = "$aryA[1]"; + $REC_gmt_to_hopper[$REC_rec_countLEADS] = "$aryA[2]"; + $REC_phone_to_hopper[$REC_rec_countLEADS] = "$aryA[3]"; + $REC_state_to_hopper[$REC_rec_countLEADS] = "$aryA[4]"; + if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} + $REC_rec_countLEADS++; } - ### END recycle grab leads ### + $sthA->finish(); + } + ### END recycle grab leads ### - if ($NEW_count > 0) + + + + + + + + if ($NEW_count > 0) + { + $NEW_level = int($hopper_level[$i] / $NEW_count); + $OTHER_level = ($hopper_level[$i] - $NEW_level); + $order_stmt = 'order by called_count, lead_id asc'; + 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 ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $NEW_level;"; + if ($DBX) {print " |$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $NEW_rec_countLEADS=0; + @NEW_leads_to_hopper=@MT; + @NEW_lists_to_hopper=@MT; + @NEW_phone_to_hopper=@MT; + while ($sthArows > $NEW_rec_countLEADS) { - $NEW_level = int($hopper_level[$i] / $NEW_count); - $OTHER_level = ($hopper_level[$i] - $NEW_level); - $order_stmt = 'order by called_count, lead_id asc'; - 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 ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $NEW_level;"; - if ($DBX) {print " |$stmtA|\n";} - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - $NEW_rec_countLEADS=0; - @NEW_leads_to_hopper=@MT; - @NEW_lists_to_hopper=@MT; - @NEW_phone_to_hopper=@MT; - while ( $record = $iter->each) - { - $NEW_leads_to_hopper[$NEW_rec_countLEADS] = "$record->[0]"; - $NEW_lists_to_hopper[$NEW_rec_countLEADS] = "$record->[1]"; - $NEW_gmt_to_hopper[$NEW_rec_countLEADS] = "$record->[2]"; - $NEW_phone_to_hopper[$NEW_rec_countLEADS] = "$record->[3]"; - $NEW_state_to_hopper[$NEW_rec_countLEADS] = "$record->[4]"; - if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} - $NEW_rec_countLEADS++; - } - } - + @aryA = $sthA->fetchrow_array; + $NEW_leads_to_hopper[$NEW_rec_countLEADS] = "$aryA[0]"; + $NEW_lists_to_hopper[$NEW_rec_countLEADS] = "$aryA[1]"; + $NEW_gmt_to_hopper[$NEW_rec_countLEADS] = "$aryA[2]"; + $NEW_phone_to_hopper[$NEW_rec_countLEADS] = "$aryA[3]"; + $NEW_state_to_hopper[$NEW_rec_countLEADS] = "$aryA[4]"; + if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} + $NEW_rec_countLEADS++; } + $sthA->finish(); + } 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 ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;"; if ($DBX) {print " |$stmtA|\n";} - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_countLEADS=0; $NEW_dec=99; $NEW_in=0; + @leads_to_hopper=@MT; + @lists_to_hopper=@MT; + @gmt_to_hopper=@MT; + @state_to_hopper=@MT; + @phone_to_hopper=@MT; + $rec_count=0; + $REC_insert_count=0; + while ($sthArows > $rec_count) { - $iter=$dbhA->create_record_iterator; - $rec_countLEADS=0; $NEW_dec=99; $NEW_in=0; - @leads_to_hopper=@MT; - @lists_to_hopper=@MT; - @gmt_to_hopper=@MT; - @state_to_hopper=@MT; - @phone_to_hopper=@MT; - while ( $record = $iter->each) + @aryA = $sthA->fetchrow_array; + if ( ($NEW_count > 0) && ($NEW_rec_countLEADS > $NEW_in) ) { - if ( ($NEW_count > 0) && ($NEW_rec_countLEADS > $NEW_in) ) + if ($DB_show_offset) {print "NEW_COUNT: $NEW_count|$NEW_dec|$NEW_in|$NEW_rec_countLEADS\n";} + if ($NEW_count > $NEW_dec) { - if ($DB_show_offset) {print "NEW_COUNT: $NEW_count|$NEW_dec|$NEW_in|$NEW_rec_countLEADS\n";} - if ($NEW_count > $NEW_dec) - { - $NEW_dec++; - } - else - { - $leads_to_hopper[$rec_countLEADS] = "$NEW_leads_to_hopper[$NEW_in]"; - $lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]"; - $gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]"; - $state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]"; - $phone_to_hopper[$rec_countLEADS] = "$NEW_phone_to_hopper[$NEW_in]"; - if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";} - $rec_countLEADS++; - $NEW_in++; - $NEW_dec=2; - } + $NEW_dec++; } - if ($REC_rec_countLEADS > $REC_insert_count) + else { - $leads_to_hopper[$rec_countLEADS] = "$REC_leads_to_hopper[$REC_insert_count]"; - $lists_to_hopper[$rec_countLEADS] = "$REC_lists_to_hopper[$REC_insert_count]"; - $gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]"; - $state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]"; - $phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]"; + $leads_to_hopper[$rec_countLEADS] = "$NEW_leads_to_hopper[$NEW_in]"; + $lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]"; + $gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]"; + $state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]"; + $phone_to_hopper[$rec_countLEADS] = "$NEW_phone_to_hopper[$NEW_in]"; + if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";} $rec_countLEADS++; - $REC_insert_count++; + $NEW_in++; + $NEW_dec=2; } - $leads_to_hopper[$rec_countLEADS] = "$record->[0]"; - $lists_to_hopper[$rec_countLEADS] = "$record->[1]"; - $gmt_to_hopper[$rec_countLEADS] = "$record->[2]"; - $state_to_hopper[$rec_countLEADS] = "$record->[4]"; - $phone_to_hopper[$rec_countLEADS] = "$record->[3]"; - if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} + } + if ($REC_rec_countLEADS > $REC_insert_count) + { + $leads_to_hopper[$rec_countLEADS] = "$REC_leads_to_hopper[$REC_insert_count]"; + $lists_to_hopper[$rec_countLEADS] = "$REC_lists_to_hopper[$REC_insert_count]"; + $gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]"; + $state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]"; + $phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]"; $rec_countLEADS++; - } + $REC_insert_count++; + } + $leads_to_hopper[$rec_countLEADS] = "$aryA[0]"; + $lists_to_hopper[$rec_countLEADS] = "$aryA[1]"; + $gmt_to_hopper[$rec_countLEADS] = "$aryA[2]"; + $state_to_hopper[$rec_countLEADS] = "$aryA[4]"; + $phone_to_hopper[$rec_countLEADS] = "$aryA[3]"; + if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} + $rec_countLEADS++; + $rec_count++; } - - if ($DB) {print " Adding to hopper: $rec_countLEADS\n";} - $event_string = "|$campaign_id[$i]|Added to hopper $rec_countLEADS|"; - &event_logger; + $sthA->finish(); + if ($DB) {print " Adding to hopper: $rec_countLEADS\n";} + $event_string = "|$campaign_id[$i]|Added to hopper $rec_countLEADS|"; + &event_logger; $h=0; foreach(@leads_to_hopper) @@ -1132,29 +1126,31 @@ foreach(@campaign_id) $DNClead=0; if ($use_internal_dnc[$i] =~ /Y/) { - if ($DB) {print " Doinbg DNC Check: $phone_to_hopper[$h]\n";} + if ($DB) {print " Doinbg DNC Check: $phone_to_hopper[$h] - $use_internal_dnc[$i]\n";} $stmtA = "SELECT count(*) from vicidial_dnc where phone_number='$phone_to_hopper[$h]';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - $rec_count=0; - while ( $record = $iter->each) - { - $DNClead = "$record->[0]"; - } - } + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $DNClead = "$aryA[0]"; + $rec_count++; + } + $sthA->finish(); if ($DNClead != '0') { $stmtA = "UPDATE vicidial_list SET status='DNCL' where lead_id='$leads_to_hopper[$h]';"; - $dbhA->query("$stmtA"); - if ($DB) {print "Flagging DNC lead: $leads_to_hopper[$h] $phone_to_hopper[$h]\n";} + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "Flagging DNC lead: $affected_rows $phone_to_hopper[$h]\n";} } } if ($DNClead == '0') { $stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]');"; - $dbhA->query("$stmtA"); + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";} } } $h++; @@ -1169,7 +1165,7 @@ foreach(@campaign_id) } -$dbhA->close; +$dbhA->disconnect(); if($DB){print "DONE... Exiting... Goodbye... See you later... Really, I mean it :)\n";} diff --git a/DBI-scripts/AST_agent_week.pl b/DBI-scripts/AST_agent_week.pl deleted file mode 100644 index e8eb993a..00000000 --- a/DBI-scripts/AST_agent_week.pl +++ /dev/null @@ -1,336 +0,0 @@ -#!/usr/bin/perl - -# AST_agent_week.pl -# -# This script is designed to gather stats for all agent activity over the course -# of a week(Sunday to Saturday) and print it in an ASCI text file to be placed -# on a web server for viewing. -# -# CHANGES -# 60517-1100 - First version -# - -$txt = '.txt'; -$US = '_'; -$MT[0] = ''; - -### begin parsing run-time options ### -if (length($ARGV[0])>1) -{ - $i=0; - while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } - - if ($args =~ /--help/i) - { - print "allowed run time options:\n [-q] = quiet\n [-t] = test\n\n"; - exit; - } - else - { - if ($args =~ /--debug/i) - { - $DB=1; - print "\n-----DEBUG MODE-----\n\n"; - } - if ($args =~ /-q/i) - { - $q=1; $Q=1; - } - if ($args =~ /-t/i) - { - $T=1; $TEST=1; - print "\n-----TESTING-----\n\n"; - } - } -} -else -{ -print "no command line options set\n"; -} -### end parsing run-time options ### - - -$secX = time(); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); - $year = ($year + 1900); - $mon++; - if ($mon < 10) {$mon = "0$mon";} - if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$hour = "0$hour";} - if ($min < 10) {$min = "0$min";} - if ($sec < 10) {$sec = "0$sec";} - $filedate = "$year$mon$mday-$hour$min$sec"; - $ABIfiledate = "$mon-$mday-$year$us$hour$min$sec"; - $shipdate = "$year-$mon-$mday"; - $datestamp = "$year/$mon/$mday $hour:$min"; - - $STARTtarget = ($secX - (86400 * $wday)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($STARTtarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $START_week = (($Syday/7)+1); $START_week = sprintf("%2d", $START_week); - $STARTtarget_date = "$Syear-$Smon-$Smday"; - - $ENDtarget = ($STARTtarget + (86400 * 6)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($ENDtarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $ENDtarget_date = "$Syear-$Smon-$Smday"; - - $PAST_STARTtarget = ($STARTtarget - (86400 * 7)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_STARTtarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $PAST_START_week = (($Syday/7)+1); $PAST_START_week = sprintf("%2d", $PAST_START_week); - $PAST_STARTtarget_date = "$Syear-$Smon-$Smday"; - - $PAST_ENDtarget = ($ENDtarget - (86400 * 7)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_ENDtarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $PAST_ENDtarget_date = "$Syear-$Smon-$Smday"; - - $PAST_date[0] = $PAST_STARTtarget_date; - $PAST_day[0] = 'Sunday '; - $PAST_date[6] = $PAST_ENDtarget_date; - $PAST_day[6] = 'Saturday '; - - $PAST_Mondaytarget = ($STARTtarget - (86400 * 6)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Mondaytarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $PAST_date[1] = "$Syear-$Smon-$Smday"; - $PAST_day[1] = 'Monday '; - - $PAST_Tuesdaytarget = ($STARTtarget - (86400 * 5)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Tuesdaytarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $PAST_date[2] = "$Syear-$Smon-$Smday"; - $PAST_day[2] = 'Tuesday '; - - $PAST_Wednesdaytarget = ($STARTtarget - (86400 * 4)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Wednesdaytarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $PAST_date[3] = "$Syear-$Smon-$Smday"; - $PAST_day[3] = 'Wednesday'; - - $PAST_Thursdaytarget = ($STARTtarget - (86400 * 3)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Thursdaytarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $PAST_date[4] = "$Syear-$Smon-$Smday"; - $PAST_day[4] = 'Thursday '; - - $PAST_Fridaytarget = ($STARTtarget - (86400 * 2)); - ($Ssec,$Smin,$Shour,$Smday,$Smon,$Syear,$Swday,$Syday,$Sisdst) = localtime($PAST_Fridaytarget); - $Syear = ($Syear + 1900); $Smon++; - if ($Smon < 10) {$Smon = "0$Smon";} - if ($Smday < 10) {$Smday = "0$Smday";} - $PAST_date[5] = "$Syear-$Smon-$Smday"; - $PAST_day[5] = 'Friday '; - -print "\n\n\n\n\n\n\n\n\n\n\n\n-- AST_agent_week.pl --\n\n"; -print "This program is designed to print stats to a file for agents' activity for the previous week. \n\n"; - -$TLoutfile = ''; -$TLoutfile .= "TODAY: $shipdate\n"; -$TLoutfile .= "THIS WEEK: week $START_week $STARTtarget_date - $ENDtarget_date\n"; -$TLoutfile .= "LAST WEEK: week $PAST_START_week $PAST_STARTtarget_date - $PAST_ENDtarget_date\n\n"; - -#$h=0; -#foreach(@PAST_date) -#{ -#$TLoutfile .= "$PAST_day[$h] $PAST_date[$h]\n"; -#$h++; -#} - -#print "$TLoutfile"; - - -$outfile = "AGENT_HOURS_$PAST_STARTtarget_date$US$PAST_ENDtarget_date$txt"; - -#$dir = '/usr/local/apache2/htdocs'; -$dir = '/home/www/htdocs'; - -### open the X out file for writing ### -open(out, ">$dir/vicidial/agent_reports/$outfile") - || die "Can't open $outfile: $!\n"; - -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file - -if (!$DB_port) {$DB_port='3306';} - -use DBI; - -$dbhA = DBI->connect("DBI:mysql:$DB_database:$DB_server:$DB_port", "$DB_user", "$DB_pass") - or die "Couldn't connect to database: " . DBI->errstr; - -$dbhB = DBI->connect("DBI:mysql:$DB_database:$DB_server:$DB_port", "$DB_user", "$DB_pass") - or die "Couldn't connect to database: " . DBI->errstr; - -#$vicidial_agent_log = 'vicidial_agent_log_archive'; -$vicidial_agent_log = 'vicidial_agent_log'; - -########################################################################### -########### PAST WEEK STAT GATHERING LOOP ################################# -########################################################################### -$h=0; -foreach(@PAST_date) -{ - print out "\n$PAST_day[$h] $PAST_date[$h]\n\n"; - print out "AGENT USER CALLS TALK PAUSE WAIT DISPO ACTIVE LOGTIME FIRST LAST \n"; - print "\n$PAST_day[$h] $PAST_date[$h]\n\n"; - print "AGENT USER CALLS TALK PAUSE WAIT DISPO ACTIVE LOGTIME FIRST LAST \n"; - - $stmtA = "select count(*) as calls, full_name,vicidial_users.user,sum(talk_sec),sum(pause_sec),sum(wait_sec),sum(dispo_sec) from vicidial_users,$vicidial_agent_log where event_time <= '$PAST_date[$h] 23:59:59' and event_time >= '$PAST_date[$h] 00:00:00' and vicidial_users.user=$vicidial_agent_log.user and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by vicidial_users.user order by full_name limit 10000;"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - - $calls = sprintf("%7s", $aryA[0]); - $name = sprintf("%-20s", $aryA[1]); while(length($name)>20) {chop($name);} - $user = sprintf("%-8s", $aryA[2]); - - ### TOTAL ACTIVE TIME - $active = ($aryA[3] + $aryA[4] + $aryA[5] + $aryA[6]); - $TIME_S = $active; - $TIME_H = int($TIME_S / 3600); - $TIME_S = ($TIME_S - ($TIME_H * 3600)); - $TIME_M = int($TIME_S / 60); - $TIME_S = ($TIME_S - ($TIME_M * 60)); - if ($TIME_S < 10) {$TIME_S = "0$TIME_S";} - if ($TIME_M < 10) {$TIME_M = "0$TIME_M";} - $TIME_HMS = "$TIME_H:$TIME_M:$TIME_S"; - $active = sprintf("%9s", $TIME_HMS); - - ### TOTAL TALK TIME - $TIME_S = $aryA[3]; - $TIME_H = int($TIME_S / 3600); - $TIME_S = ($TIME_S - ($TIME_H * 3600)); - $TIME_M = int($TIME_S / 60); - $TIME_S = ($TIME_S - ($TIME_M * 60)); - if ($TIME_S < 10) {$TIME_S = "0$TIME_S";} - if ($TIME_M < 10) {$TIME_M = "0$TIME_M";} - $TIME_HMS = "$TIME_H:$TIME_M:$TIME_S"; - $talk = sprintf("%9s", $TIME_HMS); - - ### TOTAL PAUSE TIME - $TIME_S = $aryA[4]; - $TIME_H = int($TIME_S / 3600); - $TIME_S = ($TIME_S - ($TIME_H * 3600)); - $TIME_M = int($TIME_S / 60); - $TIME_S = ($TIME_S - ($TIME_M * 60)); - if ($TIME_S < 10) {$TIME_S = "0$TIME_S";} - if ($TIME_M < 10) {$TIME_M = "0$TIME_M";} - $TIME_HMS = "$TIME_H:$TIME_M:$TIME_S"; - $pause = sprintf("%9s", $TIME_HMS); - - ### TOTAL WAIT TIME - $TIME_S = $aryA[5]; - $TIME_H = int($TIME_S / 3600); - $TIME_S = ($TIME_S - ($TIME_H * 3600)); - $TIME_M = int($TIME_S / 60); - $TIME_S = ($TIME_S - ($TIME_M * 60)); - if ($TIME_S < 10) {$TIME_S = "0$TIME_S";} - if ($TIME_M < 10) {$TIME_M = "0$TIME_M";} - $TIME_HMS = "$TIME_H:$TIME_M:$TIME_S"; - $wait = sprintf("%9s", $TIME_HMS); - - ### TOTAL DISPO TIME - $TIME_S = $aryA[6]; - $TIME_H = int($TIME_S / 3600); - $TIME_S = ($TIME_S - ($TIME_H * 3600)); - $TIME_M = int($TIME_S / 60); - $TIME_S = ($TIME_S - ($TIME_M * 60)); - if ($TIME_S < 10) {$TIME_S = "0$TIME_S";} - if ($TIME_M < 10) {$TIME_M = "0$TIME_M";} - $TIME_HMS = "$TIME_H:$TIME_M:$TIME_S"; - $dispo = sprintf("%9s", $TIME_HMS); - - $stmtB = "select event_time,UNIX_TIMESTAMP(event_time) from $vicidial_agent_log where event_time <= '$PAST_date[$h] 23:59:59' and event_time >= '$PAST_date[$h] 00:00:00' and user='$aryA[2]' order by event_time limit 1;"; - $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; - $sthB->execute or die "executing: $stmtA ", $dbhB->errstr; - @aryB = $sthB->fetchrow_array; - $first_time = sprintf("%21s", $aryB[0]); - $first_log = $aryB[1]; - - $stmtB = "select event_time,UNIX_TIMESTAMP(event_time) from $vicidial_agent_log where event_time <= '$PAST_date[$h] 23:59:59' and event_time >= '$PAST_date[$h] 00:00:00' and user='$aryA[2]' order by event_time desc limit 1;"; - $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; - $sthB->execute or die "executing: $stmtA ", $dbhB->errstr; - @aryB = $sthB->fetchrow_array; - $last_time = sprintf("%21s", $aryB[0]); - $last_log = $aryB[1]; - - $TIME_S = ($last_log - $first_log); - $TIME_H = int($TIME_S / 3600); - $TIME_S = ($TIME_S - ($TIME_H * 3600)); - $TIME_M = int($TIME_S / 60); - $TIME_S = ($TIME_S - ($TIME_M * 60)); - if ($TIME_S < 10) {$TIME_S = "0$TIME_S";} - if ($TIME_M < 10) {$TIME_M = "0$TIME_M";} - $TIME_HMS = "$TIME_H:$TIME_M:$TIME_S"; - $login_time = sprintf("%9s", $TIME_HMS); - - - - print out "$name$user$calls$talk$pause$wait$dispo$active$login_time$first_time$last_time\n"; - print "$name$user$calls$talk$pause$wait$dispo$active$login_time$first_time$last_time\n"; - - - $rec_count++; - } - $sthA->finish(); - - - - - - - - - - -#if ($h=='1') -# { -# exit; -# } - -$h++; -} - - - -close(out); - -### calculate time to run script ### -$secY = time(); -$secZ = ($secY - $secX); -$secZm = ($secZ /60); - -print "script execution time in seconds: $secZ minutes: $secZm\n"; - -exit; - - - - - diff --git a/DTMF_sounds/0.gsm b/DTMF_sounds/0.gsm deleted file mode 100644 index 8c57c411..00000000 Binary files a/DTMF_sounds/0.gsm and /dev/null differ diff --git a/DTMF_sounds/0.wav b/DTMF_sounds/0.wav deleted file mode 100644 index fe3fc124..00000000 Binary files a/DTMF_sounds/0.wav and /dev/null differ diff --git a/DTMF_sounds/1.gsm b/DTMF_sounds/1.gsm deleted file mode 100644 index 7f6c842f..00000000 --- a/DTMF_sounds/1.gsm +++ /dev/null @@ -1 +0,0 @@ -8z*PScOȪP,r)" +E<7j2h#8誙B,65Cb (Ra.4WFR2) 8z.hK]%Mq]ͷM] %ty\ ,Yc:Sd<,iUK:B.eZ%Vn*䡝QE!t+DC5сWETbok]bcCzՔ.46_M]]Dbv])`]kʜ_uY]UU2Fr.]MtZld]C]6]Y[.jR=_a 뭺_ܭ1Z]r2բ)6A]](,Q]\gS4a&Q2c>v\udI$P`u \ No newline at end of file diff --git a/DTMF_sounds/1.wav b/DTMF_sounds/1.wav deleted file mode 100644 index e5f5359a..00000000 Binary files a/DTMF_sounds/1.wav and /dev/null differ diff --git a/DTMF_sounds/2.gsm b/DTMF_sounds/2.gsm deleted file mode 100644 index 82d6e751..00000000 --- a/DTMF_sounds/2.gsm +++ /dev/null @@ -1,3 +0,0 @@ -xZP4e5cU\ #n7#HVc ͌xC=A`a肹 B+3+x;4QӇx7 T_ xJB<]%]и -]t1]"0s wb2"hϣ& 0_C%,#dAxZ=a#^TIXVաs6IsBtIrx%~—b!a8sa8cF )8xZvEX]#yM02":#8txZv"%|_,äϢ)YxJA}me+6j_-gF|xK>a- -wCY 藡J,FsͮZx<>_"q- ) *Ƭs Psv_cgβrG$R 埗Y \ No newline at end of file diff --git a/DTMF_sounds/2.wav b/DTMF_sounds/2.wav deleted file mode 100644 index c3e9edd9..00000000 Binary files a/DTMF_sounds/2.wav and /dev/null differ diff --git a/DTMF_sounds/3.gsm b/DTMF_sounds/3.gsm deleted file mode 100644 index a41d6679..00000000 --- a/DTMF_sounds/3.gsm +++ /dev/null @@ -1,2 +0,0 @@ -;=PW1W#X [r)d[K%7 -$c#2+)UBV4F¬SC{4[Hnpޥꕷbªσ`gC?=W n(*En,{Q6qR=!Ʈ\b#V) h~R=ѓ \%.kn\R=pzr>ܙ=$u R=ρfGϠȵj&ayC<·+61㍂aϣpK;WClRLJ$=Rf%>##xwb LM}bj&V:3k+[? kS%vAbÝ97qݑ \ No newline at end of file diff --git a/DTMF_sounds/3.wav b/DTMF_sounds/3.wav deleted file mode 100644 index bc37ff5d..00000000 Binary files a/DTMF_sounds/3.wav and /dev/null differ diff --git a/DTMF_sounds/4.gsm b/DTMF_sounds/4.gsm deleted file mode 100644 index d2bae3f8..00000000 --- a/DTMF_sounds/4.gsm +++ /dev/null @@ -1,2 +0,0 @@ -8PRW\-elG'XVb,b*V rK"bTJ5~aȋf9ZTȁ`IZ^8nYZ2!Qhzk*"xS8nƸ*"fsSzCdփHΡQTmqZsb=iB -Vbc #meTQJeS;4UQ\H'k JX+ 82U" #9k:'Q "I.Sc"7оRr%ڜD~V΢e Vqr!EKi}9EiUELyXz9#3ȭrQ Ysq[HܘaM2 \ No newline at end of file diff --git a/DTMF_sounds/4.wav b/DTMF_sounds/4.wav deleted file mode 100644 index 05f1adf8..00000000 Binary files a/DTMF_sounds/4.wav and /dev/null differ diff --git a/DTMF_sounds/5.gsm b/DTMF_sounds/5.gsm deleted file mode 100644 index 239c7aca..00000000 --- a/DTMF_sounds/5.gsm +++ /dev/null @@ -1 +0,0 @@ -xj=P3cWcT qFܚ$DVD%CHxS&TxD?4A9E'ڸU2r [SyqxbWXWlK%a.Ռ̩ح4+Mv_dȗ˱.#IZAY \ No newline at end of file diff --git a/DTMF_sounds/6.wav b/DTMF_sounds/6.wav deleted file mode 100644 index 7c32ca36..00000000 Binary files a/DTMF_sounds/6.wav and /dev/null differ diff --git a/DTMF_sounds/7.gsm b/DTMF_sounds/7.gsm deleted file mode 100644 index 0260531d..00000000 --- a/DTMF_sounds/7.gsm +++ /dev/null @@ -1,2 +0,0 @@ -8PR=:^ -r(۞fM[E88vG(QE!f݅ Q[O*֩r<HWSwt8Dx"IGDL4:RīUXj]H䋨L~rA fa֮2_(9FܗL]ëRQh_7#uGB.Vi]McjE2[vADyac]loHtRFz􇁗Hy!Aq8!QȤc=6 B)SdޭU9"<55c=ۉmbSc_ܩHUD{7=_!1֥!S왩n:5P!ku \ No newline at end of file diff --git a/DTMF_sounds/7.wav b/DTMF_sounds/7.wav deleted file mode 100644 index 6cdce5c1..00000000 Binary files a/DTMF_sounds/7.wav and /dev/null differ diff --git a/DTMF_sounds/8.gsm b/DTMF_sounds/8.gsm deleted file mode 100644 index e931896a..00000000 Binary files a/DTMF_sounds/8.gsm and /dev/null differ diff --git a/DTMF_sounds/8.wav b/DTMF_sounds/8.wav deleted file mode 100644 index 3ed04b3b..00000000 Binary files a/DTMF_sounds/8.wav and /dev/null differ diff --git a/DTMF_sounds/9.gsm b/DTMF_sounds/9.gsm deleted file mode 100644 index 4a994705..00000000 Binary files a/DTMF_sounds/9.gsm and /dev/null differ diff --git a/DTMF_sounds/9.wav b/DTMF_sounds/9.wav deleted file mode 100644 index 1439a595..00000000 Binary files a/DTMF_sounds/9.wav and /dev/null differ diff --git a/DTMF_sounds/US_pol_survey_hello.gsm b/DTMF_sounds/US_pol_survey_hello.gsm deleted file mode 100644 index 62e844ee..00000000 Binary files a/DTMF_sounds/US_pol_survey_hello.gsm and /dev/null differ diff --git a/DTMF_sounds/US_pol_survey_transfer.gsm b/DTMF_sounds/US_pol_survey_transfer.gsm deleted file mode 100644 index 897afabb..00000000 Binary files a/DTMF_sounds/US_pol_survey_transfer.gsm and /dev/null differ diff --git a/DTMF_sounds/US_reminder_callback.gsm b/DTMF_sounds/US_reminder_callback.gsm deleted file mode 100644 index dfb73f5e..00000000 Binary files a/DTMF_sounds/US_reminder_callback.gsm and /dev/null differ diff --git a/DTMF_sounds/US_reminder_goodbye.gsm b/DTMF_sounds/US_reminder_goodbye.gsm deleted file mode 100644 index 4759fdf8..00000000 Binary files a/DTMF_sounds/US_reminder_goodbye.gsm and /dev/null differ diff --git a/DTMF_sounds/US_reminder_message.gsm b/DTMF_sounds/US_reminder_message.gsm deleted file mode 100644 index 863cbabf..00000000 Binary files a/DTMF_sounds/US_reminder_message.gsm and /dev/null differ diff --git a/DTMF_sounds/US_reminder_options.gsm b/DTMF_sounds/US_reminder_options.gsm deleted file mode 100644 index 774fe35c..00000000 Binary files a/DTMF_sounds/US_reminder_options.gsm and /dev/null differ diff --git a/DTMF_sounds/US_thanks_no_contact.gsm b/DTMF_sounds/US_thanks_no_contact.gsm deleted file mode 100644 index c0e6a2b2..00000000 Binary files a/DTMF_sounds/US_thanks_no_contact.gsm and /dev/null differ diff --git a/DTMF_sounds/auth-thankyou.gsm b/DTMF_sounds/auth-thankyou.gsm deleted file mode 100644 index 45e7104e..00000000 Binary files a/DTMF_sounds/auth-thankyou.gsm and /dev/null differ diff --git a/DTMF_sounds/buzz.gsm b/DTMF_sounds/buzz.gsm deleted file mode 100644 index 9549d64c..00000000 Binary files a/DTMF_sounds/buzz.gsm and /dev/null differ diff --git a/DTMF_sounds/ding.gsm b/DTMF_sounds/ding.gsm deleted file mode 100644 index 2680c52e..00000000 Binary files a/DTMF_sounds/ding.gsm and /dev/null differ diff --git a/DTMF_sounds/enter.gsm b/DTMF_sounds/enter.gsm deleted file mode 100644 index aa4dafb6..00000000 Binary files a/DTMF_sounds/enter.gsm and /dev/null differ diff --git a/DTMF_sounds/four_digit_id.gsm b/DTMF_sounds/four_digit_id.gsm deleted file mode 100644 index 5c60505d..00000000 Binary files a/DTMF_sounds/four_digit_id.gsm and /dev/null differ diff --git a/DTMF_sounds/generic_hold.gsm b/DTMF_sounds/generic_hold.gsm deleted file mode 100644 index c76eccd8..00000000 Binary files a/DTMF_sounds/generic_hold.gsm and /dev/null differ diff --git a/DTMF_sounds/hash.gsm b/DTMF_sounds/hash.gsm deleted file mode 100644 index 0d0a8ecf..00000000 --- a/DTMF_sounds/hash.gsm +++ /dev/null @@ -1,2 +0,0 @@ -\}PcȣP tۆD#E)#i(*E3yBF:W2wWԢ6TyuWI+sdWysuk2yct9,,Wk|UTWu#.1c}yQ( dº\2! Q\?;waWnfy.7FW){?YW!Q nSB*qUUy>XWQDm! \ No newline at end of file diff --git a/DTMF_sounds/hash.wav b/DTMF_sounds/hash.wav deleted file mode 100644 index a079f449..00000000 Binary files a/DTMF_sounds/hash.wav and /dev/null differ diff --git a/DTMF_sounds/hold_tone.gsm b/DTMF_sounds/hold_tone.gsm deleted file mode 100644 index 8f9686cd..00000000 Binary files a/DTMF_sounds/hold_tone.gsm and /dev/null differ diff --git a/DTMF_sounds/ld_invalid_pin_number.gsm b/DTMF_sounds/ld_invalid_pin_number.gsm deleted file mode 100644 index a733207e..00000000 Binary files a/DTMF_sounds/ld_invalid_pin_number.gsm and /dev/null differ diff --git a/DTMF_sounds/ld_welcome_pin_number.gsm b/DTMF_sounds/ld_welcome_pin_number.gsm deleted file mode 100644 index 1e77f4b3..00000000 Binary files a/DTMF_sounds/ld_welcome_pin_number.gsm and /dev/null differ diff --git a/DTMF_sounds/leave.gsm b/DTMF_sounds/leave.gsm deleted file mode 100644 index 7b3bef01..00000000 Binary files a/DTMF_sounds/leave.gsm and /dev/null differ diff --git a/DTMF_sounds/silence.wav b/DTMF_sounds/silence.wav deleted file mode 100644 index 62565704..00000000 Binary files a/DTMF_sounds/silence.wav and /dev/null differ diff --git a/DTMF_sounds/star.gsm b/DTMF_sounds/star.gsm deleted file mode 100644 index 5ec8908e..00000000 --- a/DTMF_sounds/star.gsm +++ /dev/null @@ -1,2 +0,0 @@ -:nPSat֪j*PR6۞D IDCtb LICENSE: GPLv2 -# -# CHANGES -# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.11.20';} - -$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$inbound_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $inbound_to_print) - { - $row=mysql_fetch_row($rslt); - $inbound[$i] =$row[0]; - $fullnum[$i] =$row[1]; - $inbname[$i] =$row[2]; - $i++; - } -?> - - - - - -\n"; -#echo"\n"; -echo "ASTERISK: Inbound Calls Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A NUMBER AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "ASTERISK: Inbound Calls Stats                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
-if (eregi("\*",$group))
-	{$extenSQL = "and extension LIKE \"%$group\"";}
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls That came into this number:       $TOTALcalls\n";
-echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-if ($row[0])
-	{
-	$average_hold_seconds = ($row[1] / $row[0]);
-	$average_hold_seconds = round($average_hold_seconds, 0);
-	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-	}
-else {$DROPpercent=0;   $average_hold_seconds=0;}
-echo "Total DROP Calls:   (less than 10 seconds)    $DROPcalls  $DROPpercent%\n";
-echo "Average Call Length(seconds) for DROP Calls:  $average_hold_seconds\n";
-
-
-##############################
-#########  CALLS STATS
-
-echo "\n";
-echo "---------- CALL LISTINGS\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-echo "| CALLERID             | CALLERIDNAME         | LENGTH | DATE TIME           |\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$CID =			sprintf("%-20s", $row[0]);
-	$CIDname =		sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$datetime =		sprintf("%-19s", $row[3]);
-	$USERavgTALK =	$row[2];
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
-
-	$i++;
-	}
-
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-##############################
-#########  TIME STATS
-
-if ($output == 'FULL')
-	{
-
-	echo "\n";
-	echo "---------- TIME STATS\n";
-
-	echo "\n";
-
-	$hi_hour_count=0;
-	$last_full_record=0;
-	$i=0;
-	$h=0;
-	while ($i <= 96)
-		{
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-		$h++;
-		}
-
-	$hour_multiplier = (100 / $hi_hour_count);
-	#$hour_multiplier = round($hour_multiplier, 0);
-
-	echo "\n";
-	echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS\n";
-
-	$k=1;
-	$Mk=0;
-	$call_scale = '0';
-	while ($k <= 102) 
-		{
-		if ($Mk >= 5) 
-			{
-			$Mk=0;
-			$scale_num=($k / $hour_multiplier);
-			$scale_num = round($scale_num, 0);
-			$LENscale_num = (strlen($scale_num));
-			$k = ($k + $LENscale_num);
-			$call_scale .= "$scale_num";
-			}
-		else
-			{
-			$call_scale .= " ";
-			$k++;   $Mk++;
-			}
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-	#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-	echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-	$ZZ = '00';
-	$i=0;
-	$h=4;
-	$hour= -1;
-	$no_lines_yet=1;
-
-	while ($i <= 96)
-		{
-		$char_counter=0;
-		$time = '      ';
-		if ($h >= 4) 
-			{
-			$hour++;
-			$h=0;
-			if ($hour < 10) {$hour = "0$hour";}
-			$time = "+$hour$ZZ+";
-			}
-		if ($h == 1) {$time = "   15 ";}
-		if ($h == 2) {$time = "   30 ";}
-		if ($h == 3) {$time = "   45 ";}
-		$Ghour_count = $hour_count[$i];
-		if ($Ghour_count < 1) 
-			{
-			if ( ($no_lines_yet) or ($i > $last_full_record) )
-				{
-				$do_nothing=1;
-				}
-			else
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				echo "|$time|";
-				$k=0;   while ($k <= 102) {echo " ";   $k++;}
-				echo "| $hour_count[$i] |\n";
-				}
-			}
-		else
-			{
-			$no_lines_yet=0;
-			$Xhour_count = ($Ghour_count * $hour_multiplier);
-			$Yhour_count = (99 - $Xhour_count);
-
-			$Gdrop_count = $drop_count[$i];
-			if ($Gdrop_count < 1) 
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "*X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 101) {echo " ";   $char_counter++;}
-				echo "| 0     | $hour_count[$i] |\n";
-
-				}
-			else
-				{
-				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-				echo "D";   $char_counter++;
-				$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 102) {echo " ";   $char_counter++;}
-				echo "| $drop_count[$i] | $hour_count[$i] |\n";
-				}
-			}
-		
-		
-		$i++;
-		$h++;
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-	}
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/astguiclient/admin.php b/LANG_admin/astguiclient/admin.php deleted file mode 100644 index 75f407c7..00000000 --- a/LANG_admin/astguiclient/admin.php +++ /dev/null @@ -1,1824 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI database administration -# -# CHANGES -# 50913-1118 - Added outbound_cid for web-client calls -# 50926-1356 - Modified to allow for language translation -# 50926-1613 - Added WeBRooTWritablE write controls -# 51128-1254 - Modified to allow PHP global vars off -# 51208-2120 - Added option to login with vicidial_user login if allowed -# 51213-1650 - Added option to delete phones if allowed by vicidial_users -# 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1137 - Fixed phone search bug -# 60620-1243 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '1.1.12'; -$build = '60620-1243'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_id"])) {$server_id=$_GET["server_id"];} - elseif (isset($_POST["server_id"])) {$server_id=$_POST["server_id"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} - elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} -if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} - elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} -if (isset($_GET["computer_ip"])) {$computer_ip=$_GET["computer_ip"];} - elseif (isset($_POST["computer_ip"])) {$computer_ip=$_POST["computer_ip"];} -if (isset($_GET["login"])) {$login=$_GET["login"];} - elseif (isset($_POST["login"])) {$login=$_POST["login"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["phone_type"])) {$phone_type=$_GET["phone_type"];} - elseif (isset($_POST["phone_type"])) {$phone_type=$_POST["phone_type"];} -if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} - elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} -if (isset($_GET["company"])) {$company=$_GET["company"];} - elseif (isset($_POST["company"])) {$company=$_POST["company"];} -if (isset($_GET["picture"])) {$picture=$_GET["picture"];} - elseif (isset($_POST["picture"])) {$picture=$_POST["picture"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} - elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} -if (isset($_GET["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"];} - elseif (isset($_POST["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];} -if (isset($_GET["ASTmgrSECRET"])) {$ASTmgrSECRET=$_GET["ASTmgrSECRET"];} - elseif (isset($_POST["ASTmgrSECRET"])) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];} -if (isset($_GET["login_user"])) {$login_user=$_GET["login_user"];} - elseif (isset($_POST["login_user"])) {$login_user=$_POST["login_user"];} -if (isset($_GET["login_pass"])) {$login_pass=$_GET["login_pass"];} - elseif (isset($_POST["login_pass"])) {$login_pass=$_POST["login_pass"];} -if (isset($_GET["login_campaign"])) {$login_campaign=$_GET["login_campaign"];} - elseif (isset($_POST["login_campaign"])) {$login_campaign=$_POST["login_campaign"];} -if (isset($_GET["park_on_extension"])) {$park_on_extension=$_GET["park_on_extension"];} - elseif (isset($_POST["park_on_extension"])) {$park_on_extension=$_POST["park_on_extension"];} -if (isset($_GET["conf_on_extension"])) {$conf_on_extension=$_GET["conf_on_extension"];} - elseif (isset($_POST["conf_on_extension"])) {$conf_on_extension=$_POST["conf_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"];} - elseif (isset($_POST["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"];} - elseif (isset($_POST["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];} -if (isset($_GET["monitor_prefix"])) {$monitor_prefix=$_GET["monitor_prefix"];} - elseif (isset($_POST["monitor_prefix"])) {$monitor_prefix=$_POST["monitor_prefix"];} -if (isset($_GET["recording_exten"])) {$recording_exten=$_GET["recording_exten"];} - elseif (isset($_POST["recording_exten"])) {$recording_exten=$_POST["recording_exten"];} -if (isset($_GET["voicemail_exten"])) {$voicemail_exten=$_GET["voicemail_exten"];} - elseif (isset($_POST["voicemail_exten"])) {$voicemail_exten=$_POST["voicemail_exten"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["dtmf_send_extension"])) {$dtmf_send_extension=$_GET["dtmf_send_extension"];} - elseif (isset($_POST["dtmf_send_extension"])) {$dtmf_send_extension=$_POST["dtmf_send_extension"];} -if (isset($_GET["call_out_number_group"])) {$call_out_number_group=$_GET["call_out_number_group"];} - elseif (isset($_POST["call_out_number_group"])) {$call_out_number_group=$_POST["call_out_number_group"];} -if (isset($_GET["client_browser"])) {$client_browser=$_GET["client_browser"];} - elseif (isset($_POST["client_browser"])) {$client_browser=$_POST["client_browser"];} -if (isset($_GET["install_directory"])) {$install_directory=$_GET["install_directory"];} - elseif (isset($_POST["install_directory"])) {$install_directory=$_POST["install_directory"];} -if (isset($_GET["local_web_callerID_URL"])) {$local_web_callerID_URL=$_GET["local_web_callerID_URL"];} - elseif (isset($_POST["local_web_callerID_URL"])) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];} -if (isset($_GET["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"];} - elseif (isset($_POST["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];} -if (isset($_GET["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"];} - elseif (isset($_POST["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];} -if (isset($_GET["user_switching_enabled"])) {$user_switching_enabled=$_GET["user_switching_enabled"];} - elseif (isset($_POST["user_switching_enabled"])) {$user_switching_enabled=$_POST["user_switching_enabled"];} -if (isset($_GET["conferencing_enabled"])) {$conferencing_enabled=$_GET["conferencing_enabled"];} - elseif (isset($_POST["conferencing_enabled"])) {$conferencing_enabled=$_POST["conferencing_enabled"];} -if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} - elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} -if (isset($_GET["admin_hijack_enabled"])) {$admin_hijack_enabled=$_GET["admin_hijack_enabled"];} - elseif (isset($_POST["admin_hijack_enabled"])) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];} -if (isset($_GET["admin_monitor_enabled"])) {$admin_monitor_enabled=$_GET["admin_monitor_enabled"];} - elseif (isset($_POST["admin_monitor_enabled"])) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];} -if (isset($_GET["call_parking_enabled"])) {$call_parking_enabled=$_GET["call_parking_enabled"];} - elseif (isset($_POST["call_parking_enabled"])) {$call_parking_enabled=$_POST["call_parking_enabled"];} -if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["updater_check_enabled"];} - elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];} -if (isset($_GET["AFLogging_enabled"])) {$AFLogging_enabled=$_GET["AFLogging_enabled"];} - elseif (isset($_POST["AFLogging_enabled"])) {$AFLogging_enabled=$_POST["AFLogging_enabled"];} -if (isset($_GET["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"];} - elseif (isset($_POST["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];} -if (isset($_GET["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"];} - elseif (isset($_POST["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];} -if (isset($_GET["voicemail_button_enabled"])) {$voicemail_button_enabled=$_GET["voicemail_button_enabled"];} - elseif (isset($_POST["voicemail_button_enabled"])) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];} -if (isset($_GET["enable_fast_refresh"])) {$enable_fast_refresh=$_GET["enable_fast_refresh"];} - elseif (isset($_POST["enable_fast_refresh"])) {$enable_fast_refresh=$_POST["enable_fast_refresh"];} -if (isset($_GET["fast_refresh_rate"])) {$fast_refresh_rate=$_GET["fast_refresh_rate"];} - elseif (isset($_POST["fast_refresh_rate"])) {$fast_refresh_rate=$_POST["fast_refresh_rate"];} -if (isset($_GET["enable_persistant_mysql"])) {$enable_persistant_mysql=$_GET["enable_persistant_mysql"];} - elseif (isset($_POST["enable_persistant_mysql"])) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];} -if (isset($_GET["auto_dial_next_number"])) {$auto_dial_next_number=$_GET["auto_dial_next_number"];} - elseif (isset($_POST["auto_dial_next_number"])) {$auto_dial_next_number=$_POST["auto_dial_next_number"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["DBX_server"])) {$DBX_server=$_GET["DBX_server"];} - elseif (isset($_POST["DBX_server"])) {$DBX_server=$_POST["DBX_server"];} -if (isset($_GET["DBX_database"])) {$DBX_database=$_GET["DBX_database"];} - elseif (isset($_POST["DBX_database"])) {$DBX_database=$_POST["DBX_database"];} -if (isset($_GET["DBX_user"])) {$DBX_user=$_GET["DBX_user"];} - elseif (isset($_POST["DBX_user"])) {$DBX_user=$_POST["DBX_user"];} -if (isset($_GET["DBX_pass"])) {$DBX_pass=$_GET["DBX_pass"];} - elseif (isset($_POST["DBX_pass"])) {$DBX_pass=$_POST["DBX_pass"];} -if (isset($_GET["DBX_port"])) {$DBX_port=$_GET["DBX_port"];} - elseif (isset($_POST["DBX_port"])) {$DBX_port=$_POST["DBX_port"];} -if (isset($_GET["DBY_server"])) {$DBY_server=$_GET["DBY_server"];} - elseif (isset($_POST["DBY_server"])) {$DBY_server=$_POST["DBY_server"];} -if (isset($_GET["DBY_database"])) {$DBY_database=$_GET["DBY_database"];} - elseif (isset($_POST["DBY_database"])) {$DBY_database=$_POST["DBY_database"];} -if (isset($_GET["DBY_user"])) {$DBY_user=$_GET["DBY_user"];} - elseif (isset($_POST["DBY_user"])) {$DBY_user=$_POST["DBY_user"];} -if (isset($_GET["DBY_pass"])) {$DBY_pass=$_GET["DBY_pass"];} - elseif (isset($_POST["DBY_pass"])) {$DBY_pass=$_POST["DBY_pass"];} -if (isset($_GET["DBY_port"])) {$DBY_port=$_GET["DBY_port"];} - elseif (isset($_POST["DBY_port"])) {$DBY_port=$_POST["DBY_port"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["old_extension"])) {$old_extension=$_GET["old_extension"];} - elseif (isset($_POST["old_extension"])) {$old_extension=$_POST["old_extension"];} -if (isset($_GET["old_server_ip"])) {$old_server_ip=$_GET["old_server_ip"];} - elseif (isset($_POST["old_server_ip"])) {$old_server_ip=$_POST["old_server_ip"];} -if (isset($_GET["old_server_id"])) {$old_server_id=$_GET["old_server_id"];} - elseif (isset($_POST["old_server_id"])) {$old_server_id=$_POST["old_server_id"];} -if (isset($_GET["server_description"])) {$server_description=$_GET["server_description"];} - elseif (isset($_POST["server_description"])) {$server_description=$_POST["server_description"];} -if (isset($_GET["asterisk_version"])) {$asterisk_version=$_GET["asterisk_version"];} - elseif (isset($_POST["asterisk_version"])) {$asterisk_version=$_POST["asterisk_version"];} -if (isset($_GET["max_vicidial_trunks"])) {$max_vicidial_trunks=$_GET["max_vicidial_trunks"];} - elseif (isset($_POST["max_vicidial_trunks"])) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];} -if (isset($_GET["telnet_host"])) {$telnet_host=$_GET["telnet_host"];} - elseif (isset($_POST["telnet_host"])) {$telnet_host=$_POST["telnet_host"];} -if (isset($_GET["telnet_port"])) {$telnet_port=$_GET["telnet_port"];} - elseif (isset($_POST["telnet_port"])) {$telnet_port=$_POST["telnet_port"];} -if (isset($_GET["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"];} - elseif (isset($_POST["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];} -if (isset($_GET["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"];} - elseif (isset($_POST["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];} -if (isset($_GET["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"];} - elseif (isset($_POST["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];} -if (isset($_GET["answer_transfer_agent"])) {$answer_transfer_agent=$_GET["answer_transfer_agent"];} - elseif (isset($_POST["answer_transfer_agent"])) {$answer_transfer_agent=$_POST["answer_transfer_agent"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["old_conf_exten"])) {$old_conf_exten=$_GET["old_conf_exten"];} - elseif (isset($_POST["old_conf_exten"])) {$old_conf_exten=$_POST["old_conf_exten"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS and Dots -$phone_ip = ereg_replace("[^\.0-9]","",$phone_ip); -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$old_server_ip = ereg_replace("[^\.0-9]","",$old_server_ip); -$computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); - -### DIGITS ONLY ### -$dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); -$voicemail_id = ereg_replace("[^0-9]","",$voicemail_id); -$outbound_cid = ereg_replace("[^0-9]","",$outbound_cid); -$VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); -$park_on_extension = ereg_replace("[^0-9]","",$park_on_extension); -$conf_on_extension = ereg_replace("[^0-9]","",$conf_on_extension); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$old_conf_exten = ereg_replace("[^0-9]","",$old_conf_exten); -$voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); -$voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); -$recording_exten = ereg_replace("[^0-9]","",$recording_exten); -$monitor_prefix = ereg_replace("[^0-9]","",$monitor_prefix); -$answer_transfer_agent = ereg_replace("[^0-9]","",$answer_transfer_agent); -$DBX_port = ereg_replace("[^0-9]","",$DBX_port); -$DBY_port = ereg_replace("[^0-9]","",$DBY_port); -$telnet_port = ereg_replace("[^0-9]","",$telnet_port); -$max_vicidial_trunks = ereg_replace("[^0-9]","",$max_vicidial_trunks); -$auto_dial_next_number = ereg_replace("[^0-9]","",$auto_dial_next_number); -$VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); -$enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); -$enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); -$user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); -$updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); -$QUEUE_ACTION_enabled = ereg_replace("[^0-9]","",$QUEUE_ACTION_enabled); -$conferencing_enabled = ereg_replace("[^0-9]","",$conferencing_enabled); -$voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); -$CallerID_popup_enabled = ereg_replace("[^0-9]","",$CallerID_popup_enabled); -$call_parking_enabled = ereg_replace("[^0-9]","",$call_parking_enabled); -$AGI_call_logging_enabled = ereg_replace("[^0-9]","",$AGI_call_logging_enabled); -$AFLogging_enabled = ereg_replace("[^0-9]","",$AFLogging_enabled); -$admin_monitor_enabled = ereg_replace("[^0-9]","",$admin_monitor_enabled); -$admin_hijack_enabled = ereg_replace("[^0-9]","",$admin_hijack_enabled); -$admin_hangup_enabled = ereg_replace("[^0-9]","",$admin_hangup_enabled); -$fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); -$ADD = ereg_replace("[^0-9]","",$ADD); - -### ALPHA-NUMERIC and underscore and dash and slash and at and dot -$extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); -$old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); -$install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); -$client_browser = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$client_browser); -$dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); -$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); -$telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); -$DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); -$DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); - -### ALPHA-NUMERIC (and underscore and dash) -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$login = ereg_replace("[^-\_0-9a-zA-Z]","",$login); -$user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^-\_0-9a-zA-Z]","",$pass); -$status = ereg_replace("[^-\_0-9a-zA-Z]","",$status); -$protocol = ereg_replace("[^-\_0-9a-zA-Z]","",$protocol); -$ASTmgrUSERNAMEupdate = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEupdate); -$ASTmgrUSERNAMEsend = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEsend); -$ASTmgrUSERNAMElisten = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMElisten); -$ASTmgrUSERNAME = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAME); -$ASTmgrSECRET = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrSECRET); -$login_user = ereg_replace("[^-\_0-9a-zA-Z]","",$login_user); -$login_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$login_pass); -$login_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$login_campaign); -$DBX_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_user); -$DBY_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_user); -$DBX_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_pass); -$DBY_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_pass); -$DBX_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_database); -$DBY_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_database); -$VICIDIAL_park_on_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$VICIDIAL_park_on_filename); -$server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); -$old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); -$ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); -$CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); -$company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); -$picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); -$local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); -$server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); -$asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - -### VARIABLES TO BE mysql_real_escape_string ### -# $VICIDIAL_web_URL = -# $local_web_callerID_URL = - -##### END VARIABLE FILTERING FOR SECURITY ##### - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -if (!isset($ADD)) {$ADD=0;} - -$STARTtime = date("U"); -$STARTdate = date("Y-m-d H:i:s"); - -if ($ADD==1) {$process = 'ADD NEW PHONE';} -if ($ADD==11) {$process = 'ADD NEW SERVER';} -if ($ADD==111) {$process = 'ADD NEW CONFERENCE';} -if ($ADD==2) {$process = 'ADDING NEW PHONE';} -if ($ADD==21) {$process = 'ADDING NEW SERVER';} -if ($ADD==211) {$process = 'ADDING NEW CONFERENCE';} -if ($ADD==3) {$process = 'MODIFY PHONE';} -if ($ADD==31) {$process = 'MODIFY SERVER';} -if ($ADD==311) {$process = 'MODIFY CONFERENCE';} -if ($ADD==4) {$process = 'MODIFYING PHONE';} -if ($ADD==41) {$process = 'MODIFYING SERVER';} -if ($ADD==411) {$process = 'MODIFYING CONFERENCE';} -if ($ADD==5) {$process = 'DELETE PHONE';} -if ($ADD==6) {$process = 'DELETE PHONE';} -if ($ADD==55) {$process = 'SEARCH PHONES';} -if ($ADD==66) {$process = 'SEARCH PHONES RESULTS';} -if ($ADD==0) {$process = 'PHONE LIST';} -if ($ADD==10) {$process = 'SERVER LIST';} -if ($ADD==100) {$process = 'CONFERENCE LIST';} -if ($ADD==99999) {$process = 'HELP';} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if ($auth<1) - { - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > '6' and ast_admin_access='1';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGdelete_phones =$row[17]; - } - } - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - echo "|$stmt|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - if (strlen($LOGfullname) < 1) - { - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - } - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rsltx=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rsltx); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $servers_list .= "\n"; - $o++; - } - - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); - -$NWB = "   \"HELP\""; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "ASTERISK ADMIN: Administration - $process \n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
ASTERISK ADMIN: HELP


\n"; - -?> -PHONES TABLE

- -
-Phone extension - This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones make sure you use the full phones name: IAX2/IAXphone1@IAXphone1 would be IAXphone1@IAXphone1. For Zap phones make sure you put the full channel: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol below correctly for your type of phone. - -
-
-
-Dialplan number - This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server - -
-
-
-Voicemail Box - This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app. - -
-
-
-Outbound CallerID - This field is where you would enter the callerID number that you would like to appear on outbound calls placed form the astguiclient web-client. This does not work on RBS, non-PRI, T1/E1s. - -
-
-
-Phone IP address - This field is for the phone's IP address if it is a VOIP phone. This is an optional field - -
-
-
-Computer IP address - This field is for the user's computer IP address. This is an optional field - -
-
-
-Server IP - This menu is where you select which server the phone is active on. - -
-
-
-Login - The login used for the phone user to login to the client applications. - -
-
-
-Password - The password used for the phone user to login to the client applications. - -
-
-
-Status - The status of the phone in the system, ACTIVE and ADMIN allow for GUI clients to work. ADMIN allows access to this administrative web site. All other statuses do not allow GUI or Admin web access. - -
-
-
-Active Account - Whether the phone is active to put it in the list in the GUI client. - -
-
-
-Phone Type - Purely for administrative notes. - -
-
-
-Full Name - Used by the GUIclient in the list of active phones. - -
-
-
-Company - Purely for administrative notes. - -
-
-
-Picture - Not yet Implemented. - -
-
-
-New Messages - Number of new voicemail messages for this phone on the Asterisk server. - -
-
-
-Old Messages - Number of old voicemail messages for this phone on the Asterisk server. - -
-
-
-Client Protocol - The protocol that the phone uses to connect to the Asterisk server: SIP, IAX2, Zap . Also, there is EXTERNAL for remote dial numbers or speed dial numbers that you want to list as phones. - -
-
-
-Local GMT - The difference from Greenwich Mean time, or ZULU time where the phone is located. DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. This is used by the VICIDIAL campaign to accurately display the time and customer time. - -
-
-
-Manager Login - This is the login that the GUI clients for this phone will use to access the Database where the server data resides. - -
-
-
-Manager Secret - This is the password that the GUI clients for this phone will use to access the Database where the server data resides. - -
-
-
-VICIDIAL Default User - This is to place a default value in the VICIDIAL user field whenever this phone user opens the astVICIDIAL client app. Leave blank for no user. - -
-
-
-VICIDIAL Default Pass - This is to place a default value in the VICIDIAL password field whenever this phone user opens the astVICIDIAL client app. Leave blank for no pass. - -
-
-
-VICIDIAL Default Campaign - This is to place a default value in the VICIDIAL campaign field whenever this phone user opens the astVICIDIAL client app. Leave blank for no campaign. - -
-
-
-Park Exten - This is the default Parking extension for the client apps. Verify that a different one works before you change this. - -
-
-
-Conf Exten - This is the default Conference park extension for the client apps. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park Exten - This is the default Parking extension for VICIDIAL client app. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park File - This is the default VICIDIAL park extension file name for the client apps. Verify that a different one works before you change this. limited to 10 characters. - -
-
-
-Monitor Prefix - This is the dialplan prefix for monitoring of Zap channels automatically within the astGUIclient app. Only change according to the extensions.conf ZapBarge extensions records. - -
-
-
-Recording Exten - This is the dialplan extension for the recording extension that is used to drop into meetme conferences to record them. It usually lasts upto one hour if not stopped. verify with extensions.conf file before changing. - -
-
-
-VMAIL Main Exten - This is the dialplan extension going to check your voicemail. verify with extensions.conf file before changing. - -
-
-
-VMAIL Dump Exten - This is the dialplan prefix used to send calls directly to a user's voicemail from a live call in the astGUIclient app. verify with extensions.conf file before changing. - -
-
-
-Exten Context - This is the dialplan context that this phone primarily uses. It is assumed that all numbers dialed by the client apps are using this context so it is a good idea to make sure this is the most wide context possible. verify with extensions.conf file before changing. - -
-
-
-DTMF send Channel - This is the channel string used to send DTMF sounds into meetme conferences from the client apps. Verify the exten and context with the extensions.conf file. - -
-
-
-Outbound Call Group - This is the channel group that outbound calls from this phone are placed out of. There are a couple routines in the client apps that use this. For Zap channels you want to use something like Zap/g2 , for IAX2 trunks you would want to use the full IAX prefix like IAX2/VICItest1:secret@10.10.10.15:4569. Verify the trunks with the extensions.conf file, it is usually what you have defined as the TRUNK global variable at the top of the file. - -
-
-
-Browser Location - This is applicable to only UNIX/LINUX clients, the absolute path to Mozilla or Firefox browser on the machine. verify this by launching it manually. - -
-
-
-Install Directory - This is the place where the astGUIclient and astVICIDIAL scripts are located on your machine. For Win32 it should be something like C:\AST_VICI and for UNIX it should be something like /usr/local/perl_TK. verify this manually. - -
-
-
-CallerID URL - This is the web address of the page used to do custom callerID lookups. default testing address is: http://astguiclient.sf.net/test_callerid_output.php - -
-
-
-VICIDIAL Default URL - This is the web address of the page used to do custom VICIDIAL Web Form queries. default testing address is: http://astguiclient.sf.net/test_VICIDIAL_output.php - -
-
-
-Call Logging - This is set to true if the call_log.agi file is in place in the extensions.conf file for all outbound and hangup 'h' extensions to log all calls. This should always be 1 because it is manditory for many astGUIclient and VICIDIAL features to work properly. - -
-
-
-User Switching - Set to true to allow user to switch to another user account. NOTE: If user switches they can initiate recording on the new user's phone conversation - -
-
-
-Conferencing - Set to true to allow user to start conference calls with upto six external lines. - -
-
-
-Admin Hangup - Set to true to allow user to be able to hangup any line at will through astGUIclient. Good idea only to enable this for Admin users. - -
-
-
-Admin Hijack - Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers. - -
-
-
-Admin Monitor - Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers and as a training tool. - -
-
-
-Call Park - Set to true to allow user to be able to park calls on astGUIclient hold to be picked up by any other astGUIclient user on the system. Calls stay on hold for upto a half hour then hangup. Usually enabled for all. - -
-
-
-Updater Check - Set to true to display a popup warning that the updater time has not changed in 20 seconds. Useful for Admin users. - -
-
-
-AF Logging - Set to true to log many actions of astGUIclient usage to a text file on the user's computer. - -
-
-
-Queue Enabled - Set to true to have client apps use the Asterisk Central Queue system. Required for VICIDIAL and recommended for all users. - -
-
-
-CallerID Popup - Set to true to allow for numbers defined in the extensions.conf file to send CallerID popup screens to astGUIclient users. - -
-
-
-VMail Button - Set to true to display the VOICEMAIL button and the messages count display on astGUIclient. - -
-
-
-Fast Refresh - Set to true to enable a new rate of refresh of call information for the astGUIclient. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number. - -
-
-
-Fast Refresh Rate - in milliseconds. Only used if Fast Refresh is enabled. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number. - -
-
-
-Persistant MySQL - If enabled the astGUIclient connection will remain connected instead of connecting every second. Useful if you have a fast refresh rate set. It will increase the number of connections on your MySQL machine. - -
-
-
-Auto Dial Next Number - If enabled the VICIDIAL client will dial the next number on the list automatically upon disposition of a call unless they selected to "Stop Dialing" on the disposition screen. - -
-
-
-Stop Rec after each call - If enabled the VICIDIAL client will stop whatever recording is going on after each call has been dispositioned. Useful if you are doing a lot of recording or you are using a web form to trigger recording. - -
-
-
-DBX Server - The MySQL database server that this user should be connecting to. - -
-
-
-DBX Database - The MySQL database that this user should be connecting to. Default is asterisk. - -
-
-
-DBX User - The MySQL user login that this user should be using when connecting. Default is cron. - -
-
-
-DBX Pass - The MySQL user password that this user should be using when connecting. Default is 1234. - -
-
-
-DBX Port - The MySQL TCP port that this user should be using when connecting. Default is 3306. - -
-
-
-DBY Server - The MySQL database server that this user should be connecting to. Secondary server, not used currently. - -
-
-
-DBY Database - The MySQL database that this user should be connecting to. Default is asterisk. Secondary server, not used currently. - -
-
-
-DBY User - The MySQL user login that this user should be using when connecting. Default is cron. Secondary server, not used currently. - -
-
-
-DBY Pass - The MySQL user password that this user should be using when connecting. Default is 1234. Secondary server, not used currently. - -
-
-
-DBY Port - The MySQL TCP port that this user should be using when connecting. Default is 3306. Secondary server, not used currently. - - -



- -SERVERS TABLE

-
-
-Server ID - This field is where you put the Asterisk servers name, doesnt have to be an official domain sub, just a nickname to identify the server to Admin users. - -
-
-
-Server Description - The field where you use a small phrase to describe the Asterisk server. - -
-
-
-Server IP Address - The field where you put the Network IP address of the Asterisk server. - -
-
-
-Active - Set whether the Asterisk server is active or inactive. - -
-
-
-Asterisk Version - Set the version of Asterisk that you have installed on this server. Examples: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... This is used because versions 1.0.8 and 1.0.9 have a different method of dealing with Local/ channels, a bug that has been fixed in CVS v1.0, and need to be treated differently when handling their Local/ channels. Also, current CVS_HEAD and the 1.2 release tree uses different manager and command output so it must be treated differently as well. - -
-
-
-Max VICIDIAL Trunks - This field will determine the maximum number of lines that the VICIDIAL auto-dialer will attempt to call on this server. If you want to dedicate two full PRI T1s to VICIDIALing on a server then you would set this to 46. Default is 96. - -
-
-
-Telnet Host - This is the address or name of the Asterisk server and is how the manager applications connect to it from where they are running. If they are running on the Asterisk server, then the default of 'localhost' is fine. - -
-
-
-Telnet Port - This is the port of the Asterisk server Manager connection and is how the manager applications connect to it from where they are running. The default of '5038' is fine for a standard install. - -
-
-
-Manager User - The username or login used to connect genericly to the Asterisk server manager. Default is 'cron' - -
-
-
-Manager Secret - The secret or password used to connect genericly to the Asterisk server manager. Default is '1234' - -
-
-
-Manager Update User - The username or login used to connect to the Asterisk server manager optimized for the Update scripts. Default is 'updatecron' and assumes the same secret as the generic user. - -
-
-
-Manager Listen User - The username or login used to connect to the Asterisk server manager optimized for scripts that only listen for output. Default is 'listencron' and assumes the same secret as the generic user. - -
-
-
-Manager Send User - The username or login used to connect to the Asterisk server manager optimized for scripts that only send Actions to the manager. Default is 'sendcron' and assumes the same secret as the generic user. - -
-
-
-Server GMT offset - The difference in hours from GMT time not adjusted for Daylight-Savings-Time of the server. Default is '-5' - -
-
-
-VMail Dump Exten - The extension prefix used on this server to send calls directly through agc to a specific voicemail box. Default is '85026666666666' - -
-
-
-VICIDIAL AD extension - The default extension if none is present in the campaign to send calls to for VICIDIAL auto dialing. Default is '8365' - -
-
-
-Default Context - The default dialplan context used for scripts that operate for this server. Default is 'default' - - -



- -CONFERENCES TABLE

-
-
-Conference Number - This field is where you put the meetme conference dialpna number. It is also recommended that the meetme number in meetme.conf matches this number for each entry. This is for the conferences in astGUIclient and is used for leave-3way-call functionality in VICIDIAL. - -
-
-
-Server IP - The menu where you select the Asterisk server that this conference will be on. - - - - - - -







-







-THE END -
- - - -ASTERISK ADMIN: Administration - <? echo $process ?> - - - -
- - - - - - -
  ASTERISK ADMIN - Logout  
  LIST ALL PHONES | ADD A NEW PHONE | SEARCH FOR A PHONE | ADD A SERVER | LIST ALL SERVERS
  SHOW ALL CONFERENCES | ADD A NEW CONFERENCE
-"; - -echo "
ADD A NEW PHONE
\n"; -echo "\n"; -echo "
\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW SERVERS FORM SCREEN -###################### - -if ($ADD==11) -{ -echo ""; - -echo "
ADD A NEW SERVER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW CONFERENCES FORM SCREEN -###################### - -if ($ADD==111) -{ -echo ""; - -echo "
ADD A NEW CONFERENCE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\n"; - -} - - -###################### -# ADD=2 adds the new phone to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
PHONE NOT ADDED - there is already a Phone in the system with this extension/server\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
PHONE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
PHONE ADDED\n"; - - $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new server to the system -###################### - -if ($ADD==21) -{ - echo ""; - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SERVER NOT ADDED - there is already a server in the system with this ID\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVER NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
SERVER ADDED\n"; - - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new conference to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CONFERENCE NOT ADDED - there is already a conference in the system with this ID and server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
CONFERENCE ADDED\n"; - - $stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=100; -} - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of phone -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGdelete_phones < 1) ) - { - echo "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - echo "
PHONE DELETION CONFIRMATION: $extension - $server_ip\n"; - echo "

Click here to delete phone $extension - $server_ip


\n"; - } - -$ADD='3'; # go to phone modification below -} - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete phone record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGdelete_phones < 1) ) - { - echo "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } - echo "
PHONE DELETION COMPLETED: $extension - $server_ip\n"; - echo "

\n"; - } - -$ADD='0'; # go to phone list -} - - - - - - -###################### -# ADD=3 modify phone info in the system -###################### - -if ($ADD==3) -{ - echo ""; - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A PHONE RECORD: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
Old Messages: $row[15]$NWB#phones-old_messages$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
Manager Login: $NWB#phones-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Default User: $NWB#phones-login_user$NWE
VICIDIAL Default Pass: $NWB#phones-login_pass$NWE
VICIDIAL Default Campaign: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park File: $NWB#phones-VICIDIAL_park_on_filename$NWE
Monitor Prefix: $NWB#phones-monitor_prefix$NWE
Recording Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Context: $NWB#phones-ext_context$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
Browser Location: $NWB#phones-client_browser$NWE
Install Directory: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Default URL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
User Switching: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hangup: $NWB#phones-admin_hangup_enabled$NWE
Admin Hijack: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Call Park: $NWB#phones-call_parking_enabled$NWE
Updater Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Queue Enabled: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Button: $NWB#phones-voicemail_button_enabled$NWE
Fast Refresh: $NWB#phones-enable_fast_refresh$NWE
Fast Refresh Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Dial Next Number: $NWB#phones-auto_dial_next_number$NWE
Stop Rec after each call: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Server: (Primary DB Server)$NWB#phones-DBX_server$NWE
DBX Database: (Primary Server Database)$NWB#phones-DBX_database$NWE
DBX User: (Primary DB Login)$NWB#phones-DBX_user$NWE
DBX Pass: (Primary DB Secret)$NWB#phones-DBX_pass$NWE
DBX Port: (Primary DB Port)$NWB#phones-DBX_port$NWE
DBY Server: (Secondary DB Server)$NWB#phones-DBY_server$NWE
DBY Database: (Secondary Server Database)$NWB#phones-DBY_database$NWE
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Click here for phone stats\n"; - -if ($LOGdelete_phones > 0) - { - echo "

DELETE THIS PHONE\n"; - } - -} - - -###################### -# ADD=31 modify server info in the system -###################### - -if ($ADD==31) -{ - echo ""; - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A SERVER RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Max VICIDIAL Trunks: $NWB#servers-max_vicidial_trunks$NWE
Telnet Host: $NWB#servers-telnet_host$NWE
Telnet Port: $NWB#servers-telnet_port$NWE
Manager User: $NWB#servers-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#servers-ASTmgrSECRET$NWE
Manager Update User: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Listen User: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Send User: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL AD extension: $NWB#servers-answer_transfer_agent$NWE
Default Context: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
PHONES WITHIN THIS SERVER:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
EXTENSIONNAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This server has $active_lists active phones and $inactive_lists inactive phones

\n"; -echo "
\n"; -} - - -###################### -# ADD=311 modify conference info in the system -###################### - -if ($ADD==311) -{ - echo ""; - - $stmt="SELECT * from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A CONFERENCE RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; - -echo "
\n"; - -} - - - -###################### -# ADD=4 submit phone modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) - {echo "
PHONE NOT MODIFIED - there is already a Phone in the system with this extension/server\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
PHONE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
PHONE MODIFIED: $extension\n"; - - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid' where extension='$old_extension' and server_ip='$old_server_ip';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A PHONE RECORD: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
Old Messages: $row[15]$NWB#phones-old_messages$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
Manager Login: $NWB#phones-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Default User: $NWB#phones-login_user$NWE
VICIDIAL Default Pass: $NWB#phones-login_pass$NWE
VICIDIAL Default Campaign: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park File: $NWB#phones-VICIDIAL_park_on_filename$NWE
Monitor Prefix: $NWB#phones-monitor_prefix$NWE
Recording Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Context: $NWB#phones-ext_context$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
Browser Location: $NWB#phones-client_browser$NWE
Install Directory: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Default URL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
User Switching: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hangup: $NWB#phones-admin_hangup_enabled$NWE
Admin Hijack: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Call Park: $NWB#phones-call_parking_enabled$NWE
Updater Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Queue Enabled: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Button: $NWB#phones-voicemail_button_enabled$NWE
Fast Refresh: $NWB#phones-enable_fast_refresh$NWE
Fast Refresh Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Dial Next Number: $NWB#phones-auto_dial_next_number$NWE
Stop Rec after each call: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Server: (Primary DB Server)$NWB#phones-DBX_server$NWE
DBX Database: (Primary Server Database)$NWB#phones-DBX_database$NWE
DBX User: (Primary DB Login)$NWB#phones-DBX_user$NWE
DBX Pass: (Primary DB Secret)$NWB#phones-DBX_pass$NWE
DBX Port: (Primary DB Port)$NWB#phones-DBX_port$NWE
DBY Server: (Secondary DB Server)$NWB#phones-DBY_server$NWE
DBY Database: (Secondary Server Database)$NWB#phones-DBY_database$NWE
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Click here for phone stats\n"; - -if ($LOGdelete_phones > 0) - { - echo "

DELETE THIS PHONE\n"; - } - -} - -###################### -# ADD=41 submit server modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) - {echo "
SERVER NOT MODIFIED - there is already a server in the system with this server_id\n";} - else - { - $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) - {echo "
SERVER NOT MODIFIED - there is already a server in the system with this server_ip\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVER NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
SERVER MODIFIED: $server_ip\n"; - - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; - $rslt=mysql_query($stmt, $link); - } - } - } - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A SERVER RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Max VICIDIAL Trunks: $NWB#servers-max_vicidial_trunks$NWE
Telnet Host: $NWB#servers-telnet_host$NWE
Telnet Port: $NWB#servers-telnet_port$NWE
Manager User: $NWB#servers-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#servers-ASTmgrSECRET$NWE
Manager Update User: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Listen User: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Send User: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL AD extension: $NWB#servers-answer_transfer_agent$NWE
Default Context: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
PHONES WITHIN THIS SERVER:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
EXTENSIONNAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This server has $active_lists active phones and $inactive_lists inactive phones

\n"; -echo "
\n"; - -} - -###################### -# ADD=411 submit conference modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) - {echo "
CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
CONFERENCE MODIFIED: $conf_exten\n"; - - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from conferences where conf_exten='$conf_exten';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A CONFERENCE RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; - -echo "
\n"; - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo ""; - -echo "
SEARCH FOR A PHONE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
extension:
Full Name:
Phone type:
\n"; - -} - -###################### -# ADD=66 phone search results -###################### - -if ($ADD==66) -{ - echo ""; - - $SQL = ''; - if ($extension) {$SQL .= "extension LIKE \"%$extension%\" and";} - if ($fullname) {$SQL .= "fullname LIKE \"%$fullname%\" and";} - if ($phone_type) {$SQL .= "phone_type LIKE \"%$phone_type%\" and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from phones $SQL order by extension,server_ip;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
SEARCH RESULTS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFY | STATS
\n"; - -} - - - -###################### -# ADD=0 display all active phones -###################### -if ($ADD==0) -{ - echo ""; - - $stmt="SELECT * from phones order by extension,server_ip"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
PHONE LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFY | STATS
\n"; -} - -###################### -# ADD=10 display all servers -###################### -if ($ADD==10) -{ - echo ""; - - $stmt="SELECT * from servers order by server_id"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
SERVER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[1] $row[2] $row[4] $row[3]  MODIFY
\n"; -} - - -###################### -# ADD=100 display all conferences -###################### -if ($ADD==100) -{ - echo ""; - - $stmt="SELECT * from conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
CONFERENCE LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]  MODIFY
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; -echo "             VERSION: $version"; -echo "             BUILD: $build
\n"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient/dbconnect.php b/LANG_admin/astguiclient/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_admin/astguiclient/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_admin/astguiclient/help.gif b/LANG_admin/astguiclient/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/astguiclient/help.gif and /dev/null differ diff --git a/LANG_admin/astguiclient/inbound_popup.php b/LANG_admin/astguiclient/inbound_popup.php deleted file mode 100644 index 6f451656..00000000 --- a/LANG_admin/astguiclient/inbound_popup.php +++ /dev/null @@ -1,228 +0,0 @@ - LICENSE: GPLv2 -### -# this is the inbound popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. -# -# changes: -# 60620-1329 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK REMOTE INBOUND: Popup - - -
- - 0) -{ - - $stmt="DELETE from parked_channels where server_ip='$user_server_ip' and parked_time='" . mysql_real_escape_string($parked_time) . "' and channel='" . mysql_real_escape_string($channel) . "' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$user_server_ip','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: " . mysql_real_escape_string($channel) . "','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for channel $channel       $NOW_TIME\n

\n"; - - - $url = 'https://10.10.10.15/internal/back_end_systems/cust_serv/index.php?Search=SEARCH&'; - $Suser = 'username='; - $Spass = '&passwd='; - $Sphone = '&phone='; - - $newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW$Sphone$phone"; - if ( ($phone == 'unknown') or (strlen($phone)<9) ) - {$newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW";} - - echo "Look up this customer in Customer Service System\n

\n"; - - echo "Close this window\n

\n"; -} -else -{ - echo "Redirect command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Close this window\n

\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient/phone_stats.php b/LANG_admin/astguiclient/phone_stats.php deleted file mode 100644 index 8498746a..00000000 --- a/LANG_admin/astguiclient/phone_stats.php +++ /dev/null @@ -1,244 +0,0 @@ - LICENSE: GPLv2 -# -# -# changes: -# 60620-1333 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$admin_page = './admin.php'; - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname from phones where server_ip='$server_ip' and extension='$extension'"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $row[0]; - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK ADMIN: Phone Stats - - -
-
- - - - - - -\n"; -echo "
  ASTERISK ADMIN: Administration  
  LIST ALL PHONES | ADD A NEW PHONE | SEARCH FOR A PHONE | ADD A SERVER | LIST ALL SERVERS
  SHOW ALL CONFERENCES | ADD A NEW CONFERENCE
  \n"; - -echo "\n"; -echo "\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' group by channel_group order by channel_group"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - -echo "
\n"; - -echo "CALL TIME AND CHANNELS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} -# echo "|$stmt|\n"; - -echo "\n"; -echo "
CHANNEL GROUP COUNT HOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LAST 1000 CALLS FOR DATE RANGE:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' LIMIT 1000"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - - - $call_seconds=0; - $o++; - } - - -echo "
NUMBER CHANNEL GROUP DATE LENGTH(MIN.)
$row[0] $row[1] $row[2] $row[3]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient/remote_inbound.php b/LANG_admin/astguiclient/remote_inbound.php deleted file mode 100644 index 06642677..00000000 --- a/LANG_admin/astguiclient/remote_inbound.php +++ /dev/null @@ -1,162 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - echo"\n"; - echo"ASTERISK REMOTE INBOUND: Main\n"; - echo"\n"; - echo"\n"; - echo"\n"; - -?> - - -
- -
\n"; - -echo "Click on the channel below that you would like to have directed to your phone

\n"; - -echo "
\n";
-echo "CHANNEL    SERVER        CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME        \n";
-echo "----------------------------------------------------------------------------------------------\n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='$user_server_ip' order by parked_time";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='$user_server_ip' and channel_group LIKE \"IN_%\" order by parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$extension =		sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		echo "$channel$server$channel_group$extension$parked_by$parked_time\n";
-
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "*************************************** NO PARKED CALLS **************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient/test.php b/LANG_admin/astguiclient/test.php deleted file mode 100644 index 62f8277b..00000000 --- a/LANG_admin/astguiclient/test.php +++ /dev/null @@ -1,30 +0,0 @@ - LICENSE: GPLv2 -### - -$STARTtime = date("U"); -$STARTdate = date("Y-m-d H:i:s"); - - -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); - - $stmt="SELECT * from phones;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - print "|$auth|\n"; - -exit; - - - -?> - - - - - diff --git a/LANG_admin/astguiclient_de/AST_inboundEXTstats.php b/LANG_admin/astguiclient_de/AST_inboundEXTstats.php deleted file mode 100644 index 3a70336a..00000000 --- a/LANG_admin/astguiclient_de/AST_inboundEXTstats.php +++ /dev/null @@ -1,400 +0,0 @@ - LICENSE: GPLv2 -# -# CHANGES -# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.11.20';} - -$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$inbound_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $inbound_to_print) - { - $row=mysql_fetch_row($rslt); - $inbound[$i] =$row[0]; - $fullnum[$i] =$row[1]; - $inbname[$i] =$row[2]; - $i++; - } -?> - - - - - -\n"; -#echo"\n"; -echo "ASTERISK: Inbound Anruf-Notfall\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "WÄHLEN Sie BITTE Eine ZAHL Vor UND DATUM OBEN UND KLICKEN REICHT Ein\n";
-}
-
-else
-{
-
-
-echo "ASTERISK: Inbound Anruf-Notfall                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
-if (eregi("\*",$group))
-	{$extenSQL = "and extension LIKE \"%$group\"";}
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Gesamtanrufe, die in diese Zahl kamen:       $TOTALcalls\n";
-echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-if ($row[0])
-	{
-	$average_hold_seconds = ($row[1] / $row[0]);
-	$average_hold_seconds = round($average_hold_seconds, 0);
-	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-	}
-else {$DROPpercent=0;   $average_hold_seconds=0;}
-echo "Total DROP Calls:   (less than 10 seconds)    $DROPcalls  $DROPpercent%\n";
-echo "Average Call Length(seconds) for DROP Calls:  $average_hold_seconds\n";
-
-
-##############################
-#########  CALLS STATS
-
-echo "\n";
-echo "---------- CALL LISTINGS\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-echo "| CALLERID             | CALLERIDNAME         | LENGTH | DATE TIME           |\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$CID =			sprintf("%-20s", $row[0]);
-	$CIDname =		sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$datetime =		sprintf("%-19s", $row[3]);
-	$USERavgTALK =	$row[2];
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
-
-	$i++;
-	}
-
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-##############################
-#########  TIME STATS
-
-if ($output == 'FULL')
-	{
-
-	echo "\n";
-	echo "---------- TIME STATS\n";
-
-	echo "\n";
-
-	$hi_hour_count=0;
-	$last_full_record=0;
-	$i=0;
-	$h=0;
-	while ($i <= 96)
-		{
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-		$h++;
-		}
-
-	$hour_multiplier = (100 / $hi_hour_count);
-	#$hour_multiplier = round($hour_multiplier, 0);
-
-	echo "\n";
-	echo "DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN VON GESAMTANRUFEN\n";
-
-	$k=1;
-	$Mk=0;
-	$call_scale = '0';
-	while ($k <= 102) 
-		{
-		if ($Mk >= 5) 
-			{
-			$Mk=0;
-			$scale_num=($k / $hour_multiplier);
-			$scale_num = round($scale_num, 0);
-			$LENscale_num = (strlen($scale_num));
-			$k = ($k + $LENscale_num);
-			$call_scale .= "$scale_num";
-			}
-		else
-			{
-			$call_scale .= " ";
-			$k++;   $Mk++;
-			}
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-	#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-	echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-	$ZZ = '00';
-	$i=0;
-	$h=4;
-	$hour= -1;
-	$no_lines_yet=1;
-
-	while ($i <= 96)
-		{
-		$char_counter=0;
-		$time = '      ';
-		if ($h >= 4) 
-			{
-			$hour++;
-			$h=0;
-			if ($hour < 10) {$hour = "0$hour";}
-			$time = "+$hour$ZZ+";
-			}
-		if ($h == 1) {$time = "   15 ";}
-		if ($h == 2) {$time = "   30 ";}
-		if ($h == 3) {$time = "   45 ";}
-		$Ghour_count = $hour_count[$i];
-		if ($Ghour_count < 1) 
-			{
-			if ( ($no_lines_yet) or ($i > $last_full_record) )
-				{
-				$do_nothing=1;
-				}
-			else
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				echo "|$time|";
-				$k=0;   while ($k <= 102) {echo " ";   $k++;}
-				echo "| $hour_count[$i] |\n";
-				}
-			}
-		else
-			{
-			$no_lines_yet=0;
-			$Xhour_count = ($Ghour_count * $hour_multiplier);
-			$Yhour_count = (99 - $Xhour_count);
-
-			$Gdrop_count = $drop_count[$i];
-			if ($Gdrop_count < 1) 
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "*X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 101) {echo " ";   $char_counter++;}
-				echo "| 0     | $hour_count[$i] |\n";
-
-				}
-			else
-				{
-				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-				echo "D";   $char_counter++;
-				$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 102) {echo " ";   $char_counter++;}
-				echo "| $drop_count[$i] | $hour_count[$i] |\n";
-				}
-			}
-		
-		
-		$i++;
-		$h++;
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-	}
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/astguiclient_de/admin.php b/LANG_admin/astguiclient_de/admin.php deleted file mode 100644 index 1a98ea49..00000000 --- a/LANG_admin/astguiclient_de/admin.php +++ /dev/null @@ -1,1824 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI database administration -# -# CHANGES -# 50913-1118 - Added outbound_cid for web-client calls -# 50926-1356 - Modified to allow for language translation -# 50926-1613 - Added WeBRooTWritablE write controls -# 51128-1254 - Modified to allow PHP global vars off -# 51208-2120 - Added option to login with vicidial_user login if allowed -# 51213-1650 - Added option to delete phones if allowed by vicidial_users -# 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1137 - Fixed phone search bug -# 60620-1243 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '1.1.12'; -$build = '60620-1243'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_id"])) {$server_id=$_GET["server_id"];} - elseif (isset($_POST["server_id"])) {$server_id=$_POST["server_id"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} - elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} -if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} - elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} -if (isset($_GET["computer_ip"])) {$computer_ip=$_GET["computer_ip"];} - elseif (isset($_POST["computer_ip"])) {$computer_ip=$_POST["computer_ip"];} -if (isset($_GET["login"])) {$login=$_GET["login"];} - elseif (isset($_POST["login"])) {$login=$_POST["login"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["phone_type"])) {$phone_type=$_GET["phone_type"];} - elseif (isset($_POST["phone_type"])) {$phone_type=$_POST["phone_type"];} -if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} - elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} -if (isset($_GET["company"])) {$company=$_GET["company"];} - elseif (isset($_POST["company"])) {$company=$_POST["company"];} -if (isset($_GET["picture"])) {$picture=$_GET["picture"];} - elseif (isset($_POST["picture"])) {$picture=$_POST["picture"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} - elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} -if (isset($_GET["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"];} - elseif (isset($_POST["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];} -if (isset($_GET["ASTmgrSECRET"])) {$ASTmgrSECRET=$_GET["ASTmgrSECRET"];} - elseif (isset($_POST["ASTmgrSECRET"])) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];} -if (isset($_GET["login_user"])) {$login_user=$_GET["login_user"];} - elseif (isset($_POST["login_user"])) {$login_user=$_POST["login_user"];} -if (isset($_GET["login_pass"])) {$login_pass=$_GET["login_pass"];} - elseif (isset($_POST["login_pass"])) {$login_pass=$_POST["login_pass"];} -if (isset($_GET["login_campaign"])) {$login_campaign=$_GET["login_campaign"];} - elseif (isset($_POST["login_campaign"])) {$login_campaign=$_POST["login_campaign"];} -if (isset($_GET["park_on_extension"])) {$park_on_extension=$_GET["park_on_extension"];} - elseif (isset($_POST["park_on_extension"])) {$park_on_extension=$_POST["park_on_extension"];} -if (isset($_GET["conf_on_extension"])) {$conf_on_extension=$_GET["conf_on_extension"];} - elseif (isset($_POST["conf_on_extension"])) {$conf_on_extension=$_POST["conf_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"];} - elseif (isset($_POST["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"];} - elseif (isset($_POST["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];} -if (isset($_GET["monitor_prefix"])) {$monitor_prefix=$_GET["monitor_prefix"];} - elseif (isset($_POST["monitor_prefix"])) {$monitor_prefix=$_POST["monitor_prefix"];} -if (isset($_GET["recording_exten"])) {$recording_exten=$_GET["recording_exten"];} - elseif (isset($_POST["recording_exten"])) {$recording_exten=$_POST["recording_exten"];} -if (isset($_GET["voicemail_exten"])) {$voicemail_exten=$_GET["voicemail_exten"];} - elseif (isset($_POST["voicemail_exten"])) {$voicemail_exten=$_POST["voicemail_exten"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["dtmf_send_extension"])) {$dtmf_send_extension=$_GET["dtmf_send_extension"];} - elseif (isset($_POST["dtmf_send_extension"])) {$dtmf_send_extension=$_POST["dtmf_send_extension"];} -if (isset($_GET["call_out_number_group"])) {$call_out_number_group=$_GET["call_out_number_group"];} - elseif (isset($_POST["call_out_number_group"])) {$call_out_number_group=$_POST["call_out_number_group"];} -if (isset($_GET["client_browser"])) {$client_browser=$_GET["client_browser"];} - elseif (isset($_POST["client_browser"])) {$client_browser=$_POST["client_browser"];} -if (isset($_GET["install_directory"])) {$install_directory=$_GET["install_directory"];} - elseif (isset($_POST["install_directory"])) {$install_directory=$_POST["install_directory"];} -if (isset($_GET["local_web_callerID_URL"])) {$local_web_callerID_URL=$_GET["local_web_callerID_URL"];} - elseif (isset($_POST["local_web_callerID_URL"])) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];} -if (isset($_GET["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"];} - elseif (isset($_POST["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];} -if (isset($_GET["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"];} - elseif (isset($_POST["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];} -if (isset($_GET["user_switching_enabled"])) {$user_switching_enabled=$_GET["user_switching_enabled"];} - elseif (isset($_POST["user_switching_enabled"])) {$user_switching_enabled=$_POST["user_switching_enabled"];} -if (isset($_GET["conferencing_enabled"])) {$conferencing_enabled=$_GET["conferencing_enabled"];} - elseif (isset($_POST["conferencing_enabled"])) {$conferencing_enabled=$_POST["conferencing_enabled"];} -if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} - elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} -if (isset($_GET["admin_hijack_enabled"])) {$admin_hijack_enabled=$_GET["admin_hijack_enabled"];} - elseif (isset($_POST["admin_hijack_enabled"])) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];} -if (isset($_GET["admin_monitor_enabled"])) {$admin_monitor_enabled=$_GET["admin_monitor_enabled"];} - elseif (isset($_POST["admin_monitor_enabled"])) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];} -if (isset($_GET["call_parking_enabled"])) {$call_parking_enabled=$_GET["call_parking_enabled"];} - elseif (isset($_POST["call_parking_enabled"])) {$call_parking_enabled=$_POST["call_parking_enabled"];} -if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["updater_check_enabled"];} - elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];} -if (isset($_GET["AFLogging_enabled"])) {$AFLogging_enabled=$_GET["AFLogging_enabled"];} - elseif (isset($_POST["AFLogging_enabled"])) {$AFLogging_enabled=$_POST["AFLogging_enabled"];} -if (isset($_GET["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"];} - elseif (isset($_POST["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];} -if (isset($_GET["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"];} - elseif (isset($_POST["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];} -if (isset($_GET["voicemail_button_enabled"])) {$voicemail_button_enabled=$_GET["voicemail_button_enabled"];} - elseif (isset($_POST["voicemail_button_enabled"])) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];} -if (isset($_GET["enable_fast_refresh"])) {$enable_fast_refresh=$_GET["enable_fast_refresh"];} - elseif (isset($_POST["enable_fast_refresh"])) {$enable_fast_refresh=$_POST["enable_fast_refresh"];} -if (isset($_GET["fast_refresh_rate"])) {$fast_refresh_rate=$_GET["fast_refresh_rate"];} - elseif (isset($_POST["fast_refresh_rate"])) {$fast_refresh_rate=$_POST["fast_refresh_rate"];} -if (isset($_GET["enable_persistant_mysql"])) {$enable_persistant_mysql=$_GET["enable_persistant_mysql"];} - elseif (isset($_POST["enable_persistant_mysql"])) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];} -if (isset($_GET["auto_dial_next_number"])) {$auto_dial_next_number=$_GET["auto_dial_next_number"];} - elseif (isset($_POST["auto_dial_next_number"])) {$auto_dial_next_number=$_POST["auto_dial_next_number"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["DBX_server"])) {$DBX_server=$_GET["DBX_server"];} - elseif (isset($_POST["DBX_server"])) {$DBX_server=$_POST["DBX_server"];} -if (isset($_GET["DBX_database"])) {$DBX_database=$_GET["DBX_database"];} - elseif (isset($_POST["DBX_database"])) {$DBX_database=$_POST["DBX_database"];} -if (isset($_GET["DBX_user"])) {$DBX_user=$_GET["DBX_user"];} - elseif (isset($_POST["DBX_user"])) {$DBX_user=$_POST["DBX_user"];} -if (isset($_GET["DBX_pass"])) {$DBX_pass=$_GET["DBX_pass"];} - elseif (isset($_POST["DBX_pass"])) {$DBX_pass=$_POST["DBX_pass"];} -if (isset($_GET["DBX_port"])) {$DBX_port=$_GET["DBX_port"];} - elseif (isset($_POST["DBX_port"])) {$DBX_port=$_POST["DBX_port"];} -if (isset($_GET["DBY_server"])) {$DBY_server=$_GET["DBY_server"];} - elseif (isset($_POST["DBY_server"])) {$DBY_server=$_POST["DBY_server"];} -if (isset($_GET["DBY_database"])) {$DBY_database=$_GET["DBY_database"];} - elseif (isset($_POST["DBY_database"])) {$DBY_database=$_POST["DBY_database"];} -if (isset($_GET["DBY_user"])) {$DBY_user=$_GET["DBY_user"];} - elseif (isset($_POST["DBY_user"])) {$DBY_user=$_POST["DBY_user"];} -if (isset($_GET["DBY_pass"])) {$DBY_pass=$_GET["DBY_pass"];} - elseif (isset($_POST["DBY_pass"])) {$DBY_pass=$_POST["DBY_pass"];} -if (isset($_GET["DBY_port"])) {$DBY_port=$_GET["DBY_port"];} - elseif (isset($_POST["DBY_port"])) {$DBY_port=$_POST["DBY_port"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["old_extension"])) {$old_extension=$_GET["old_extension"];} - elseif (isset($_POST["old_extension"])) {$old_extension=$_POST["old_extension"];} -if (isset($_GET["old_server_ip"])) {$old_server_ip=$_GET["old_server_ip"];} - elseif (isset($_POST["old_server_ip"])) {$old_server_ip=$_POST["old_server_ip"];} -if (isset($_GET["old_server_id"])) {$old_server_id=$_GET["old_server_id"];} - elseif (isset($_POST["old_server_id"])) {$old_server_id=$_POST["old_server_id"];} -if (isset($_GET["server_description"])) {$server_description=$_GET["server_description"];} - elseif (isset($_POST["server_description"])) {$server_description=$_POST["server_description"];} -if (isset($_GET["asterisk_version"])) {$asterisk_version=$_GET["asterisk_version"];} - elseif (isset($_POST["asterisk_version"])) {$asterisk_version=$_POST["asterisk_version"];} -if (isset($_GET["max_vicidial_trunks"])) {$max_vicidial_trunks=$_GET["max_vicidial_trunks"];} - elseif (isset($_POST["max_vicidial_trunks"])) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];} -if (isset($_GET["telnet_host"])) {$telnet_host=$_GET["telnet_host"];} - elseif (isset($_POST["telnet_host"])) {$telnet_host=$_POST["telnet_host"];} -if (isset($_GET["telnet_port"])) {$telnet_port=$_GET["telnet_port"];} - elseif (isset($_POST["telnet_port"])) {$telnet_port=$_POST["telnet_port"];} -if (isset($_GET["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"];} - elseif (isset($_POST["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];} -if (isset($_GET["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"];} - elseif (isset($_POST["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];} -if (isset($_GET["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"];} - elseif (isset($_POST["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];} -if (isset($_GET["answer_transfer_agent"])) {$answer_transfer_agent=$_GET["answer_transfer_agent"];} - elseif (isset($_POST["answer_transfer_agent"])) {$answer_transfer_agent=$_POST["answer_transfer_agent"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["old_conf_exten"])) {$old_conf_exten=$_GET["old_conf_exten"];} - elseif (isset($_POST["old_conf_exten"])) {$old_conf_exten=$_POST["old_conf_exten"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS and Dots -$phone_ip = ereg_replace("[^\.0-9]","",$phone_ip); -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$old_server_ip = ereg_replace("[^\.0-9]","",$old_server_ip); -$computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); - -### DIGITS ONLY ### -$dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); -$voicemail_id = ereg_replace("[^0-9]","",$voicemail_id); -$outbound_cid = ereg_replace("[^0-9]","",$outbound_cid); -$VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); -$park_on_extension = ereg_replace("[^0-9]","",$park_on_extension); -$conf_on_extension = ereg_replace("[^0-9]","",$conf_on_extension); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$old_conf_exten = ereg_replace("[^0-9]","",$old_conf_exten); -$voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); -$voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); -$recording_exten = ereg_replace("[^0-9]","",$recording_exten); -$monitor_prefix = ereg_replace("[^0-9]","",$monitor_prefix); -$answer_transfer_agent = ereg_replace("[^0-9]","",$answer_transfer_agent); -$DBX_port = ereg_replace("[^0-9]","",$DBX_port); -$DBY_port = ereg_replace("[^0-9]","",$DBY_port); -$telnet_port = ereg_replace("[^0-9]","",$telnet_port); -$max_vicidial_trunks = ereg_replace("[^0-9]","",$max_vicidial_trunks); -$auto_dial_next_number = ereg_replace("[^0-9]","",$auto_dial_next_number); -$VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); -$enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); -$enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); -$user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); -$updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); -$QUEUE_ACTION_enabled = ereg_replace("[^0-9]","",$QUEUE_ACTION_enabled); -$conferencing_enabled = ereg_replace("[^0-9]","",$conferencing_enabled); -$voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); -$CallerID_popup_enabled = ereg_replace("[^0-9]","",$CallerID_popup_enabled); -$call_parking_enabled = ereg_replace("[^0-9]","",$call_parking_enabled); -$AGI_call_logging_enabled = ereg_replace("[^0-9]","",$AGI_call_logging_enabled); -$AFLogging_enabled = ereg_replace("[^0-9]","",$AFLogging_enabled); -$admin_monitor_enabled = ereg_replace("[^0-9]","",$admin_monitor_enabled); -$admin_hijack_enabled = ereg_replace("[^0-9]","",$admin_hijack_enabled); -$admin_hangup_enabled = ereg_replace("[^0-9]","",$admin_hangup_enabled); -$fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); -$ADD = ereg_replace("[^0-9]","",$ADD); - -### ALPHA-NUMERIC and underscore and dash and slash and at and dot -$extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); -$old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); -$install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); -$client_browser = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$client_browser); -$dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); -$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); -$telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); -$DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); -$DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); - -### ALPHA-NUMERIC (and underscore and dash) -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$login = ereg_replace("[^-\_0-9a-zA-Z]","",$login); -$user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^-\_0-9a-zA-Z]","",$pass); -$status = ereg_replace("[^-\_0-9a-zA-Z]","",$status); -$protocol = ereg_replace("[^-\_0-9a-zA-Z]","",$protocol); -$ASTmgrUSERNAMEupdate = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEupdate); -$ASTmgrUSERNAMEsend = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEsend); -$ASTmgrUSERNAMElisten = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMElisten); -$ASTmgrUSERNAME = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAME); -$ASTmgrSECRET = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrSECRET); -$login_user = ereg_replace("[^-\_0-9a-zA-Z]","",$login_user); -$login_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$login_pass); -$login_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$login_campaign); -$DBX_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_user); -$DBY_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_user); -$DBX_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_pass); -$DBY_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_pass); -$DBX_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_database); -$DBY_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_database); -$VICIDIAL_park_on_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$VICIDIAL_park_on_filename); -$server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); -$old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); -$ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); -$CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); -$company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); -$picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); -$local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); -$server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); -$asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - -### VARIABLES TO BE mysql_real_escape_string ### -# $VICIDIAL_web_URL = -# $local_web_callerID_URL = - -##### END VARIABLE FILTERING FOR SECURITY ##### - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Sie haben jetzt heraus geloggt. Danke\n"; - exit; -} - -if (!isset($ADD)) {$ADD=0;} - -$STARTtime = date("U"); -$STARTdate = date("Y-m-d H:i:s"); - -if ($ADD==1) {$process = 'ADDIEREN SIE NEUES TELEFON';} -if ($ADD==11) {$process = 'ADDIEREN SIE NEUEN BEDIENER';} -if ($ADD==111) {$process = 'ADDIEREN SIE NEUE KONFERENZ';} -if ($ADD==2) {$process = 'ADDIEREN DES NEUEN TELEFONS';} -if ($ADD==21) {$process = 'ADDIEREN DES NEUEN BEDIENERS';} -if ($ADD==211) {$process = 'ADDIEREN DER NEUEN KONFERENZ';} -if ($ADD==3) {$process = 'ÄNDERN SIE TELEFON';} -if ($ADD==31) {$process = 'ÄNDERN SIE BEDIENER';} -if ($ADD==311) {$process = 'ÄNDERN SIE KONFERENZ';} -if ($ADD==4) {$process = 'ÄNDERNDES TELEFON';} -if ($ADD==41) {$process = 'ÄNDERNDER BEDIENER';} -if ($ADD==411) {$process = 'ÄNDERNDE KONFERENZ';} -if ($ADD==5) {$process = 'DELETE PHONE';} -if ($ADD==6) {$process = 'DELETE PHONE';} -if ($ADD==55) {$process = 'SUCHTELEFONE';} -if ($ADD==66) {$process = 'SUCHE RUFT RESULTATE AN';} -if ($ADD==0) {$process = 'TELEFON-LISTE';} -if ($ADD==10) {$process = 'BEDIENER-LISTE';} -if ($ADD==100) {$process = 'KONFERENZ-LISTE';} -if ($ADD==99999) {$process = 'HILFE';} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if ($auth<1) - { - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > '6' and ast_admin_access='1';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGdelete_phones =$row[17]; - } - } - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - echo "|$stmt|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - if (strlen($LOGfullname) < 1) - { - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - } - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rsltx=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rsltx); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $servers_list .= "\n"; - $o++; - } - - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); - -$NWB = "   \"HILFE\""; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "STERNCHEN ADMIN: Leitung - $process \n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
ASTERISK ADMIN: HILFE


\n"; - -?> -TELEFON-TABELLE

- -
-Telefonverlängerung - Dieses fangen ist auf, wohin Sieden Telefonnamen setzen, während er scheint, nicht einschließlichdas Protokoll oder den Schrägstrich am Anfang mit einem Sternchenzuversehen. Z.B.: für das SIP Telefon SIP\/test101 würde dieTelefonverlängerung test101 sein. Auch denn Telefone IAX2 stellen Siesicher, daß Sie den vollen Telefonnamen verwenden:IAX2\/IAXphone1@IAXphone1 würde IAXphone1@IAXphone1 sein. Für ZapTelefone sicherstellen, daß Sie die volle Führung setzen: Zap/25-1würde 25-1 sein. Eine andere Anmerkung, stellen sicher, daß Sie dasProtokoll unten richtig für Ihre Art des Telefons einstellen. - -
-
-
-Dialplan number - This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server - -
-
-
-Voicemail Kasten - Dieses fangen ist für den voicemailKasten auf, daß die Anzeigen für zum Benutzer dieses Telefons gehen.Wir verwenden dieses, um auf voicemail Anzeigen und auf den Benutzerzu überprüfen, zum in der Lage zuSEIN, die VOICEMAIL Taste aufastGUIclient APP zu benutzen. - -
-
-
-Outbound CallerID - Dieses fangen ist auf, wo Sie diecallerID Zahl eintragen würden, die Sie möchten, daß auf outboundAnrufe gesetzter Form der astguiclient Netz-Klient aussieht. Diesesarbeitet nicht auf RBS, non-PRI, T1/Eß. - -
-
-
-Telefon-IP address - Dieses fangen ist für IP addressdes Telefons auf, wenn es ein VOIP Telefon ist. Dieses istauffangen ein wahlweise freigestelltes - -
-
-
-Computer-IP address - Dieses fangen ist für IP addressComputer des Benutzers auf. Dieses ist auffangen einwahlweise freigestelltes - -
-
-
-Bediener IP - Dieses Menü ist, wo Sie vorwählen, dem Bedienerdas Telefon auf aktiv ist. - -
-
-
-LOGON - Der LOGON gewöhnt ge$$$WESEN für den Telefonbenutzer anLOGON zu den Klient Anwendungen. - -
-
-
-Kennwort - Das Kennwort gewöhnt ge$$$WESEN für denTelefonbenutzer an LOGON zu den Klient Anwendungen. - -
-
-
-Status - Der Status des Telefons im System, die AKTIVEN und ADMINdürfen, damit GUI Klienten arbeiten. Admin erlaubt Zugang zu dieseradministrativen Web site. Alle weiteren Status erlauben nicht GUI oderAdmin Netzzugang. - -
-
-
-Aktives Konto - Ob das Telefon aktiv ist, es in die Liste im GUIKlienten einzusetzen. - -
-
-
-Telefon-Art - Lediglich für administrative Anmerkungen. - -
-
-
-Voller Name - Verwendet durch das GUIclient in der Liste deraktiven Telefone. - -
-
-
-Firma - Lediglich für administrative Anmerkungen. - -
-
-
-Abbildung - Nicht schon eingeführt. - -
-
-
-Neue Anzeigen - Zahl der neuen voicemail Anzeigen für diesesTelefon auf dem Sternchenbediener. - -
-
-
-Alte Anzeigen - Zahl der alten voicemail Anzeigen für diesesTelefon auf dem Sternchenbediener. - -
-
-
-Klient Protokoll - Das Protokoll, das das Telefon verwendet, anden Sternchenbediener anzuschließen: Sip, IAX2, Zap. Auch, es gibtexternal für Remotevorwahlknopfzahlen oder GeschwindigkeitVorwahlknopfzahlen, die Sie als Telefone verzeichnen möchten. - -
-
-
-Lokales GMT - Der Unterschied Greenwich-Zeit von oder VON DERZULU-Zeit, in der das Telefon lokalisiert wird. STELLEN SIE NICHT AUFTAGESLICHT-SPARUNGEN ZEIT EIN. Dieses wird durch die VICIDIAL Kampagneverwendet, um die Zeit und Kunde Zeit genau anzuzeigen. - -
-
-
-Manager-LOGON - Dieses ist der LOGON, dem die GUI Klienten fürdieses Telefon pflegen, die Datenbank zugänglich zu machen, in derdie Bedienerdaten liegen. - -
-
-
-Manager-Geheimnis - Dieses ist das Kennwort, dem die GUI Klientenfür dieses Telefon pflegen, die Datenbank zugänglich zu machen, inder die Bedienerdaten liegen. - -
-
-
-VICIDIAL Rückstellung Benutzer - Dieses soll einen Default-Wertin den VICIDIAL Benutzer legen auffangen, wann immer dieserTelefonbenutzer die astVICIDIAL Klient APP öffnet. Lassen Sie freienRaum für keinen Benutzer. - -
-
-
-VICIDIAL Rückstellung Durchlauf - Dieses soll einen Default-Wertin das VICIDIAL Kennwort legen auffangen, wann immer dieserTelefonbenutzer die astVICIDIAL Klient APP öffnet. Lassen Sie freienRaum für keinen Durchlauf. - -
-
-
-VICIDIAL Rückstellung Kampagne - Dieses soll einen Default-Wertin die VICIDIAL Kampagne legen auffangen, wann immer dieserTelefonbenutzer die astVICIDIAL Klient APP öffnet. Lassen Sie freienRaum für keine Kampagne. - -
-
-
-Park Exten - Dieses ist die Rückstellung Parkenverlängerung fürdie Klient apps. Überprüfen Sie, daß ein unterschiedliches manarbeitet, bevor Sie dieses ändern. - -
-
-
-Conf Exten - This is the default Conference park extension for the client apps. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park Exten - Dieses ist die RückstellungParkenverlängerung für VICIDIAL Klient APP. Überprüfen Sie, daßein unterschiedliches man arbeitet, bevor Sie dieses ändern. - -
-
-
-VICIDIAL Park-Akte - Dieses ist der Rückstellung VICIDIALPark-Verlängerung Dateiname für die Klient apps. Überprüfen Sie,daß ein unterschiedliches man arbeitet, bevor Sie dieses ändern, daszu 10 Buchstaben begrenzt wird. - -
-
-
-Überwachen Sie Präfix - This is the dialplan prefix for monitoring of Zap channels automatically within the astGUIclient app. Only change according to the extensions.conf ZapBarge extensions records. - -
-
-
-Aufnahme Exten - Dieses ist die dialplan Verlängerung für dieAufnahmeverlängerung, die verwendet wird, um in meetme Konferenzen zufallen, um sie zu notieren. Es dauert normalerweise bis zu einerStunde, wenn es nicht gestoppt wird, überprüft mit extensions.confAkte, bevor es ändert. - -
-
-
-VMAIL Hauptexten - Dieses ist die dialplan Verlängerung, diegeht, Ihr voicemail. zu überprüfen, überprüfen mit extensions.confAkte, bevor es ändert. - -
-
-
-VMAIL Dump Exten - Dieses ist das dialplan Präfix, das verwendetwird, um Anrufe direkt zum voicemail eines Benutzers von einemPhasenanruf in der astGUIclient APP zu schicken, überprüfen mitextensions.conf Akte, bevor es ändert. - -
-
-
-Exten Kontext - Dieses ist der dialplan Kontext, den diesesTelefon hauptsächlich verwendet. Es wird angenommen, daß alleNummern, die durch die Klient apps gewählt werden, diesen Kontextverwenden, also es eine gute Idee ist sicherzustellen, daß dieses derbreiteste Kontext ist, der möglich ist, überprüfen mitextensions.conf Akte, bevor es ändert. - -
-
-
-DTMF senden Führung - Dieses ist die Führung Zeichenkette, diebenutzt wird, um DTMF Töne in meetme Konferenzen von den Klient appszu senden. Überprüfen Sie, daß und Kontext mit der extensions.confAkte exten. - -
-
-
-Outbound Anruf-Gruppe - Dieses ist die Kanalgruppe, daß outboundAnrufe von diesem Telefon aus gesetzt werden. Es gibt Programme einesPaares in den Klient apps, die dieses verwenden. Für Zap Führungen,die Sie etwas wie Zap/g2 verwenden möchten, denn Stämme IAX2 Siedas volle IAX Präfix wie IAX2/VICItest1:secret@10.10.10.15:4569würden verwenden wollen. Überprüfen Sie die Stämme mit derextensions.conf Akte, es ist normalerweise, was Sie als die globaleVariable des STAMMES an der Oberseite der Akte definiert haben. - -
-
-
-Datenbanksuchroutine-Position - Dieses ist auf nur UNIX/LINUXKlienten, der absolute Weg zu Mozilla anwendbar, oder FirefoxDatenbanksuchroutine auf der Maschine überprüfen dieses, indem siemanuell es ausstößt. - -
-
-
-Anbringen Sie Verzeichnis - Dieses ist der Platz, in dem dieastGUIclient und astVICIDIAL Indexe auf Ihrer Maschine sind. FürWin32 sollte es etwas wie C:\\AST_VICI sein und für UNIX sollte esetwas wie /usr/local/perl_TK. sein überprüft dieses manuell. - -
-
-
-CallerID URL - Dieses ist die Netzadresse der Seite, die benutztwird, um kundenspezifische callerID Nachschlagen zu tun, Rückstellungprüfen, dieadresse ist:http://astguiclient.sf.net/test_callerid_output.php - -
-
-
-VICIDIAL Rückstellung URL - Dieses ist die Netzadresse der Seite,die benutzt wird, um kundenspezifische VICIDIAL Netz-Formfragen zutun, Rückstellung prüfen, dieadresse ist:http://astguiclient.sf.net/test_VICIDIAL_output.php - -
-
-
-Anruf-Protokollierung - Dieses wird eingestellt, um auszurichten,wenn die call_log.agi Akte im Platz in der extensions.conf Akte füralles outbound ist und die Verlängerungen des Hängezustands ' h ',zum alle zu loggen benennt. Diese sollte 1, weil es für vieleastGUIclient und DIE VICIDIAL manditory ist Eigenschaften immer sein,zum richtig zu arbeiten. - -
-
-
-Benutzer-Schaltung - Set to true to allow user to switch to another user account. NOTE: If user switches they can initiate recording on the new user's phone conversation - -
-
-
-Conferencing - Stellen Sie ein, um auszurichten, um Benutzer zuerlauben, Konferenzanrufe mit bis zu sechs externen Linien zubeginnen. - -
-
-
-Admin Hängezustand - um Benutzer zu erlauben auszurichten Satz,zum Hängezustand irgendeine Linie am Willen durch astGUIclient in derLage zuSEIN. Gute Idee, diesem für Admin Benutzer nur zuermöglichen. - -
-
-
-Admin Straßenräuber - Stellen Sie ein, um auszurichten, umBenutzer zu erlauben, in der Lage zuSEIN, zu ihrer Verlängerung jedemögliche Linie zu ergreifen und umzuadressieren am Willen durchastGUIclient. Gute Idee, diesem für Admin Benutzer nur zuermöglichen. Aber ist für Manager sehr nützlich. - -
-
-
-Admin Monitor - Stellen Sie ein, um auszurichten, um Benutzer zuerlauben, in der Lage zuSEIN, zu ihrer Verlängerung jede möglicheLinie zu ergreifen und umzuadressieren am Willen durch astGUIclient.Gute Idee, diesem für Admin Benutzer nur zu ermöglichen. Aber istfür Manager und als Training Werkzeug sehr nützlich. - -
-
-
-Parkschaltung - um Benutzer zu erlauben auszurichten der Satz, inder Lage zuSEIN zu parken ersucht um astGUIclient Einfluß, von jedemanderen astGUIclient Benutzer auf dem System aufgehoben zu werden.Anrufe bleiben auf Einfluß für bis zu einen halbe Stunde dannHängezustand. Normalerweise ermöglicht für alle. - -
-
-
-Updater Überprüfung - Stellen Sie ein, um auszurichten, um einepopup Warnung anzuzeigen, die die updater Zeit nicht in 20 Sekundengeändert hat. Nützlich für Admin Benutzer. - -
-
-
-Af Protokollierung - Stellen Sie ein, um auszurichten, um vieleTätigkeiten des astGUIclient Verbrauches in einer Textakte auf demComputer des Benutzers zu protokollieren. - -
-
-
-Warteschlange ermöglichte - um Klient apps auszurichten Satz dasSternchen-zentrale Warteschlange System benutzen zu lassen. Erfordertfür VICIDIAL und für alle Benutzer empfohlen. - -
-
-
-CallerID Popup - Stellen Sie ein, um auszurichten, um die Zahlenzuzulassen, die in der extensions.conf Akte definiert werden, umCallerID popup Schirme zu schicken den astGUIclient Benutzern. - -
-
-
-VMail Taste - Stellen Sie ein, um auszurichten, um die VOICEMAILTaste anzuzeigen und die Anzeigen zählen Anzeige auf astGUIclient. - -
-
-
-Schnell erneuern Sie - Stellen Sie ein, um auszurichten, um einerneuen Rate von zu ermöglichen erneuern von den Anrufinformationenfür das astGUIclient. Rückstellung arbeitsunfähige Rate ist 1000zweite des Ms.1. Kann Anlagen-Belastung erhöhen, wenn Sie diese Zahlsenken. - -
-
-
-Schnell erneuern Sie Rate - in den Millisekunden. Nur verwendet,wenn schnell, erneuern Sie wird ermöglicht. Rückstellungarbeitsunfähige Rate ist 1000 zweite des Ms.1. Kann Anlagen-Belastungerhöhen, wenn Sie diese Zahl senken. - -
-
-
-Persistant MySQL - Wenn er ermöglicht wird, bleibt derastGUIclient Anschluß angeschlossen, anstatt, jede Sekundeanzuschließen. Nützlich, wenn Sie ein schnelles die eingestellteRate erneuern lassen. Sie erhöht die Zahl Anschlüssen auf IhrerMySQL Maschine. - -
-
-
-Selbstvorwahlknopf-folgende Zahl - wenn er ermöglicht wird,wählt der VICIDIAL Klient die folgende Nummer auf der Listeautomatisch nach Einteilung eines Anrufs, es sei denn sie vorwählten"auf, dem Einteilung Schirm zu wählen zu stoppen". - -
-
-
-Stoppen Sie Rec nach jedem Anruf - wenn er ermöglicht wird,stoppt der VICIDIAL Klient, was Aufnahme weitergeht, nachdem jederAnruf dispositioned gewesen ist. Nützlich, wenn Sie eine MengeAufnahme tun oder Sie benutzen eine Netzform, um Aufnahme auszulösen. - -
-
-
-DBX Bediener - Der MySQL Datenbankbediener, den dieser Benutzeranschließen sollte an. - -
-
-
-DBX Datenbank - Die MySQL Datenbank, die dieser Benutzeranschließen sollte an. Rückstellung ist Sternchen. - -
-
-
-DBX Benutzer - Der MySQL Benutzer-LOGON, den dieser Benutzer beimAnschließen verwenden sollte. Rückstellung ist cron. - -
-
-
-DBX Durchlauf - Das MySQL Benutzerkennwort, das dieser Benutzerbeim Anschließen verwenden sollte. Rückstellung ist 1234. - -
-
-
-DBX Tor - Das MySQL TCP Tor, das dieser Benutzer beim Anschließenbenutzen sollte. Rückstellung ist 3306. - -
-
-
-DBY Bediener - Der MySQL Datenbankbediener, den dieser Benutzeranschließen sollte an. Zweitensserver, nicht z.Z. verwendet. - -
-
-
-DBY Datenbank - Die MySQL Datenbank, die dieser Benutzeranschließen sollte an. Rückstellung ist Sternchen. Zweitensserver, nicht z.Z. verwendet. - -
-
-
-DBY Benutzer - Der MySQL Benutzer-LOGON, den dieser Benutzer beimAnschließen verwenden sollte. Rückstellung ist cron. Zweitensserver, nicht z.Z. verwendet. - -
-
-
-DBY Durchlauf - Das MySQL Benutzerkennwort, das dieser Benutzerbeim Anschließen verwenden sollte. Rückstellung ist 1234. Zweitensserver, nicht z.Z. verwendet. - -
-
-
-DBY Tor - Das MySQL TCP Tor, das dieser Benutzer beim Anschließenbenutzen sollte. Rückstellung ist 3306. Zweitensserver, nicht z.Z. verwendet. - - -



- -BEDIENER-TABELLE

-
-
-Bediener Identifikation - Dieses fangen ist, wohin Sieden Sternchenbedienernamen setzen, doesnt müssen ein amtliches GebietUnterseeboot, gerade ein Spitzname sein auf, um den Bediener zu denAdmin Benutzern zu kennzeichnen. - -
-
-
-Bediener-Beschreibung - auffangen, wo Sie eine kleine Phraseverwenden, um den Sternchenbediener zu beschreiben. - -
-
-
-Bediener-IP address - auffangen, wo Sie das Netz-IP addressdes Sternchenbedieners setzten. - -
-
-
-Aktiv - Stellen Sie ein, ob der Sternchenbediener aktiv oderunaktiviert ist. - -
-
-
-Sternchen-Version - Stellen Sie die Version des Sternchens ein,die Sie auf diesen Bediener angebracht haben. Beispiele: ' 1.2 ', '1.0.8 ', ' 1.0.7 ', ' CVS_HEAD ', ' WIRKLICH ALTES ', usw.... Dieseswird verwendet, weil Versionen 1.0.8 und 1.0.9 eine andere Methode desBeschäftigens Local/ Führungen, eine Wanze, die in CVS v1.0geregelt worden ist, und Notwendigkeit, anders als behandelt zu werdenhaben, wenn die Behandlung ihres Local/ lenkt. Auch gegenwärtigesCVS_HEAD und der 1.2 Freigabebaumgebrauch unterschiedlicher Managerund Befehl gaben aus, also muß es anders als außerdem behandeltwerden. - -
-
-
-Maximale VICIDIAL Stämme - Dieses fangen feststellt diemaximale Zeilenzahl auf, um denen der VICIDIAL Auto-dialer versucht,diesen Bediener zu ersuchen. Wenn Sie zwei volle PRI Tß VICIDIALingauf einem Bediener einweihen möchten dann, würden Sie dieses bis 46einstellen. Rückstellung ist 96. - -
-
-
-Telnet Wirt - Dieses ist die Adresse oder der Name desSternchenbedieners und ist, wie die Manageranwendungen an ihnanschließen von, wo sie laufen. Wenn sie auf den Sternchenbedienerlaufen, dann ist die Rückstellung von ' localhost ' fein. - -
-
-
-Telnet Tor - Dieses ist das Tor des SternchenbedienerManageranschlußes und ist, wie die Manageranwendungen an ihnanschließen von, wo sie laufen. Die Rückstellung von ' 5038 ' istfein für einen Standard anbringen. - -
-
-
-Manager-Benutzer - Das username oder der LOGON verwendeten, an denSternchenbedienermanager genericly anzuschließen. Rückstellung ist 'cron ' - -
-
-
-Manager-Geheimnis - Das Geheimnis oder das Kennwort verwendeten,an den Sternchenbedienermanager genericly anzuschließen.Rückstellung ist ' 1234 ' - -
-
-
-Manager-Update-Benutzer - Das username oder der LOGON verwendeten,an den Sternchenbedienermanager anzuschließen, der für dieUpdateindexe optimiert wurde. Fallen Sie ist ' updatecron ' undannimmt das gleiche Geheimnis wie der generische Benutzer zurück. - -
-
-
-Manager hören Benutzer - Das username oder der LOGON verwendeten,an den Sternchenbedienermanager anzuschließen, der für Indexeoptimiert wurde, die nur auf Ausgang hören. Fallen Sie ist 'listencron ' und annimmt das gleiche Geheimnis wie der generischeBenutzer zurück. - -
-
-
-Manager senden Benutzer - Das username oder der LOGON verwendeten,an den Sternchenbedienermanager anzuschließen, der für Indexeoptimiert wurde, die dem Manager nur Tätigkeiten schicken. Fallen Sieist ' sendcron ' und annimmt das gleiche Geheimnis wie der generischeBenutzer zurück. - -
-
-
-Bediener GMT versetzt - Der Unterschied bezüglich der Stunden vonder GMT Zeit eingestellt nicht auf Tageslicht-Sparung-Zeit desBedieners. Rückstellung ist ' - 5 ' - -
-
-
-VMail Dump Exten - Das Verlängerung Präfix verwendet auf diesemBediener, um Anrufe direkt durch agc zu einem spezifischen voicemailKasten zu schicken. Rückstellung ist ' 85026666666666 ' - -
-
-
-VICIDIAL ANZEIGE Verlängerung - Die Rückstellung Verlängerung,wenn keines in der Kampagne anwesend ist, Anrufe für VICIDIAL zumSelbstwählen zu schicken. Rückstellung ist ' 8365 ' - -
-
-
-Rückstellung Kontext - Der Rückstellung dialplan Kontextverwendet für Indexe, die für diesen Bediener funktionieren.Rückstellung ist ' Rückstellung ' - - -



- -KONFERENZTISCH

-
-
-Konferenz-Zahl - Dieses fangen ist auf, wohin Sie diemeetme Konferenz dialpna Zahl setzen. Es wird auch empfohlen, daß diemeetme Zahl in meetme.conf diese Zahl für jede Eintragungzusammenbringt. Dieses ist für die Konferenzen in astGUIclient undwird für leave-3way-call Funktionalität in VICIDIAL verwendet. - -
-
-
-Bediener IP - Das Menü, wo Sie den Sternchenbediener vorwählen,daß diese Konferenz eingeschaltet ist. - - - - - - -







-







-DAS ENDE -
- - - -STERNCHEN ADMIN: Leitung - <? echo $process ?> - - - -
- - - - - - -
  ASTERISK ADMIN - Logout  
  VERZEICHNEN SIE ALLE TELEFONE | ADDIEREN Sie Ein NEUES TELEFON | SUCHE NACH Einem TELEFON | ADDIEREN Sie Einen BEDIENER | VERZEICHNEN SIE ALLE BEDIENER
  ZEIGEN SIE ALLE KONFERENZEN | ADDIEREN Sie Eine NEUE KONFERENZ
-"; - -echo "
ADDIEREN Sie Ein NEUES TELEFON
\n"; -echo "\n"; -echo "
\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Telefonverlängerung: $NWB#phones-extension$NWE
Dialplan Zahl: (nur Stellen)$NWB#phones-dialplan_number$NWE
Voicemail Kasten: (nur Stellen)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (nur Stellen)$NWB#phones-outbound_cid$NWE
Telefon-IP address: (optional)$NWB#phones-phone_ip$NWE
Computer-IP address: (optional)$NWB#phones-computer_ip$NWE
Bediener IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Kennwort:$NWB#phones-pass$NWE
Status:$NWB#phones-status$NWE
Aktives Konto: $NWB#phones-active$NWE
Telefon-Art: $NWB#phones-phone_type$NWE
Voller Name: $NWB#phones-fullname$NWE
Firma:$NWB#phones-company$NWE
Abbildung:$NWB#phones-picture$NWE
Klient Protokoll: $NWB#phones-protocol$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW SERVERS FORM SCREEN -###################### - -if ($ADD==11) -{ -echo ""; - -echo "
ADDIEREN Sie Einen NEUEN BEDIENER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Bediener Identifikation: $NWB#servers-server_id$NWE
Bediener-Beschreibung: $NWB#servers-server_description$NWE
Bediener-IP address: $NWB#servers-server_ip$NWE
Aktiv:$NWB#servers-active$NWE
Sternchen-Version: $NWB#servers-asterisk_version$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW CONFERENCES FORM SCREEN -###################### - -if ($ADD==111) -{ -echo ""; - -echo "
ADDIEREN Sie Eine NEUE KONFERENZ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Konferenz-Zahl: (nur Stellen)$NWB#conferences-conf_exten$NWE
Bediener IP: $NWB#conferences-server_ip$NWE
\n"; - -} - - -###################### -# ADD=2 adds the new phone to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
TELEFON NICHT ADDIERT - es gibt bereits ein Telefon im System mitdiesem extension/server\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
TELEFON NICHT ADDIERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n";} - else - { - echo "
TELEFON FÜGTE HINZU\n"; - - $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new server to the system -###################### - -if ($ADD==21) -{ - echo ""; - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
BEDIENERNOT ADDED - there is already a server in the system with this ID\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
BEDIENERNOT ADDED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n";} - else - { - echo "
BEDIENERADDED\n"; - - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new conference to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
KONFERENZ NICHT ADDIERT - es gibt bereits eine Konferenz im System mitdieser Identifikation und Bediener\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
KONFERENZ NICHT ADDIERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n";} - else - { - echo "
KONFERENZ FÜGTE HINZU\n"; - - $stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=100; -} - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of phone -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGdelete_phones < 1) ) - { - echo "
TELEFON NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Bediener IP be at least 7 characters in length\n"; - } - else - { - echo "
TELEFON-AUSLASSUNG BESTÄTIGUNG: $extension - $server_ip\n"; - echo "

Klicken Sie hier, um Telefon zu löschen $extension - $server_ip


\n"; - } - -$ADD='3'; # go to phone modification below -} - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete phone record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGdelete_phones < 1) ) - { - echo "
TELEFON NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Bediener IP be at least 7 characters in length\n"; - } - else - { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } - echo "
TELEFON-AUSLASSUNG DURCHGEFÜHRT: $extension - $server_ip\n"; - echo "

\n"; - } - -$ADD='0'; # go to phone list -} - - - - - - -###################### -# ADD=3 modify phone info in the system -###################### - -if ($ADD==3) -{ - echo ""; - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ÄNDERN Sie Einen TELEFON-SATZ: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Telefonverlängerung: $NWB#phones-extension$NWE
Dialplan Zahl: (nur Stellen)$NWB#phones-dialplan_number$NWE
Voicemail Kasten: (nur Stellen)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (nur Stellen)$NWB#phones-outbound_cid$NWE
Telefon-IP address: (optional)$NWB#phones-phone_ip$NWE
Computer-IP address: (optional)$NWB#phones-computer_ip$NWE
Bediener IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Kennwort:$NWB#phones-pass$NWE
Status:$NWB#phones-status$NWE
Aktives Konto: $NWB#phones-active$NWE
Telefon-Art: $NWB#phones-phone_type$NWE
Voller Name: $NWB#phones-fullname$NWE
Firma:$NWB#phones-company$NWE
Abbildung:$NWB#phones-picture$NWE
Neue Anzeigen: $row[14]$NWB#phones-messages$NWE
Alte Anzeigen: $row[15]$NWB#phones-old_messages$NWE
Klient Protokoll: $NWB#phones-protocol$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
Manager-LOGON: $NWB#phones-ASTmgrUSERNAME$NWE
Manager-Geheimnis: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Rückstellung Benutzer: $NWB#phones-login_user$NWE
VICIDIAL Rückstellung Durchlauf: $NWB#phones-login_pass$NWE
VICIDIAL Rückstellung Kampagne: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park-Akte: $NWB#phones-VICIDIAL_park_on_filename$NWE
Überwachen Sie Präfix: $NWB#phones-monitor_prefix$NWE
Aufnahme Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Kontext: $NWB#phones-ext_context$NWE
DTMFSend Führung: $NWB#phones-dtmf_send_extension$NWE
Outbound Anruf-Gruppe: $NWB#phones-call_out_number_group$NWE
Datenbanksuchroutine-Position: $NWB#phones-client_browser$NWE
Bringen Sie Verzeichnis An: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Rückstellung URL: $NWB#phones-VICIDIAL_web_URL$NWE
Anruf-Protokollierung: $NWB#phones-AGI_call_logging_enabled$NWE
Benutzer-Schaltung: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hängezustand: $NWB#phones-admin_hangup_enabled$NWE
Admin Straßenräuber: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Parkschaltung: $NWB#phones-call_parking_enabled$NWE
Updater Überprüfung: $NWB#phones-updater_check_enabled$NWE
Af Protokollierung: $NWB#phones-AFLogging_enabled$NWE
Warteschlange Ermöglicht: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Taste: $NWB#phones-voicemail_button_enabled$NWE
Schnell Erneuern Sie: $NWB#phones-enable_fast_refresh$NWE
Schnell Erneuern Sie Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Selbstvorwahlknopf-Folgende Zahl: $NWB#phones-auto_dial_next_number$NWE
Stoppen Sie Rec nach jedem Anruf: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Bediener: (HauptsächlichDB Server)$NWB#phones-DBX_server$NWE
DBX Datenbank: (HauptsächlichServer Database)$NWB#phones-DBX_database$NWE
DBX Benutzer: (HauptsächlichDB Login)$NWB#phones-DBX_user$NWE
DBX Durchlauf: (HauptsächlichDB Secret)$NWB#phones-DBX_pass$NWE
DBX Tor: (HauptsächlichDB Port)$NWB#phones-DBX_port$NWE
DBY Bediener: (ZweitensDB Server)$NWB#phones-DBY_server$NWE
DBY Datenbank: (ZweitensServer Database)$NWB#phones-DBY_database$NWE
DBY Benutzer: (ZweitensDB Login)$NWB#phones-DBY_user$NWE
DBY Durchlauf: (ZweitensDB Secret)$NWB#phones-DBY_pass$NWE
DBY Tor: (ZweitensDB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Klicken Sie hier für Telefonnotfall\n"; - -if ($LOGdelete_phones > 0) - { - echo "

LÖSCHEN SIE DIESES TELEFON\n"; - } - -} - - -###################### -# ADD=31 modify server info in the system -###################### - -if ($ADD==31) -{ - echo ""; - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ÄNDERN Sie Einen BEDIENER-SATZ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Bediener Identifikation: $NWB#servers-server_id$NWE
Bediener-Beschreibung: $NWB#servers-server_description$NWE
Bediener-IP address: $NWB#servers-server_ip$NWE
Aktiv:$NWB#servers-active$NWE
Sternchen-Version: $NWB#servers-asterisk_version$NWE
Maximale VICIDIAL Stämme: $NWB#servers-max_vicidial_trunks$NWE
Telnet Wirt: $NWB#servers-telnet_host$NWE
Telnet Tor: $NWB#servers-telnet_port$NWE
Manager-Benutzer: $NWB#servers-ASTmgrUSERNAME$NWE
Manager-Geheimnis: $NWB#servers-ASTmgrSECRET$NWE
Manager-Update-Benutzer: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Hören Benutzer: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Senden Benutzer: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL ANZEIGE Verlängerung: $NWB#servers-answer_transfer_agent$NWE
Rückstellung Kontext: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
TELEFONE INNERHALB DIESES BEDIENERS:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
VERLÄNGERUNGNAMEAKTIV
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Dieser Bediener hat $active_lists aktive Telefone und $inactive_lists unaktivierte Telefone

\n"; -echo "
\n"; -} - - -###################### -# ADD=311 modify conference info in the system -###################### - -if ($ADD==311) -{ - echo ""; - - $stmt="SELECT * from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ÄNDERN Sie Einen KONFERENZ-SATZ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Konferenz:$NWB#conferences-conf_exten$NWE
Bediener IP: $NWB#conferences-server_ip$NWE
Gegenwärtige Verlängerung:
\n"; - -echo "
\n"; - -} - - - -###################### -# ADD=4 submit phone modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) - {echo "
TELEFON NICHT GEÄNDERT - es gibt bereits ein Telefon im System mitdiesem extension/server\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
TELEFON NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n";} - else - { - echo "
TELEFON GEÄNDERT: $extension\n"; - - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid' where extension='$old_extension' and server_ip='$old_server_ip';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ÄNDERN Sie Einen TELEFON-SATZ: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Telefonverlängerung: $NWB#phones-extension$NWE
Dialplan Zahl: (nur Stellen)$NWB#phones-dialplan_number$NWE
Voicemail Kasten: (nur Stellen)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (nur Stellen)$NWB#phones-outbound_cid$NWE
Telefon-IP address: (optional)$NWB#phones-phone_ip$NWE
Computer-IP address: (optional)$NWB#phones-computer_ip$NWE
Bediener IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Kennwort:$NWB#phones-pass$NWE
Status:$NWB#phones-status$NWE
Aktives Konto: $NWB#phones-active$NWE
Telefon-Art: $NWB#phones-phone_type$NWE
Voller Name: $NWB#phones-fullname$NWE
Firma:$NWB#phones-company$NWE
Abbildung:$NWB#phones-picture$NWE
Neue Anzeigen: $row[14]$NWB#phones-messages$NWE
Alte Anzeigen: $row[15]$NWB#phones-old_messages$NWE
Klient Protokoll: $NWB#phones-protocol$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#phones-local_gmt$NWE
Manager-LOGON: $NWB#phones-ASTmgrUSERNAME$NWE
Manager-Geheimnis: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Rückstellung Benutzer: $NWB#phones-login_user$NWE
VICIDIAL Rückstellung Durchlauf: $NWB#phones-login_pass$NWE
VICIDIAL Rückstellung Kampagne: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park-Akte: $NWB#phones-VICIDIAL_park_on_filename$NWE
Überwachen Sie Präfix: $NWB#phones-monitor_prefix$NWE
Aufnahme Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Kontext: $NWB#phones-ext_context$NWE
DTMFSend Führung: $NWB#phones-dtmf_send_extension$NWE
Outbound Anruf-Gruppe: $NWB#phones-call_out_number_group$NWE
Datenbanksuchroutine-Position: $NWB#phones-client_browser$NWE
Bringen Sie Verzeichnis An: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Rückstellung URL: $NWB#phones-VICIDIAL_web_URL$NWE
Anruf-Protokollierung: $NWB#phones-AGI_call_logging_enabled$NWE
Benutzer-Schaltung: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hängezustand: $NWB#phones-admin_hangup_enabled$NWE
Admin Straßenräuber: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Parkschaltung: $NWB#phones-call_parking_enabled$NWE
Updater Überprüfung: $NWB#phones-updater_check_enabled$NWE
Af Protokollierung: $NWB#phones-AFLogging_enabled$NWE
Warteschlange Ermöglicht: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Taste: $NWB#phones-voicemail_button_enabled$NWE
Schnell Erneuern Sie: $NWB#phones-enable_fast_refresh$NWE
Schnell Erneuern Sie Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Selbstvorwahlknopf-Folgende Zahl: $NWB#phones-auto_dial_next_number$NWE
Stoppen Sie Rec nach jedem Anruf: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Bediener: (HauptsächlichDB Server)$NWB#phones-DBX_server$NWE
DBX Datenbank: (HauptsächlichServer Database)$NWB#phones-DBX_database$NWE
DBX Benutzer: (HauptsächlichDB Login)$NWB#phones-DBX_user$NWE
DBX Durchlauf: (HauptsächlichDB Secret)$NWB#phones-DBX_pass$NWE
DBX Tor: (HauptsächlichDB Port)$NWB#phones-DBX_port$NWE
DBY Bediener: (ZweitensDB Server)$NWB#phones-DBY_server$NWE
DBY Datenbank: (ZweitensServer Database)$NWB#phones-DBY_database$NWE
DBY Benutzer: (ZweitensDB Login)$NWB#phones-DBY_user$NWE
DBY Durchlauf: (ZweitensDB Secret)$NWB#phones-DBY_pass$NWE
DBY Tor: (ZweitensDB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Klicken Sie hier für Telefonnotfall\n"; - -if ($LOGdelete_phones > 0) - { - echo "

LÖSCHEN SIE DIESES TELEFON\n"; - } - -} - -###################### -# ADD=41 submit server modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) - {echo "
BEDIENERNOT MODIFIED - there is already a server in the system with this server_id\n";} - else - { - $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) - {echo "
BEDIENER NICHT GEÄNDERT - es gibt bereits einen Bediener im Systemmit diesem server_ip\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
BEDIENER NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n";} - else - { - echo "
BEDIENER GEÄNDERT: $server_ip\n"; - - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; - $rslt=mysql_query($stmt, $link); - } - } - } - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ÄNDERN Sie Einen BEDIENER-SATZ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Bediener Identifikation: $NWB#servers-server_id$NWE
Bediener-Beschreibung: $NWB#servers-server_description$NWE
Bediener-IP address: $NWB#servers-server_ip$NWE
Aktiv:$NWB#servers-active$NWE
Sternchen-Version: $NWB#servers-asterisk_version$NWE
Maximale VICIDIAL Stämme: $NWB#servers-max_vicidial_trunks$NWE
Telnet Wirt: $NWB#servers-telnet_host$NWE
Telnet Tor: $NWB#servers-telnet_port$NWE
Manager-Benutzer: $NWB#servers-ASTmgrUSERNAME$NWE
Manager-Geheimnis: $NWB#servers-ASTmgrSECRET$NWE
Manager-Update-Benutzer: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Hören Benutzer: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Senden Benutzer: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Lokales GMT: (Stellen Sie NICHT auf DST ein)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL ANZEIGE Verlängerung: $NWB#servers-answer_transfer_agent$NWE
Rückstellung Kontext: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
TELEFONE INNERHALB DIESES BEDIENERS:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
VERLÄNGERUNGNAMEAKTIV
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Dieser Bediener hat $active_lists aktive Telefone und $inactive_lists unaktivierte Telefone

\n"; -echo "
\n"; - -} - -###################### -# ADD=411 submit conference modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) - {echo "
KONFERENZ NICHT GEÄNDERT - es gibt bereits eine Konferenz im Systemmit diesem Verlängerung-Bediener\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
KONFERENZ NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n";} - else - { - echo "
KONFERENZ ÄNDERTE: $conf_exten\n"; - - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from conferences where conf_exten='$conf_exten';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ÄNDERN Sie Einen KONFERENZ-SATZ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Konferenz:$NWB#conferences-conf_exten$NWE
Bediener IP: $NWB#conferences-server_ip$NWE
Gegenwärtige Verlängerung:
\n"; - -echo "
\n"; - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo ""; - -echo "
SUCHE NACH Einem TELEFON\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Verlängerung:
Voller Name:
Phone type:
\n"; - -} - -###################### -# ADD=66 phone search results -###################### - -if ($ADD==66) -{ - echo ""; - - $SQL = ''; - if ($extension) {$SQL .= "extension LIKE \"%$extension%\" and";} - if ($fullname) {$SQL .= "fullname LIKE \"%$fullname%\" and";} - if ($phone_type) {$SQL .= "phone_type LIKE \"%$phone_type%\" and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from phones $SQL order by extension,server_ip;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
SUCHRESULTATE:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]ÄNDERN Sie | Notfall
\n"; - -} - - - -###################### -# ADD=0 display all active phones -###################### -if ($ADD==0) -{ - echo ""; - - $stmt="SELECT * from phones order by extension,server_ip"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
TELEFON-AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]ÄNDERN Sie | Notfall
\n"; -} - -###################### -# ADD=10 display all servers -###################### -if ($ADD==10) -{ - echo ""; - - $stmt="SELECT * from servers order by server_id"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
BEDIENER-AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[1] $row[2] $row[4] $row[3]  ÄNDERN Sie
\n"; -} - - -###################### -# ADD=100 display all conferences -###################### -if ($ADD==100) -{ - echo ""; - - $stmt="SELECT * from conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
KONFERENZ-AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]  ÄNDERN Sie
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds"; -echo "             VERSION: $version"; -echo "             BAU: $build
\n"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient_de/dbconnect.php b/LANG_admin/astguiclient_de/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_admin/astguiclient_de/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_admin/astguiclient_de/help.gif b/LANG_admin/astguiclient_de/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/astguiclient_de/help.gif and /dev/null differ diff --git a/LANG_admin/astguiclient_de/inbound_popup.php b/LANG_admin/astguiclient_de/inbound_popup.php deleted file mode 100644 index e75f7a74..00000000 --- a/LANG_admin/astguiclient_de/inbound_popup.php +++ /dev/null @@ -1,228 +0,0 @@ - LICENSE: GPLv2 -### -# this is the inbound popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. -# -# changes: -# 60620-1329 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK ENTFERNTINBOUND: Popup - - -
- - 0) -{ - - $stmt="DELETE from parked_channels where server_ip='$user_server_ip' and parked_time='" . mysql_real_escape_string($parked_time) . "' and channel='" . mysql_real_escape_string($channel) . "' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$user_server_ip','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: " . mysql_real_escape_string($channel) . "','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Adressieren Sie den Befehl um, der für Führung gesendet wird $channel       $NOW_TIME\n

\n"; - - - $url = 'https://10.10.10.15/internal/back_end_systems/cust_serv/index.php?Search=SEARCH&'; - $Suser = 'username='; - $Spass = '&passwd='; - $Sphone = '&phone='; - - $newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW$Sphone$phone"; - if ( ($phone == 'unknown') or (strlen($phone)<9) ) - {$newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW";} - - echo "Schauen Sie oben diesen Kunden im Kundendienst-System\n

\n"; - - echo "Schließen Sie dieses Fenster\n

\n"; -} -else -{ - echo "Adressieren Sie den Befehl um, der für Führung VERLASSEN wird $channel       $NOW_TIME\n

\n"; - echo "Schließen Sie dieses Fenster\n

\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient_de/phone_stats.php b/LANG_admin/astguiclient_de/phone_stats.php deleted file mode 100644 index 59855fcb..00000000 --- a/LANG_admin/astguiclient_de/phone_stats.php +++ /dev/null @@ -1,244 +0,0 @@ - LICENSE: GPLv2 -# -# -# changes: -# 60620-1333 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$admin_page = './admin.php'; - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname from phones where server_ip='$server_ip' and extension='$extension'"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $row[0]; - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK ADMIN: Telefon-Notfall - - -
-
- - - - - - -\n"; -echo "
  STERNCHEN ADMIN: Leitung  
  VERZEICHNEN SIE ALLE TELEFONE | ADDIEREN Sie Ein NEUES TELEFON | SUCHE NACH Einem TELEFON | ADDIEREN Sie Einen BEDIENER | VERZEICHNEN SIE ALLE BEDIENER
  ZEIGEN SIE ALLE KONFERENZEN | ADDIEREN Sie Eine NEUE KONFERENZ
  \n"; - -echo "\n"; -echo "\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' group by channel_group order by channel_group"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - -echo "
\n"; - -echo "ANRUF-ZEIT UND FÜHRUNGEN:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} -# echo "|$stmt|\n"; - -echo "\n"; -echo "
KANALGRUPPE ZÄHLIMPULS HOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
GESAMTANRUFE $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "ANRUFE DES LETZT-1000 FÜR DATUM-STRECKE:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' LIMIT 1000"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - - - $call_seconds=0; - $o++; - } - - -echo "
ZAHL KANALGRUPPE DATUM LENGTH(MIN.)
$row[0] $row[1] $row[2] $row[3]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient_de/remote_inbound.php b/LANG_admin/astguiclient_de/remote_inbound.php deleted file mode 100644 index df7b50d4..00000000 --- a/LANG_admin/astguiclient_de/remote_inbound.php +++ /dev/null @@ -1,162 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - echo"\n"; - echo"ASTERISK ENTFERNTINBOUND: Hauptsächlich\n"; - echo"\n"; - echo"\n"; - echo"\n"; - -?> - - -
- -
\n"; - -echo "Klicken Sie an die Führung unter der, die Sie auf Ihr Telefonverwiesen haben möchten

\n"; - -echo "
\n";
-echo "CHANNEL    BEDIENER       CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME        \n";
-echo "----------------------------------------------------------------------------------------------\n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='$user_server_ip' order by parked_time";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='$user_server_ip' and channel_group LIKE \"IN_%\" order by parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$extension =		sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		echo "$channel$server$channel_group$extension$parked_by$parked_time\n";
-
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "*************************************** NO PARKED CALLS **************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient_el/AST_inboundEXTstats.php b/LANG_admin/astguiclient_el/AST_inboundEXTstats.php deleted file mode 100644 index f8436560..00000000 --- a/LANG_admin/astguiclient_el/AST_inboundEXTstats.php +++ /dev/null @@ -1,400 +0,0 @@ - LICENSE: GPLv2 -# -# CHANGES -# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.11.20';} - -$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$inbound_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $inbound_to_print) - { - $row=mysql_fetch_row($rslt); - $inbound[$i] =$row[0]; - $fullnum[$i] =$row[1]; - $inbname[$i] =$row[2]; - $i++; - } -?> - - - - - -\n"; -#echo"\n"; -echo "ASTERISK: Στατιστικά Εισερχομένων Κλησεων\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "ΠΑΡΑΚΑΛΩ ΕΠΙΛΕΞΤΕ ΕΝΑΝ ΑΡΙΘΜΟ ΚΑΙ ΗΜΕΡΟΜΗΝΙΑ ΑΝΩΤΕΡΩ, ΚΑΙ ΠΑΤΗΣΤΕ ΕΠΙΒΕΒΑΙΩΣΗ\n";
-}
-
-else
-{
-
-
-echo "ASTERISK: Στατιστικά Εισερχομένων Κλησεων                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
-if (eregi("\*",$group))
-	{$extenSQL = "and extension LIKE \"%$group\"";}
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Συνολικές κλήσεις που ήρθαν σε αυτό τον αριθμό:       $TOTALcalls\n";
-echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- ΕΓΚΑΤΑΛ\n";
-
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-if ($row[0])
-	{
-	$average_hold_seconds = ($row[1] / $row[0]);
-	$average_hold_seconds = round($average_hold_seconds, 0);
-	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-	}
-else {$DROPpercent=0;   $average_hold_seconds=0;}
-echo "Total DROP Calls:   (less than 10 seconds)    $DROPcalls  $DROPpercent%\n";
-echo "Average Call Length(seconds) for DROP Calls:  $average_hold_seconds\n";
-
-
-##############################
-#########  CALLS STATS
-
-echo "\n";
-echo "---------- CALL LISTINGS\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-echo "| CALLERID             | CALLERIDNAME         | LENGTH | DATE TIME           |\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$CID =			sprintf("%-20s", $row[0]);
-	$CIDname =		sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$datetime =		sprintf("%-19s", $row[3]);
-	$USERavgTALK =	$row[2];
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
-
-	$i++;
-	}
-
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-##############################
-#########  TIME STATS
-
-if ($output == 'FULL')
-	{
-
-	echo "\n";
-	echo "---------- ΣΤΑΤΙΣΤΙΚΑ ΧΡΟΝΟΥ\n";
-
-	echo "\n";
-
-	$hi_hour_count=0;
-	$last_full_record=0;
-	$i=0;
-	$h=0;
-	while ($i <= 96)
-		{
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-		$h++;
-		}
-
-	$hour_multiplier = (100 / $hi_hour_count);
-	#$hour_multiplier = round($hour_multiplier, 0);
-
-	echo "\n";
-	echo "ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ\n";
-
-	$k=1;
-	$Mk=0;
-	$call_scale = '0';
-	while ($k <= 102) 
-		{
-		if ($Mk >= 5) 
-			{
-			$Mk=0;
-			$scale_num=($k / $hour_multiplier);
-			$scale_num = round($scale_num, 0);
-			$LENscale_num = (strlen($scale_num));
-			$k = ($k + $LENscale_num);
-			$call_scale .= "$scale_num";
-			}
-		else
-			{
-			$call_scale .= " ";
-			$k++;   $Mk++;
-			}
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-	#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-	echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-	$ZZ = '00';
-	$i=0;
-	$h=4;
-	$hour= -1;
-	$no_lines_yet=1;
-
-	while ($i <= 96)
-		{
-		$char_counter=0;
-		$time = '      ';
-		if ($h >= 4) 
-			{
-			$hour++;
-			$h=0;
-			if ($hour < 10) {$hour = "0$hour";}
-			$time = "+$hour$ZZ+";
-			}
-		if ($h == 1) {$time = "   15 ";}
-		if ($h == 2) {$time = "   30 ";}
-		if ($h == 3) {$time = "   45 ";}
-		$Ghour_count = $hour_count[$i];
-		if ($Ghour_count < 1) 
-			{
-			if ( ($no_lines_yet) or ($i > $last_full_record) )
-				{
-				$do_nothing=1;
-				}
-			else
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				echo "|$time|";
-				$k=0;   while ($k <= 102) {echo " ";   $k++;}
-				echo "| $hour_count[$i] |\n";
-				}
-			}
-		else
-			{
-			$no_lines_yet=0;
-			$Xhour_count = ($Ghour_count * $hour_multiplier);
-			$Yhour_count = (99 - $Xhour_count);
-
-			$Gdrop_count = $drop_count[$i];
-			if ($Gdrop_count < 1) 
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "*X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 101) {echo " ";   $char_counter++;}
-				echo "| 0     | $hour_count[$i] |\n";
-
-				}
-			else
-				{
-				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-				echo "D";   $char_counter++;
-				$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 102) {echo " ";   $char_counter++;}
-				echo "| $drop_count[$i] | $hour_count[$i] |\n";
-				}
-			}
-		
-		
-		$i++;
-		$h++;
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-	}
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/astguiclient_el/admin.php b/LANG_admin/astguiclient_el/admin.php deleted file mode 100644 index d332d0f6..00000000 --- a/LANG_admin/astguiclient_el/admin.php +++ /dev/null @@ -1,1824 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI database administration -# -# CHANGES -# 50913-1118 - Added outbound_cid for web-client calls -# 50926-1356 - Modified to allow for language translation -# 50926-1613 - Added WeBRooTWritablE write controls -# 51128-1254 - Modified to allow PHP global vars off -# 51208-2120 - Added option to login with vicidial_user login if allowed -# 51213-1650 - Added option to delete phones if allowed by vicidial_users -# 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1137 - Fixed phone search bug -# 60620-1243 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '1.1.12'; -$build = '60620-1243'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_id"])) {$server_id=$_GET["server_id"];} - elseif (isset($_POST["server_id"])) {$server_id=$_POST["server_id"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} - elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} -if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} - elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} -if (isset($_GET["computer_ip"])) {$computer_ip=$_GET["computer_ip"];} - elseif (isset($_POST["computer_ip"])) {$computer_ip=$_POST["computer_ip"];} -if (isset($_GET["login"])) {$login=$_GET["login"];} - elseif (isset($_POST["login"])) {$login=$_POST["login"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["phone_type"])) {$phone_type=$_GET["phone_type"];} - elseif (isset($_POST["phone_type"])) {$phone_type=$_POST["phone_type"];} -if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} - elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} -if (isset($_GET["company"])) {$company=$_GET["company"];} - elseif (isset($_POST["company"])) {$company=$_POST["company"];} -if (isset($_GET["picture"])) {$picture=$_GET["picture"];} - elseif (isset($_POST["picture"])) {$picture=$_POST["picture"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} - elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} -if (isset($_GET["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"];} - elseif (isset($_POST["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];} -if (isset($_GET["ASTmgrSECRET"])) {$ASTmgrSECRET=$_GET["ASTmgrSECRET"];} - elseif (isset($_POST["ASTmgrSECRET"])) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];} -if (isset($_GET["login_user"])) {$login_user=$_GET["login_user"];} - elseif (isset($_POST["login_user"])) {$login_user=$_POST["login_user"];} -if (isset($_GET["login_pass"])) {$login_pass=$_GET["login_pass"];} - elseif (isset($_POST["login_pass"])) {$login_pass=$_POST["login_pass"];} -if (isset($_GET["login_campaign"])) {$login_campaign=$_GET["login_campaign"];} - elseif (isset($_POST["login_campaign"])) {$login_campaign=$_POST["login_campaign"];} -if (isset($_GET["park_on_extension"])) {$park_on_extension=$_GET["park_on_extension"];} - elseif (isset($_POST["park_on_extension"])) {$park_on_extension=$_POST["park_on_extension"];} -if (isset($_GET["conf_on_extension"])) {$conf_on_extension=$_GET["conf_on_extension"];} - elseif (isset($_POST["conf_on_extension"])) {$conf_on_extension=$_POST["conf_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"];} - elseif (isset($_POST["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"];} - elseif (isset($_POST["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];} -if (isset($_GET["monitor_prefix"])) {$monitor_prefix=$_GET["monitor_prefix"];} - elseif (isset($_POST["monitor_prefix"])) {$monitor_prefix=$_POST["monitor_prefix"];} -if (isset($_GET["recording_exten"])) {$recording_exten=$_GET["recording_exten"];} - elseif (isset($_POST["recording_exten"])) {$recording_exten=$_POST["recording_exten"];} -if (isset($_GET["voicemail_exten"])) {$voicemail_exten=$_GET["voicemail_exten"];} - elseif (isset($_POST["voicemail_exten"])) {$voicemail_exten=$_POST["voicemail_exten"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["dtmf_send_extension"])) {$dtmf_send_extension=$_GET["dtmf_send_extension"];} - elseif (isset($_POST["dtmf_send_extension"])) {$dtmf_send_extension=$_POST["dtmf_send_extension"];} -if (isset($_GET["call_out_number_group"])) {$call_out_number_group=$_GET["call_out_number_group"];} - elseif (isset($_POST["call_out_number_group"])) {$call_out_number_group=$_POST["call_out_number_group"];} -if (isset($_GET["client_browser"])) {$client_browser=$_GET["client_browser"];} - elseif (isset($_POST["client_browser"])) {$client_browser=$_POST["client_browser"];} -if (isset($_GET["install_directory"])) {$install_directory=$_GET["install_directory"];} - elseif (isset($_POST["install_directory"])) {$install_directory=$_POST["install_directory"];} -if (isset($_GET["local_web_callerID_URL"])) {$local_web_callerID_URL=$_GET["local_web_callerID_URL"];} - elseif (isset($_POST["local_web_callerID_URL"])) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];} -if (isset($_GET["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"];} - elseif (isset($_POST["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];} -if (isset($_GET["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"];} - elseif (isset($_POST["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];} -if (isset($_GET["user_switching_enabled"])) {$user_switching_enabled=$_GET["user_switching_enabled"];} - elseif (isset($_POST["user_switching_enabled"])) {$user_switching_enabled=$_POST["user_switching_enabled"];} -if (isset($_GET["conferencing_enabled"])) {$conferencing_enabled=$_GET["conferencing_enabled"];} - elseif (isset($_POST["conferencing_enabled"])) {$conferencing_enabled=$_POST["conferencing_enabled"];} -if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} - elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} -if (isset($_GET["admin_hijack_enabled"])) {$admin_hijack_enabled=$_GET["admin_hijack_enabled"];} - elseif (isset($_POST["admin_hijack_enabled"])) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];} -if (isset($_GET["admin_monitor_enabled"])) {$admin_monitor_enabled=$_GET["admin_monitor_enabled"];} - elseif (isset($_POST["admin_monitor_enabled"])) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];} -if (isset($_GET["call_parking_enabled"])) {$call_parking_enabled=$_GET["call_parking_enabled"];} - elseif (isset($_POST["call_parking_enabled"])) {$call_parking_enabled=$_POST["call_parking_enabled"];} -if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["updater_check_enabled"];} - elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];} -if (isset($_GET["AFLogging_enabled"])) {$AFLogging_enabled=$_GET["AFLogging_enabled"];} - elseif (isset($_POST["AFLogging_enabled"])) {$AFLogging_enabled=$_POST["AFLogging_enabled"];} -if (isset($_GET["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"];} - elseif (isset($_POST["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];} -if (isset($_GET["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"];} - elseif (isset($_POST["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];} -if (isset($_GET["voicemail_button_enabled"])) {$voicemail_button_enabled=$_GET["voicemail_button_enabled"];} - elseif (isset($_POST["voicemail_button_enabled"])) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];} -if (isset($_GET["enable_fast_refresh"])) {$enable_fast_refresh=$_GET["enable_fast_refresh"];} - elseif (isset($_POST["enable_fast_refresh"])) {$enable_fast_refresh=$_POST["enable_fast_refresh"];} -if (isset($_GET["fast_refresh_rate"])) {$fast_refresh_rate=$_GET["fast_refresh_rate"];} - elseif (isset($_POST["fast_refresh_rate"])) {$fast_refresh_rate=$_POST["fast_refresh_rate"];} -if (isset($_GET["enable_persistant_mysql"])) {$enable_persistant_mysql=$_GET["enable_persistant_mysql"];} - elseif (isset($_POST["enable_persistant_mysql"])) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];} -if (isset($_GET["auto_dial_next_number"])) {$auto_dial_next_number=$_GET["auto_dial_next_number"];} - elseif (isset($_POST["auto_dial_next_number"])) {$auto_dial_next_number=$_POST["auto_dial_next_number"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["DBX_server"])) {$DBX_server=$_GET["DBX_server"];} - elseif (isset($_POST["DBX_server"])) {$DBX_server=$_POST["DBX_server"];} -if (isset($_GET["DBX_database"])) {$DBX_database=$_GET["DBX_database"];} - elseif (isset($_POST["DBX_database"])) {$DBX_database=$_POST["DBX_database"];} -if (isset($_GET["DBX_user"])) {$DBX_user=$_GET["DBX_user"];} - elseif (isset($_POST["DBX_user"])) {$DBX_user=$_POST["DBX_user"];} -if (isset($_GET["DBX_pass"])) {$DBX_pass=$_GET["DBX_pass"];} - elseif (isset($_POST["DBX_pass"])) {$DBX_pass=$_POST["DBX_pass"];} -if (isset($_GET["DBX_port"])) {$DBX_port=$_GET["DBX_port"];} - elseif (isset($_POST["DBX_port"])) {$DBX_port=$_POST["DBX_port"];} -if (isset($_GET["DBY_server"])) {$DBY_server=$_GET["DBY_server"];} - elseif (isset($_POST["DBY_server"])) {$DBY_server=$_POST["DBY_server"];} -if (isset($_GET["DBY_database"])) {$DBY_database=$_GET["DBY_database"];} - elseif (isset($_POST["DBY_database"])) {$DBY_database=$_POST["DBY_database"];} -if (isset($_GET["DBY_user"])) {$DBY_user=$_GET["DBY_user"];} - elseif (isset($_POST["DBY_user"])) {$DBY_user=$_POST["DBY_user"];} -if (isset($_GET["DBY_pass"])) {$DBY_pass=$_GET["DBY_pass"];} - elseif (isset($_POST["DBY_pass"])) {$DBY_pass=$_POST["DBY_pass"];} -if (isset($_GET["DBY_port"])) {$DBY_port=$_GET["DBY_port"];} - elseif (isset($_POST["DBY_port"])) {$DBY_port=$_POST["DBY_port"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["old_extension"])) {$old_extension=$_GET["old_extension"];} - elseif (isset($_POST["old_extension"])) {$old_extension=$_POST["old_extension"];} -if (isset($_GET["old_server_ip"])) {$old_server_ip=$_GET["old_server_ip"];} - elseif (isset($_POST["old_server_ip"])) {$old_server_ip=$_POST["old_server_ip"];} -if (isset($_GET["old_server_id"])) {$old_server_id=$_GET["old_server_id"];} - elseif (isset($_POST["old_server_id"])) {$old_server_id=$_POST["old_server_id"];} -if (isset($_GET["server_description"])) {$server_description=$_GET["server_description"];} - elseif (isset($_POST["server_description"])) {$server_description=$_POST["server_description"];} -if (isset($_GET["asterisk_version"])) {$asterisk_version=$_GET["asterisk_version"];} - elseif (isset($_POST["asterisk_version"])) {$asterisk_version=$_POST["asterisk_version"];} -if (isset($_GET["max_vicidial_trunks"])) {$max_vicidial_trunks=$_GET["max_vicidial_trunks"];} - elseif (isset($_POST["max_vicidial_trunks"])) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];} -if (isset($_GET["telnet_host"])) {$telnet_host=$_GET["telnet_host"];} - elseif (isset($_POST["telnet_host"])) {$telnet_host=$_POST["telnet_host"];} -if (isset($_GET["telnet_port"])) {$telnet_port=$_GET["telnet_port"];} - elseif (isset($_POST["telnet_port"])) {$telnet_port=$_POST["telnet_port"];} -if (isset($_GET["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"];} - elseif (isset($_POST["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];} -if (isset($_GET["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"];} - elseif (isset($_POST["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];} -if (isset($_GET["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"];} - elseif (isset($_POST["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];} -if (isset($_GET["answer_transfer_agent"])) {$answer_transfer_agent=$_GET["answer_transfer_agent"];} - elseif (isset($_POST["answer_transfer_agent"])) {$answer_transfer_agent=$_POST["answer_transfer_agent"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["old_conf_exten"])) {$old_conf_exten=$_GET["old_conf_exten"];} - elseif (isset($_POST["old_conf_exten"])) {$old_conf_exten=$_POST["old_conf_exten"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS and Dots -$phone_ip = ereg_replace("[^\.0-9]","",$phone_ip); -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$old_server_ip = ereg_replace("[^\.0-9]","",$old_server_ip); -$computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); - -### DIGITS ONLY ### -$dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); -$voicemail_id = ereg_replace("[^0-9]","",$voicemail_id); -$outbound_cid = ereg_replace("[^0-9]","",$outbound_cid); -$VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); -$park_on_extension = ereg_replace("[^0-9]","",$park_on_extension); -$conf_on_extension = ereg_replace("[^0-9]","",$conf_on_extension); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$old_conf_exten = ereg_replace("[^0-9]","",$old_conf_exten); -$voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); -$voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); -$recording_exten = ereg_replace("[^0-9]","",$recording_exten); -$monitor_prefix = ereg_replace("[^0-9]","",$monitor_prefix); -$answer_transfer_agent = ereg_replace("[^0-9]","",$answer_transfer_agent); -$DBX_port = ereg_replace("[^0-9]","",$DBX_port); -$DBY_port = ereg_replace("[^0-9]","",$DBY_port); -$telnet_port = ereg_replace("[^0-9]","",$telnet_port); -$max_vicidial_trunks = ereg_replace("[^0-9]","",$max_vicidial_trunks); -$auto_dial_next_number = ereg_replace("[^0-9]","",$auto_dial_next_number); -$VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); -$enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); -$enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); -$user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); -$updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); -$QUEUE_ACTION_enabled = ereg_replace("[^0-9]","",$QUEUE_ACTION_enabled); -$conferencing_enabled = ereg_replace("[^0-9]","",$conferencing_enabled); -$voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); -$CallerID_popup_enabled = ereg_replace("[^0-9]","",$CallerID_popup_enabled); -$call_parking_enabled = ereg_replace("[^0-9]","",$call_parking_enabled); -$AGI_call_logging_enabled = ereg_replace("[^0-9]","",$AGI_call_logging_enabled); -$AFLogging_enabled = ereg_replace("[^0-9]","",$AFLogging_enabled); -$admin_monitor_enabled = ereg_replace("[^0-9]","",$admin_monitor_enabled); -$admin_hijack_enabled = ereg_replace("[^0-9]","",$admin_hijack_enabled); -$admin_hangup_enabled = ereg_replace("[^0-9]","",$admin_hangup_enabled); -$fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); -$ADD = ereg_replace("[^0-9]","",$ADD); - -### ALPHA-NUMERIC and underscore and dash and slash and at and dot -$extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); -$old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); -$install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); -$client_browser = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$client_browser); -$dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); -$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); -$telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); -$DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); -$DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); - -### ALPHA-NUMERIC (and underscore and dash) -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$login = ereg_replace("[^-\_0-9a-zA-Z]","",$login); -$user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^-\_0-9a-zA-Z]","",$pass); -$status = ereg_replace("[^-\_0-9a-zA-Z]","",$status); -$protocol = ereg_replace("[^-\_0-9a-zA-Z]","",$protocol); -$ASTmgrUSERNAMEupdate = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEupdate); -$ASTmgrUSERNAMEsend = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEsend); -$ASTmgrUSERNAMElisten = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMElisten); -$ASTmgrUSERNAME = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAME); -$ASTmgrSECRET = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrSECRET); -$login_user = ereg_replace("[^-\_0-9a-zA-Z]","",$login_user); -$login_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$login_pass); -$login_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$login_campaign); -$DBX_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_user); -$DBY_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_user); -$DBX_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_pass); -$DBY_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_pass); -$DBX_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_database); -$DBY_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_database); -$VICIDIAL_park_on_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$VICIDIAL_park_on_filename); -$server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); -$old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); -$ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); -$CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); -$company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); -$picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); -$local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); -$server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); -$asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - -### VARIABLES TO BE mysql_real_escape_string ### -# $VICIDIAL_web_URL = -# $local_web_callerID_URL = - -##### END VARIABLE FILTERING FOR SECURITY ##### - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Έχετε αποσυνδεθεί. Σας ευχαριστούμε\n"; - exit; -} - -if (!isset($ADD)) {$ADD=0;} - -$STARTtime = date("U"); -$STARTdate = date("Y-m-d H:i:s"); - -if ($ADD==1) {$process = 'ΠΡΟΣΘΕΣΕ ΝΕΟ ΤΗΛΕΦΩΝΟ';} -if ($ADD==11) {$process = 'ΠΡΟΣΘΕΣΕ ΝΕΟ ΔΙΑΚΟΜΙΣΤΗ';} -if ($ADD==111) {$process = 'ΠΡΟΣΘΕΣΕ ΝΕΑ ΣΥΝΔΙΑΛΕΞΗ';} -if ($ADD==2) {$process = 'ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΤΗΛΕΦΩΝΟΥ';} -if ($ADD==21) {$process = 'ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΔΙΑΚΟΜΙΣΤΗ';} -if ($ADD==211) {$process = 'ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΣΥΝΔΙΑΛΕΞΗΣ';} -if ($ADD==3) {$process = 'ΤΡΟΠΟΠΟΙΗΣΕ ΤΗΛΕΦΩΝΟ';} -if ($ADD==31) {$process = 'ΤΡΟΠΟΠΟΙΗΣΕ ΔΙΑΚΟΜΙΣΤΗ';} -if ($ADD==311) {$process = 'ΤΡΟΠΟΠΟΙΗΣΕ ΣΥΝΔΙΑΛΕΞΗ';} -if ($ADD==4) {$process = 'ΤΡΟΠΟΠΟΙΗΣΗ ΤΗΛΕΦΩΝΟΥ';} -if ($ADD==41) {$process = 'ΤΡΟΠΟΠΟΙΗΣΗ ΔΙΑΚΟΜΙΣΤΗ';} -if ($ADD==411) {$process = 'ΤΡΟΠΟΠΟΙΗΣΗ ΣΥΝΔΙΑΛΕΞΗΣ';} -if ($ADD==5) {$process = 'DELETE PHONE';} -if ($ADD==6) {$process = 'DELETE PHONE';} -if ($ADD==55) {$process = 'ΑΝΑΖΗΤΗΣΗ ΤΗΛΕΦΩΝΩΝ';} -if ($ADD==66) {$process = 'ΑΝΑΖΗΤΗΣΗ ΑΠΟΤΕΛΕΣΜΑΤΩΝ ΤΗΛΕΦΩΝΩΝ';} -if ($ADD==0) {$process = 'ΛΙΣΤΑ ΤΗΛΕΦΩΝΟΥ';} -if ($ADD==10) {$process = 'ΛΙΣΤΑ ΔΙΑΚΟΜΙΣΤΗ';} -if ($ADD==100) {$process = 'ΛΙΣΤΑ ΣΥΝΔΙΑΛΕΞΕΩΝ';} -if ($ADD==99999) {$process = 'ΒΟΗΘΕΙΑ';} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if ($auth<1) - { - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > '6' and ast_admin_access='1';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGdelete_phones =$row[17]; - } - } - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - echo "|$stmt|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - if (strlen($LOGfullname) < 1) - { - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - } - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rsltx=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rsltx); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $servers_list .= "\n"; - $o++; - } - - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); - -$NWB = "   \"ΒΟΗΘΕΙΑ\""; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "ΣΥΣΤΗΜΑ ΚΛΗΣΕΩΝ: Διαχείριση - $process \n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
ASTERISK ADMIN: ΒΟΗΘΕΙΑ


\n"; - -?> -ΠΙΝΑΚΑΣ ΤΗΛΕΦΩΝΩΝ

- -
-Εσωτ.Σύνδεση Τηλεφώνου - Αυτό το πεδίο είναι για την καταχώρηση του ονόματος του τηλεφώνου, όπως αυτό εμφανίζεται στο Asterisk, χωρίς να συμπεριλαμβάνει το πρωτόκολλο ή slash στην αρχή. Για παράδειγμα: για SIP τηλέφωνο SIPVtest101 η Εσω.Γραμμή Τηλεφώνου θα είναι test101. Επίσης, για IAX2 τηλέφωνα χρησιμοποιείστε τα πλήρης ονόματα: IAX2/IAXphone1@IAXphone1 θα είναι IAXphone1@IAXphone1. Για Zap τηλέφωνα καταχωρήστε το πλήρες κανάλι: Zap/25-1 θα είναι 25-1. Αλλη σημείωση, ορίστε το πρωτόκολλο παρακάτω σωστά για τον τύπο του τηλεφώνου. - -
-
-
-Αριθμός Σχεδίου Κλήσεων - Αυτό το πεδίο είναι για τον αριθμό που καλείται για να κουδουνίζει το τηλέφωνο. Αυτός ο αριθμός ορίζεται στο αρχείο extensions.conf του διακομιστή Asterisk - -
-
-
-Περιεχόμενο Φωνητικού Ταχυδρομείου - Αυτό το πεδίο είναι για το περιεχόμενο του φωνητικού ταχυδρομείου, όπου πηγαίνουν τα μηνύματα του τηλεφώνου του χρήστη. Το χρησιμοποιούμαι για να ελέγξουμε τα φωνητικά μηνύματα και για να μπορεί ο χρήστης να χρησιμοποιήσει το πλήκτρο VOICEMAIL. - -
-
-
-CallerID Εξερχομένων - Αυτό το πεδίο είναι για την καταχώριση του αριθμού callerID που θα θέλατε να εμφανίζεται στις εξερχόμενες κλήσεις. - -
-
-
-Δνση IP Τηλεφώνου - Αυτό το πεδίο είναι για την δνση IP του τηλέφωνου εάν είναι ένα VOIP τηλέφωνο. Αυτό είναι ένα προαιρετικό πεδίο - -
-
-
-Δνση IP Υπολογιστού - Αυτό το πεδίο είναι για την δνση IP του υπολογιστή του χρήστη. Αυτό είναι ένα προαιρετικό πεδίο - -
-
-
-IP Διακομιστή - Αυτός ο κατάλογος επιλογών είναι που επιλέγετε σε ποιον διακομιστή το τηλέφωνο είναι ενεργό. - -
-
-
-Σύνδεση - η σύνδεση που χρησιμοποιείται για τον τηλεφωνικό χρήστηστη σύνδεση στις εφαρμογές πελατών. - -
-
-
-Κωδικός πρόσβασης - ο κωδικός πρόσβασης που χρησιμοποιείται γιατον τηλεφωνικό χρήστη στη σύνδεση στις εφαρμογές πελατών. - -
-
-
-Κατάσταση - Η κατάσταση του τηλεφώνου στο σύστημα, ΕΝΕΡΓΗ και ΔΙΑΧ επιτρέπουν στους GUI πελάτες να δουλέψουν. Η ΔΙΑΧ επιτρέπει την πρόσβαση στην ιστοσελίδα διαχείρισης. - -
-
-
-Ενεργός Λογαριασμός - Κατά πόσο το τηλέφωνο είναι ενεργό για να τοποθετηθεί στην λίστα στο GUI. - -
-
-
-Τύπος Τηλεφώνου - Απλά για σημειώσεις διαχείρισης. - -
-
-
-Πλήρες Ονομα - Χρησιμοποιείται από τον χρήστη GUI στην λίστα ενεργών τηλεφώνων. - -
-
-
-Εταιρία - Απλά για σημειώσεις διαχείρισης. - -
-
-
-Εικόνα - Δεν έχει υλοποιηθεί ακόμα. - -
-
-
-Νέα Μηνύματα - Αριθμός νέων φωνητικών μηνυμάτων για αυτό το τηλέφωνο στον διακομιστή Asterisk. - -
-
-
-Παλαιά Μηνύματα - Αριθμός παλαιών φωνητικών μηνυμάτων για αυτό το τηλέφωνο στον διακομιστή Asterisk. - -
-
-
-Πρωτόκολλο Πελάτη - Το πρωτόκολλο που χρησιμοποιεί το τηλέφωνο για συνδεθεί στον διακομιστή Asterisk: SIP, IAX2, Zap. - -
-
-
-οπική GMT - Η διαφορά από την GMT όπου το τηλέφωνο βρίσκεται. Μην το ρυθμίσετε για DAYLIGHT SAVINGS ΩΡΑ. Αυτή χρησιμοποιείται από την VICIDIAL εκστρατεία για την επακριβή εμφάνιση της ώρας. - -
-
-
-Σύνδεση Διαχειριστή - Αυτή είναι η σύνδεση που χρησιμοποιούν οι GUI χρήστες του τηλεφώνου, για πρόσβαση στην Βάση Δεδομένων όπου ο διακομιστής δεδομένων βρίσκεται. - -
-
-
-Μυστικό Διαχειριστή - Αυτός είναι ο κωδικός που χρησιμοποιούν οι GUI χρήστες του τηλεφώνου, για πρόσβαση στην Βάση Δεδομένων όπου ο διακομιστής δεδομένων βρίσκεται. - -
-
-
-Προκαθορισμένος VICIDIAL Χρήστης - Εδώ ορίζεται μία προκαθορισμένη τιμή χρήστη, οπουδήποτε αυτός ο χρήστης τηλεφώνου ανοίξει την εφαρμογή VICIDIAL. Αφήστε κενό για κανένα χρήστη. - -
-
-
-Προκαθορισμένος VICIDIAL Κωδικός - Εδώ ορίζεται μία προκαθορισμένη τιμή κωδικού, οπουδήποτε αυτός ο χρήστης τηλεφώνου ανοίξει την εφαρμογή VICIDIAL. Αφήστε κενό για κανένα κωδικό. - -
-
-
-VICIDIAL Προκαθορισμένη Εκστρατεία - Εδώ ορίζεται μα προκαθορισμένη τιμή εκστρατείας, οπουδήποτε αυτός ο χρήστης τηλεφώνου ανοίξει την εφαρμογή VICIDIAL. Αφήστε κενό για καμία εκστρατεία. - -
-
-
-Εσ.Σύνδ. Στάθμευσης - Αυτή είναι η προκαθορισμένη εσωτ.σύνδεση Στάθμευσης για τις εφαρμογές του χρήστη. - -
-
-
-Εσ.Σύνδ. Συνδιάλεξης - Αυτή είναι η προκαθορισμένη εσωτ.σύνδεση Συνδιάλεξης για τις εφαρμογές του χρήστη. - -
-
-
-Εσωτ.Σύνδεση Στάθμευσης VICIDIAL - Η προκαθορισμένη εσωτ.σύνδεση στάθμευσης. Εξακριβώστε ότι κάποια διαφορετική δουλεύει πριν την αλλάξετε. - -
-
-
- Αρχείο Στάθμευσης VICIDIAL - Το προκαθορισμένο αρχείο στάθμευσης. Μέχρι 10 χαρακτήρες. - -
-
-
-Πρόθεμα παρακολούθησης - Αυτό είναι το πρόθεμα παρακολούθησης των καναλιών ZAP. - -
-
-
-Εσωτ.Σύνδεση Ηχογράφησης - Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων για την εσωτ.σύνδεση ηχογράφησης που χρησιμοποιείται για μεταφορά στις συνδιαλέξεις, ώστε να ηχογραφηθούν.Extensions.conf . - -
-
-
-Βασική Εσωτ.Σύνδεση VMAIL - Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων που ελέγχει την θυρίδα ηχητικών μηνυμάτων. - -
-
-
-Εσωτ.Σύνδεση απόρριψης VMAIL - Αυτο είναι το πρόθεμα του πλάνου κλήσεων που χρησιμοποιείται στο να στέλνει κλήσεις κατευθείαν στη θυρίδα του χρήστη από μία κλήση. - -
-
-
-Περιεχόμενο Εσωτ.Σύνδεσης - Αυτό είναι το περιεχόμενο του πλάνου κλήσεων όπου το τηλέφωνο χρησιμοποιεί. - -
-
-
-Κανάλι αποστολής DTMF - Αυτό είναι το κανάλι του χρησιμοποιείται για την αποστολή DTMF ήχων στις συνδιαλέξεις. - -
-
-
-Εξερχόμεη ομάδα κλήσης - αυτή είναι η ομάδα καναλιού όπου οι εξερχόμενες κλήσεις από αυτό το τηλέφωνο τοποθετούνται. Υπάρχουν ρουτίνες που την χρησιμοποιούν. Για τα κανάλια Zap θέλετε να χρησιμοποιήσετε κάτι σαν Zap/g2, για IAX2 trunks θα θέλετε να χρησιμοποιήσετε το πλήρες πρόθεμα IAX όπως IAX2/VICItest1:secret@10.10.10.15:4569. Ελέγξτε τα trunks με το αρχείο extensions.conf. - -
-
-
-Περιοχή Ιστο-Πλοηγού - Αυτό χρειάζεται μόνο σε Linux συστήματα. - -
-
-
-Κατάλογος Εγκατάστασης - . - -
-
-
-CallerID URL - Αυτή είναι η Δνση της ιστοσελίδας που χρησιμοποιείται για αναζήτηση με callerID - -
-
-
-Προκαθορισμένο VICIDIAL URL - Αυτή είναι η δνση ιστοσελίδας που χρησιμοποιείται για προσαρμοσμένα VICIDIAL ερωτήματα ιστοσελίδας - -
-
-
-Καταγραφή Γεγονότων Κλήσης - Αυτό τοποθετείται σε αληθές εάν το αρχείο call_log.agi βρίσκεται στο αρχείο extensions.conf για τις εξερχόμενες κλήσεις και για τις εσωτ.συνδέσεις 'h' που κλείνουν. Αυτό πρέπει πάντα να είναι 1 για να δουλεύουν σωστά πολλά χαρακτηριστικά των εφαρμογών. - -
-
-
-Μεταγωγή Χρήστη - Εάν το θέσετε σε αληθές θα επιτρέπετε στους χρήστες να μεταβούν σε άλλον λογαριασμό χρήστη - -
-
-
-Σε συνδιάλεξη - Εάν το θέσετε σε αληθές θα επιτρέπετε στους χρήστες να ξεκινούν συνδιαλέξεις μέχρι 6 εξωτερικές γραμμές. - -
-
-
-Διαχειριστού Κλείσιμο- Εάν το θέσετε σε αληθές θα επιτρέπετε στους χρήστες να κλείνουν κάθε γραμμή. - -
-
-
-Διαχειριστού Κλέψιμο - Εάν το θέσετε σε αληθές θα επιτρέπετε στους χρήστες να λαμβάνουν και να ανακατευθύνουν στην εσωτ.σύνδεσή τους οποιαδήποτε γραμμή. - -
-
-
-Διαχειριστού Παρακολούθηση - Εάν το θέσετε σε αληθές θα επιτρέπετε στους χρήστες να λαμβάνουν και να ανακατευθύνουν στην εσωτ.σύνδεσή τους οποιαδήποτε γραμμή. - -
-
-
-Στάθμευση Κλήσης - Εάν το θέσετε σε αληθές θα επιτρέπετε σε χρήστες να σταθμεύουν κλήσεις και κλήσεις σε αναμονή να διαχειρίζονται από οποιοδήποτε άλλο χρήστη. Οι κλήσεις μένουν σε αναμονή για 30 δευτερόλεπτα και μετά κλείνουν. Συνήθως ενεργοποιημένη για όλους. - -
-
-
-Ενεργοποιημένη Ουρά - Εάν το θέσετε σε αληθές θα εμφανίζεται ένα παράθυρο ειδοποίησης, ότι η ώρα ενημέρωσης δεν έχει αλλάξει σε 20 δευτερόλεπτα. - -
-
-
-AF Καταγραφή Γεγονότος - Εάν το θέσετε σε αληθές θα καταγράφονται οι ενέργειες χρήσης του astGUIclient σε ένα αρχείο στον υπολογιστή του χρήστη. - -
-
-
-Ενεργοποιημένη Ουρά - Εάν το θέσετε σε αληθές οι εφαρμογές θα χρησιμοποιούν το ACQS. - -
-
-
-Υπερεμφανιζόμενο παραθύρο CallerID - Εάν το θέσετε σε αληθές θα επιτρέψετε σε αριθμούς ορισμένους στο αρχείο extensions.conf, να στέλνουν οθόνες με CallerID στους astGUIclient χρήστες. - -
-
-
-VMail Πλήκτρο - Εάν το θέσετε σε αληθές θα εμφανιστεί το πλήκτρο VOICEMAIL και τα μηνύματα μπορούν να εμφανίζονται στο astGUIclient. - -
-
-
-Ταχύτητα Ανανέωσης - Εάν το θέσετε σε αληθές ενεργοποιείται ένα νέο ρυθμό ανανέωσης πληροφοριών κλήσης για το astGUIclient. Προκαθορισμένος απενεργοποιημένος ρυθμός είναι 1000 ms (1 δευτερόλεπτο). - -
-
-
-Ρυθμός Ανανέωσης Ταχύτητας - σε χιλιοστά δευτερολέπτου. Χρημοποιείται μόνο εάν η Ταχύτητα Ανανέωσης είναι ενεργοποιημένη. Προκαθορισμένος απενεργοποιημένος ρυθμός είναι 1000 ms (1 δευτερόλεπτο). - -
-
-
-Συνεχής MySQL - Εάν είναι ενεργοποιημένο, το astGUIclient θα παραμένει συνδεμένο αντί να συνδέεται κάθε δευτερόλεπτο. - -
-
-
-Αυτόματη Κλήση Επόμενου Αριθμού - Εάν είναι ενεργοποιημένο, μετά από τον τερματισμό θα γίνει κλήση του επόμενου αριθμού, εκτός εάν επιλέξουμε "Μη κάνεις κλήσεις". - -
-
-
-Σταμάτα την ηχογράφηση μετά από κάθε κλήση - Εάν είναι ενεργοποιημένο η ηχογράφηση θα σταματήσει μετά τον τερματισμό. - -
-
-
-DBΧ Διακομιστής - Ο διακομιστής της Βάσης Δεδομένων MySQL που ο χρήστης θα συνδεθεί. - -
-
-
-DBΧ Βάση Δεδομένων - Η βάση δεδομένων MySQL στην οποία ο χρήστης θα συνδεθεί. Η προκαθορισμένη είναι asterisk. - -
-
-
-DBΧ Χρήστης - Ο χρήστης MySQL για την σύνδεση. Ο προκαθορισμένος είναι cron. - -
-
-
-DBΧ Κωδικός - Ο κωδικός χρήστη MySQL που ο χρήστης χρησιμοποιεί όταν συνδέεται. Ο προκαθορισμένος είναι 1234. - -
-
-
-DBΧ Πόρτα - Η MySQL TCP πόρτα που ο χρήστης χρησιμοποιεί όταν συνδέεται. Η προκαθορισμένη είναι 3306. - -
-
-
-DBY Διακομιστής - Ο διακομιστής της Βάσης Δεδομένων MySQL που ο χρήστης θα συνδεθεί. Δευτερεύονserver, μην χρησιμοποιημένος αυτήν την περίοδο. - -
-
-
-DBY Βάση Δεδομένων - Η βάση δεδομένων MySQL στην οποία ο χρήστης θα συνδεθεί. Η προκαθορισμένη είναι asterisk. Δευτερεύονserver, μην χρησιμοποιημένος αυτήν την περίοδο. - -
-
-
-DBY Χρήστης - Ο χρήστης MySQL για την σύνδεση. Ο προκαθορισμένος είναι cron. Δευτερεύονserver, μην χρησιμοποιημένος αυτήν την περίοδο. - -
-
-
-DBY Κωδικός - Ο κωδικός χρήστη MySQL που ο χρήστης χρησιμοποιεί όταν συνδέεται. Ο προκαθορισμένος είναι 1234. Δευτερεύονserver, μην χρησιμοποιημένος αυτήν την περίοδο. - -
-
-
-DBY Πόρτα - Η MySQL TCP πόρτα που ο χρήστης χρησιμοποιεί όταν συνδέεται. Η προκαθορισμένη είναι 3306. Δευτερεύονserver, μην χρησιμοποιημένος αυτήν την περίοδο. - - -



- -ΠΙΝΑΚΑΣ ΔΙΑΚΟΜΙΣΤΩΝ

-
-
-ID Διακομιστή - Σε αυτό το πεδίο ορίζεται το όνομα του διακομιστή Asterisk, είναι μόνο μία επωνυμία ώστε να αναγνωρίζεται από τους διαχειριστές. - -
-
-
-Περιγραφή Διακομιστή - Το πεδίο στο οποίο περιγράφεται με μία φράση τον διακομιστή Asterisk. - -
-
-
-Δνση IP Διακομιστή - Το πεδίο που ορίζεται η δνση IP του δικτύου του διακομιστή Asterisk. - -
-
-
-Ενεργός - Ορίζει κατά πόσον ο διακομιστής Asterisk είναι ενεργός ή μη ενεργός. - -
-
-
-Εκδοση Asterisk. - -
-
-
-Μέγιστος Αριθμός Trunk του VICIDIAL - Αυτό το πεδίο θα προσδιορίσει τον μέγιστο αριθμό γραμμών, τις οποίες θα χρησιμοποιήσει η διεργασία αυτόματης κλήσης. Εάν θέλετε να αφιερώσετε δύο PRI σε ένα διακομιστή τότε θα πρέπει να το ορίσετε σε 46. Το προκαθορισμένο είναι 96. - -
-
-
-Telnet Πελάτης - Αυτή είναι η δνση ή το όνομα του διακομιστή Asterisk και το πώς οι εφαρμογές διαχείρισης συνδέονται σε αυτόν, όπου τρέχουν. Το προκαθορισμένο είναι 'localhost'. - -
-
-
-Πόρτα Telnet - Αυτή είναι η πόρτα της σύνδεσης με τον διαχειριστή του διακομιστή Asterisk και το πώς οι εφαρμογές διαχείρισης συνδέονται σε αυτόν, όπου τρέχουν. Το προκαθορισμένο είναι '5038'. - -
-
-
- Διαχειριστής Χρήστης - Το όνομα χρήστη που χρησιμοποιείτε γενικά για τον διαχειριστή του διακομιστή Asterisk. Το προκαθορισμένο είναι 'cron' - -
-
-
-Μυστικό Διαχειριστή - Το μυστικό ή κωδικός που χρησιμοποιείτε γενικά για τον διαχειριστή του διακομιστή Asterisk. Το προκαθορισμένο είναι '1111' - -
-
-
-Ενημέρωση Χρήστη Διαχειριστή - Το όνομα χρήστη που χρησιμοποιείτε για σύνδεση στον διακομιστή Asterisk, βελτιστοποιημένο για διεργασίες ενημέρωσης. Το προκαθορισμένο είναι 'updatecron'. - -
-
-
-Ακουσμα Χρήστη Διαχειριστή- Το όνομα χρήστη που χρησιμοποιείτε για σύνδεση στον διακομιστή Asterisk, βελτιστοποιημένο για διεργασίες που μόνο ακούν για έξοδο. Το προκαθορισμένο είναι 'listencron'. - -
-
-
-Αποστολή Διακομιστή Διαχειριστή- Το όνομα χρήστη που χρησιμοποιείτε για σύνδεση στον διακομιστή Asterisk, βελτιστοποιημένο για διεργασίες που μόνο στέλνουν Ενέργειες στον διαχειριστή.Το προκαθορισμένο είναι 'sendcron'. - -
-
-
-GMT offset Διακομιστής - Η διαφορά σε ώρες από την GMT ώρα που δεν έχει ρυθμιστεί με Daylight-Savings-Time. Το προκαθορισμένο είναι '-5' - -
-
-
-Εσωτ.σύνδεση απόρριψης VMail - Το πρόθεμα εσωτ.σύνδεσης που χρησιμοποιείται στον διακομιστή για να στείλει τις κλήσεις κατευθείαν μέσω agc σε ένα συγκεκριμένο φωνητικό ταχυδρομείο. Το προκαθορισμένο είναι '85026666666666' - -
-
-
-VICIDIAL AD εσωτ.σύνδεση - Η προκαθορισμένη εσωτ.σύνδεση εάν δεν έχει οριστεί στην εκστρατεία για να στείλει τις κλήσεις στην διεργασία αυτόματης κλήσης. Η προκαθορισμένη είναι '8365' - -
-
-
-Προκαθορισμένο Περιεχόμενο - Το προκαθορισμένο περιεχόμενο του πλάνου κλήσεων για διεργασίες του διακομιστή. Το προκαθορισμένο είναι 'προκαθορισμένο' - - -



- -ΠΙΝΑΚΑΣ ΣΥΝΔΙΑΛΕΞΕΩΝ

-
-
-Αριθμός Συνδιάλεξης - Αυτό το πεδίο είναι για τον αριθμό συνδιάλεξης meetme στο σχέδιο κλήσεων. Επίσης, συνιστούμε ο αριθμός meetme στο meetme.conf να ταιριάζει με αυτό τον αριθμό για κάθε καταχώρηση. Αυτό είναι για τις συνδιαλέξε στο astGUIclient και χρησιμοποιείται για την λειτουργία αποχώρησης από κλήση με 3 γραμμές στο VICIDIAL. - -
-
-
-IP Διακομιστή- Ο κατάλογος που επιλέξατε τον διακομιστή ASTERISK όπου η συνδιάλεξη θα είναι. - - - - - - -







-







-ΤΕΛΟΣ -
- - - -ΣΥΣΤΗΜΑ ΚΛΗΣΕΩΝ: Διαχείριση - <? echo $process ?> - - - -
- - - - - - -
  ASTERISK ADMIN - Αποσύνδεση  
  ΛΙΣΤΑ ΤΗΛΕΦΩΝΩΝ | ΠΡΟΣΘΗΚΗ ΤΗΛΕΦΩΝΟΥ | ΑΝΑΖΗΤΗΣΗ ΤΗΛΕΦΩΝΟΥ | ΠΡΟΣΘΗΚΗ ΔΙΑΚΟΜΙΣΤΗ | ΛΙΣΤΑ ΔΙΑΚΟΜΙΣΤΩΝ
  ΕΜΦΑΝΙΣΗ ΣΥΝΔΙΑΛΕΞΕΩΝ | ΠΡΟΣΘΗΚΗ ΣΥΝΔΙΑΛΕΞΗΣ
-"; - -echo "
ΠΡΟΣΘΗΚΗ ΤΗΛΕΦΩΝΟΥ
\n"; -echo "\n"; -echo "
\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Τηλ.σύνδεσης τηλεφώνου: $NWB#phones-extension$NWE
Αριθμός Σχεδίου Κλήσεων: (μόνο αριθμοί)$NWB#phones-dialplan_number$NWE
Περιεχόμενο Φωνητικού Ταχυδρομείου: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
Εξερχόμενο CallerID: (μόνο αριθμοί)$NWB#phones-outbound_cid$NWE
Δνση IP Τηλεφώνου: (optional)$NWB#phones-phone_ip$NWE
Δνση IP Υπολογιστή: (optional)$NWB#phones-computer_ip$NWE
IP Διακομιστή: $NWB#phones-server_ip$NWE
Σύνδεση:$NWB#phones-login$NWE
Κωδικός:$NWB#phones-pass$NWE
Κατάσταση:$NWB#phones-status$NWE
Ενεργός Λογαριασμός: $NWB#phones-active$NWE
Τύπος τηλεφώνου: $NWB#phones-phone_type$NWE
Πλήρες Ονομα: $NWB#phones-fullname$NWE
Εταιρία:$NWB#phones-company$NWE
Εικόνα:$NWB#phones-picture$NWE
Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW SERVERS FORM SCREEN -###################### - -if ($ADD==11) -{ -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΔΙΑΚΟΜΙΣΤΗ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Διακομιστή: $NWB#servers-server_id$NWE
Περιγραφή Διακομιστή: $NWB#servers-server_description$NWE
Δνση IP Διακομιστή: $NWB#servers-server_ip$NWE
Ενεργή:$NWB#servers-active$NWE
Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW CONFERENCES FORM SCREEN -###################### - -if ($ADD==111) -{ -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΣΥΝΔΙΑΛΕΞΗΣ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Αριθμός Συνδιάλεξης: (μόνο αριθμοί)$NWB#conferences-conf_exten$NWE
IP Διακομιστή: $NWB#conferences-server_ip$NWE
\n"; - -} - - -###################### -# ADD=2 adds the new phone to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένα τηλέφωνο με αυτή την εσωτ.σύνδεση/διακομιστή\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n";} - else - { - echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΠΡΟΣΤΕΘΗΚΕ\n"; - - $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new server to the system -###################### - -if ($ADD==21) -{ - echo ""; - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Ο ΔΙΑΚΟΜΙΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένας διακομιστής με αυτό το ID\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
Ο ΔΙΑΚΟΜΙΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n";} - else - { - echo "
Ο ΔΙΑΚΟΜΙΣΤΗΣ ΠΡΟΣΤΕΘΗΚΕ\n"; - - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new conference to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Η ΣΥΝΔΙΑΛΕΞΗ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη μία συνδιάλεξη με αυτό το ID και διακομιστή\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
Η ΣΥΝΔΙΑΛΕΞΗ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n";} - else - { - echo "
Η ΣΥΝΔΙΑΛΕΞΗ ΠΡΟΣΤΕΘΗΚΕ\n"; - - $stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=100; -} - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of phone -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGdelete_phones < 1) ) - { - echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
IP Διακομιστή be at least 7 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΤΗΛΕΦΩΝΟΥ: $extension - $server_ip\n"; - echo "

Χτυπήστε εδώ για να διαγράψετε το τηλέφωνο $extension - $server_ip


\n"; - } - -$ADD='3'; # go to phone modification below -} - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete phone record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGdelete_phones < 1) ) - { - echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
IP Διακομιστή be at least 7 characters in length\n"; - } - else - { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } - echo "
Η ΔΙΑΓΡΑΦΗ ΤΟΥ ΤΗΛΕΦΩΝΟΥ ΟΛΟΚΛΗΡΩΘΗΚΕ: $extension - $server_ip\n"; - echo "

\n"; - } - -$ADD='0'; # go to phone list -} - - - - - - -###################### -# ADD=3 modify phone info in the system -###################### - -if ($ADD==3) -{ - echo ""; - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΤΗΛΕΦΩΝΟΥ: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Τηλ.σύνδεσης τηλεφώνου: $NWB#phones-extension$NWE
Αριθμός Σχεδίου Κλήσεων: (μόνο αριθμοί)$NWB#phones-dialplan_number$NWE
Περιεχόμενο Φωνητικού Ταχυδρομείου: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
Εξερχόμενο CallerID: (μόνο αριθμοί)$NWB#phones-outbound_cid$NWE
Δνση IP Τηλεφώνου: (optional)$NWB#phones-phone_ip$NWE
Δνση IP Υπολογιστή: (optional)$NWB#phones-computer_ip$NWE
IP Διακομιστή: $NWB#phones-server_ip$NWE
Σύνδεση:$NWB#phones-login$NWE
Κωδικός:$NWB#phones-pass$NWE
Κατάσταση:$NWB#phones-status$NWE
Ενεργός Λογαριασμός: $NWB#phones-active$NWE
Τύπος τηλεφώνου: $NWB#phones-phone_type$NWE
Πλήρες Ονομα: $NWB#phones-fullname$NWE
Εταιρία:$NWB#phones-company$NWE
Εικόνα:$NWB#phones-picture$NWE
Νέα Μηνύματα: $row[14]$NWB#phones-messages$NWE
Παλαιά Μηνύματα: $row[15]$NWB#phones-old_messages$NWE
Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
Διαχειριστή Σύνδεση: $NWB#phones-ASTmgrUSERNAME$NWE
Κωδικός Διαχειριστή: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Προκαθορισμένος Χρήστης: $NWB#phones-login_user$NWE
VICIDIAL Προκαθορισμένος Κωδικός: $NWB#phones-login_pass$NWE
VICIDIAL Προκαθορισμένη εκστρατεία: $NWB#phones-login_campaign$NWE
Τηλ.σύνδ. Στάθμευσης: $NWB#phones-park_on_extension$NWE
Τηλ.σύνδ. Συνδ.: $NWB#phones-conf_on_extension$NWE
VICIDIAL Τηλ.σύνδ. Στάθμευσης: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Αρχείο Στάθμευσης: $NWB#phones-VICIDIAL_park_on_filename$NWE
Πρόθεμα Παρακολούθησης: $NWB#phones-monitor_prefix$NWE
Ηχογράφηση εσωτ.σύνδ.: $NWB#phones-recording_exten$NWE
VMailMain Τηλ.σύνδ.: $NWB#phones-voicemail_exten$NWE
VMailDump Τηλ.σύνδ.: $NWB#phones-voicemail_dump_exten$NWE
Περιεχόμενο Τηλ.σύνδ: $NWB#phones-ext_context$NWE
DTMFSend Κανάλι: $NWB#phones-dtmf_send_extension$NWE
Ομάδα Εξερχομένων Κλήσεων: $NWB#phones-call_out_number_group$NWE
Θέση Φυλλομετρητή: $NWB#phones-client_browser$NWE
Κατάλογος εγκατάστασης: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Προκαθορισμένο URL: $NWB#phones-VICIDIAL_web_URL$NWE
Καταγραφή Γεγονότος Κλήσης: $NWB#phones-AGI_call_logging_enabled$NWE
Μεταγωγή Χρήστη: $NWB#phones-user_switching_enabled$NWE
Σε συνδιαλέξη: $NWB#phones-conferencing_enabled$NWE
Διαχειριστού Κλείσιμο: $NWB#phones-admin_hangup_enabled$NWE
Διαχειριστού Κλέψιμο: $NWB#phones-admin_hijack_enabled$NWE
Διαχειριστού Παρακολούθηση: $NWB#phones-admin_monitor_enabled$NWE
Στάθμευση Κλήσης: $NWB#phones-call_parking_enabled$NWE
Ελεγχος ενημερωτή: $NWB#phones-updater_check_enabled$NWE
AF Καταγραφή Γεγονότος: $NWB#phones-AFLogging_enabled$NWE
Ενεργή Ουρά: $NWB#phones-QUEUE_ACTION_enabled$NWE
Υπερεμφανιζόμενο παραθύρο CallerID: $NWB#phones-CallerID_popup_enabled$NWE
Πλήκτρο VMail: $NWB#phones-voicemail_button_enabled$NWE
Ταχύτητα Ανανέωσης: $NWB#phones-enable_fast_refresh$NWE
Ρυθμός Ανανέωσης Ταχύτητας: (in ms)$NWB#phones-fast_refresh_rate$NWE
Συνεχής MySQL: $NWB#phones-enable_persistant_mysql$NWE
Αυτόματη Κλήση Επόμενου Αριθμού: $NWB#phones-auto_dial_next_number$NWE
Σταμάτα την ηχογράφηση μετά από κάθε κλήση: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Διακομιστής: (Πρωταρχικό DB Server)$NWB#phones-DBX_server$NWE
DBX Βάση Δεδομένων: (Πρωταρχικό Server Database)$NWB#phones-DBX_database$NWE
DBX Χρήστης: (Πρωταρχικό DB Login)$NWB#phones-DBX_user$NWE
DBX Κωδικός: (Πρωταρχικό DB Secret)$NWB#phones-DBX_pass$NWE
DBX Πόρτα: (Πρωταρχικό DB Port)$NWB#phones-DBX_port$NWE
DBY Διακομιστής: (ΔευτερεύονDB Server)$NWB#phones-DBY_server$NWE
DBY Βάση Δεδομένων: (ΔευτερεύονServer Database)$NWB#phones-DBY_database$NWE
DBY Χρήστης: (ΔευτερεύονDB Login)$NWB#phones-DBY_user$NWE
DBY Κωδικός: (ΔευτερεύονDB Secret)$NWB#phones-DBY_pass$NWE
DBY Πόρτα: (ΔευτερεύονDB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Επιλέξτε εδώ για στατιστικά τηλεφώνου\n"; - -if ($LOGdelete_phones > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΟ ΤΟ ΤΗΛΕΦΩΝΟ\n"; - } - -} - - -###################### -# ADD=31 modify server info in the system -###################### - -if ($ADD==31) -{ - echo ""; - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΔΙΑΚΟΜΙΣΤΗ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Διακομιστή: $NWB#servers-server_id$NWE
Περιγραφή Διακομιστή: $NWB#servers-server_description$NWE
Δνση IP Διακομιστή: $NWB#servers-server_ip$NWE
Ενεργή:$NWB#servers-active$NWE
Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
Μέγιστος Αριθμός Trunk: $NWB#servers-max_vicidial_trunks$NWE
Λήπτης Telnet: $NWB#servers-telnet_host$NWE
Πόρτα Telnet: $NWB#servers-telnet_port$NWE
Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAME$NWE
Κωδικός Διαχειριστή: $NWB#servers-ASTmgrSECRET$NWE
Ενημέρωση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Παρακολούθηση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Αποστολή Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
VMail εσωτ.σύνδεση απόρριψης: $NWB#servers-voicemail_dump_exten$NWE
AD εσωτ.σύνδεση: $NWB#servers-answer_transfer_agent$NWE
Προκαθορισμένο Περιεχόμενο: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
ΤΗΛΕΦΩΝΑ ΣΤΟΝ ΔΙΑΚΟΜΙΣΤΗ:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ΤΗΛ.ΣΥΝΔΕΣΗΟΝΟΜΑΕΝΕΡΓΑ
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Αυτός ο διακομιστής έχει $active_lists ενεργά τηλέφωνα και $inactive_lists μη ενεργά τηλέφωνα

\n"; -echo "
\n"; -} - - -###################### -# ADD=311 modify conference info in the system -###################### - -if ($ADD==311) -{ - echo ""; - - $stmt="SELECT * from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΣΥΝΔΙΑΛΕΞΗΣ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Συνδιαλέξη:$NWB#conferences-conf_exten$NWE
IP Διακομιστή: $NWB#conferences-server_ip$NWE
Ισχύουσα εσωτ.σύνδεση:
\n"; - -echo "
\n"; - -} - - - -###################### -# ADD=4 submit phone modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) - {echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - υπάρχει ήδη ένα τηλέφωνο με αυτή την εσωτ.σύνδεση/διακομιστή\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n";} - else - { - echo "
ΤΟ ΤΗΛΕΦΩΝΟ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $extension\n"; - - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid' where extension='$old_extension' and server_ip='$old_server_ip';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΤΗΛΕΦΩΝΟΥ: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Τηλ.σύνδεσης τηλεφώνου: $NWB#phones-extension$NWE
Αριθμός Σχεδίου Κλήσεων: (μόνο αριθμοί)$NWB#phones-dialplan_number$NWE
Περιεχόμενο Φωνητικού Ταχυδρομείου: (μόνο αριθμοί)$NWB#phones-voicemail_id$NWE
Εξερχόμενο CallerID: (μόνο αριθμοί)$NWB#phones-outbound_cid$NWE
Δνση IP Τηλεφώνου: (optional)$NWB#phones-phone_ip$NWE
Δνση IP Υπολογιστή: (optional)$NWB#phones-computer_ip$NWE
IP Διακομιστή: $NWB#phones-server_ip$NWE
Σύνδεση:$NWB#phones-login$NWE
Κωδικός:$NWB#phones-pass$NWE
Κατάσταση:$NWB#phones-status$NWE
Ενεργός Λογαριασμός: $NWB#phones-active$NWE
Τύπος τηλεφώνου: $NWB#phones-phone_type$NWE
Πλήρες Ονομα: $NWB#phones-fullname$NWE
Εταιρία:$NWB#phones-company$NWE
Εικόνα:$NWB#phones-picture$NWE
Νέα Μηνύματα: $row[14]$NWB#phones-messages$NWE
Παλαιά Μηνύματα: $row[15]$NWB#phones-old_messages$NWE
Προτόκολο Πελάτη: $NWB#phones-protocol$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#phones-local_gmt$NWE
Διαχειριστή Σύνδεση: $NWB#phones-ASTmgrUSERNAME$NWE
Κωδικός Διαχειριστή: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Προκαθορισμένος Χρήστης: $NWB#phones-login_user$NWE
VICIDIAL Προκαθορισμένος Κωδικός: $NWB#phones-login_pass$NWE
VICIDIAL Προκαθορισμένη εκστρατεία: $NWB#phones-login_campaign$NWE
Τηλ.σύνδ. Στάθμευσης: $NWB#phones-park_on_extension$NWE
Τηλ.σύνδ. Συνδ.: $NWB#phones-conf_on_extension$NWE
VICIDIAL Τηλ.σύνδ. Στάθμευσης: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Αρχείο Στάθμευσης: $NWB#phones-VICIDIAL_park_on_filename$NWE
Πρόθεμα Παρακολούθησης: $NWB#phones-monitor_prefix$NWE
Ηχογράφηση εσωτ.σύνδ.: $NWB#phones-recording_exten$NWE
VMailMain Τηλ.σύνδ.: $NWB#phones-voicemail_exten$NWE
VMailDump Τηλ.σύνδ.: $NWB#phones-voicemail_dump_exten$NWE
Περιεχόμενο Τηλ.σύνδ: $NWB#phones-ext_context$NWE
DTMFSend Κανάλι: $NWB#phones-dtmf_send_extension$NWE
Ομάδα Εξερχομένων Κλήσεων: $NWB#phones-call_out_number_group$NWE
Θέση Φυλλομετρητή: $NWB#phones-client_browser$NWE
Κατάλογος εγκατάστασης: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Προκαθορισμένο URL: $NWB#phones-VICIDIAL_web_URL$NWE
Καταγραφή Γεγονότος Κλήσης: $NWB#phones-AGI_call_logging_enabled$NWE
Μεταγωγή Χρήστη: $NWB#phones-user_switching_enabled$NWE
Σε συνδιαλέξη: $NWB#phones-conferencing_enabled$NWE
Διαχειριστού Κλείσιμο: $NWB#phones-admin_hangup_enabled$NWE
Διαχειριστού Κλέψιμο: $NWB#phones-admin_hijack_enabled$NWE
Διαχειριστού Παρακολούθηση: $NWB#phones-admin_monitor_enabled$NWE
Στάθμευση Κλήσης: $NWB#phones-call_parking_enabled$NWE
Ελεγχος ενημερωτή: $NWB#phones-updater_check_enabled$NWE
AF Καταγραφή Γεγονότος: $NWB#phones-AFLogging_enabled$NWE
Ενεργή Ουρά: $NWB#phones-QUEUE_ACTION_enabled$NWE
Υπερεμφανιζόμενο παραθύρο CallerID: $NWB#phones-CallerID_popup_enabled$NWE
Πλήκτρο VMail: $NWB#phones-voicemail_button_enabled$NWE
Ταχύτητα Ανανέωσης: $NWB#phones-enable_fast_refresh$NWE
Ρυθμός Ανανέωσης Ταχύτητας: (in ms)$NWB#phones-fast_refresh_rate$NWE
Συνεχής MySQL: $NWB#phones-enable_persistant_mysql$NWE
Αυτόματη Κλήση Επόμενου Αριθμού: $NWB#phones-auto_dial_next_number$NWE
Σταμάτα την ηχογράφηση μετά από κάθε κλήση: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Διακομιστής: (Πρωταρχικό DB Server)$NWB#phones-DBX_server$NWE
DBX Βάση Δεδομένων: (Πρωταρχικό Server Database)$NWB#phones-DBX_database$NWE
DBX Χρήστης: (Πρωταρχικό DB Login)$NWB#phones-DBX_user$NWE
DBX Κωδικός: (Πρωταρχικό DB Secret)$NWB#phones-DBX_pass$NWE
DBX Πόρτα: (Πρωταρχικό DB Port)$NWB#phones-DBX_port$NWE
DBY Διακομιστής: (ΔευτερεύονDB Server)$NWB#phones-DBY_server$NWE
DBY Βάση Δεδομένων: (ΔευτερεύονServer Database)$NWB#phones-DBY_database$NWE
DBY Χρήστης: (ΔευτερεύονDB Login)$NWB#phones-DBY_user$NWE
DBY Κωδικός: (ΔευτερεύονDB Secret)$NWB#phones-DBY_pass$NWE
DBY Πόρτα: (ΔευτερεύονDB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Επιλέξτε εδώ για στατιστικά τηλεφώνου\n"; - -if ($LOGdelete_phones > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΟ ΤΟ ΤΗΛΕΦΩΝΟ\n"; - } - -} - -###################### -# ADD=41 submit server modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) - {echo "
ΔΙΑΚΟΜΙΣΤΗΣ NOT MODIFIED - there is already a server in the system with this server_id\n";} - else - { - $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) - {echo "
Ο ΔΙΑΚΟΜΙΣΤΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - υπάρχει ήδη ένας διακομιστής με αυτό το IP\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
Ο ΔΙΑΚΟΜΙΣΤΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n";} - else - { - echo "
Ο ΔΙΑΚΟΜΙΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $server_ip\n"; - - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; - $rslt=mysql_query($stmt, $link); - } - } - } - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΔΙΑΚΟΜΙΣΤΗ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Διακομιστή: $NWB#servers-server_id$NWE
Περιγραφή Διακομιστή: $NWB#servers-server_description$NWE
Δνση IP Διακομιστή: $NWB#servers-server_ip$NWE
Ενεργή:$NWB#servers-active$NWE
Εκδοση Asterisk: $NWB#servers-asterisk_version$NWE
Μέγιστος Αριθμός Trunk: $NWB#servers-max_vicidial_trunks$NWE
Λήπτης Telnet: $NWB#servers-telnet_host$NWE
Πόρτα Telnet: $NWB#servers-telnet_port$NWE
Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAME$NWE
Κωδικός Διαχειριστή: $NWB#servers-ASTmgrSECRET$NWE
Ενημέρωση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Παρακολούθηση Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Αποστολή Χρήστη Διαχειριστή: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Τοπικό GMT: (Μην ρυθμίσεις για DST)$NWB#servers-local_gmt$NWE
VMail εσωτ.σύνδεση απόρριψης: $NWB#servers-voicemail_dump_exten$NWE
AD εσωτ.σύνδεση: $NWB#servers-answer_transfer_agent$NWE
Προκαθορισμένο Περιεχόμενο: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
ΤΗΛΕΦΩΝΑ ΣΤΟΝ ΔΙΑΚΟΜΙΣΤΗ:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ΤΗΛ.ΣΥΝΔΕΣΗΟΝΟΜΑΕΝΕΡΓΑ
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Αυτός ο διακομιστής έχει $active_lists ενεργά τηλέφωνα και $inactive_lists μη ενεργά τηλέφωνα

\n"; -echo "
\n"; - -} - -###################### -# ADD=411 submit conference modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) - {echo "
Η ΣΥΝΔΙΑΛΕΞΗ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - υπάρχει ήδη μία συνδιάλεξη με αυτή την εσωτ.σύνδεση-διακομιστή\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
Η ΣΥΝΔΙΑΛΕΞΗ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n";} - else - { - echo "
Η ΣΥΝΔΙΑΛΕΞΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $conf_exten\n"; - - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from conferences where conf_exten='$conf_exten';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΣΥΝΔΙΑΛΕΞΗΣ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Συνδιαλέξη:$NWB#conferences-conf_exten$NWE
IP Διακομιστή: $NWB#conferences-server_ip$NWE
Ισχύουσα εσωτ.σύνδεση:
\n"; - -echo "
\n"; - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo ""; - -echo "
ΑΝΑΖΗΤΗΣΗ ΤΗΛΕΦΩΝΟΥ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Εσωτ.σύνδεση:
Πλήρες Ονομα:
Phone type:
\n"; - -} - -###################### -# ADD=66 phone search results -###################### - -if ($ADD==66) -{ - echo ""; - - $SQL = ''; - if ($extension) {$SQL .= "extension LIKE \"%$extension%\" and";} - if ($fullname) {$SQL .= "fullname LIKE \"%$fullname%\" and";} - if ($phone_type) {$SQL .= "phone_type LIKE \"%$phone_type%\" and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from phones $SQL order by extension,server_ip;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
ΑΝΑΖΗΤΗΣΗ ΑΠΟΤΕΛΕΣΜΑΤΩΝ:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ
\n"; - -} - - - -###################### -# ADD=0 display all active phones -###################### -if ($ADD==0) -{ - echo ""; - - $stmt="SELECT * from phones order by extension,server_ip"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
ΕΝΤΑΓΜΕΝΑ ΤΗΛΕΦΩΝΑ:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ
\n"; -} - -###################### -# ADD=10 display all servers -###################### -if ($ADD==10) -{ - echo ""; - - $stmt="SELECT * from servers order by server_id"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
ΕΝΤΑΓΜΕΝΟΙ ΔΙΑΚΟΜΙΣΤΕΣ:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[1] $row[2] $row[4] $row[3]  ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - -###################### -# ADD=100 display all conferences -###################### -if ($ADD==100) -{ - echo ""; - - $stmt="SELECT * from conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
ΕΝΤΑΓΜΕΝΕΣ ΣΥΝΔΙΑΛΕΞΕΙΣ:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]  ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds"; -echo "             ΕΚΔΟΣΗ: $version"; -echo "             ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient_el/dbconnect.php b/LANG_admin/astguiclient_el/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_admin/astguiclient_el/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_admin/astguiclient_el/help.gif b/LANG_admin/astguiclient_el/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/astguiclient_el/help.gif and /dev/null differ diff --git a/LANG_admin/astguiclient_el/inbound_popup.php b/LANG_admin/astguiclient_el/inbound_popup.php deleted file mode 100644 index 5c34ba2c..00000000 --- a/LANG_admin/astguiclient_el/inbound_popup.php +++ /dev/null @@ -1,228 +0,0 @@ - LICENSE: GPLv2 -### -# this is the inbound popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. -# -# changes: -# 60620-1329 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK ΑΠΟΜΑΚΡΥΣΜΕΝΟ ΕΙΣΕΡΧΟΜΕΝΟ: Υπερεμφανιζόμενο Παραθύρο - - -
- - 0) -{ - - $stmt="DELETE from parked_channels where server_ip='$user_server_ip' and parked_time='" . mysql_real_escape_string($parked_time) . "' and channel='" . mysql_real_escape_string($channel) . "' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$user_server_ip','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: " . mysql_real_escape_string($channel) . "','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Η εντολή ανακατεύθυνσης στάλθηκε για το κανάλι $channel       $NOW_TIME\n

\n"; - - - $url = 'https://10.10.10.15/internal/back_end_systems/cust_serv/index.php?Search=SEARCH&'; - $Suser = 'username='; - $Spass = '&passwd='; - $Sphone = '&phone='; - - $newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW$Sphone$phone"; - if ( ($phone == 'unknown') or (strlen($phone)<9) ) - {$newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW";} - - echo "Αναζήτηση του Πελάτη στο Σύστημα Εξυπηρέτησης Πελατών\n

\n"; - - echo "Κλείσε αυτό το παράθυρο\n

\n"; -} -else -{ - echo "Η εντολή ανακατεύθυνσης ΑΠΕΤΥΧΕ για το κανάλι $channel       $NOW_TIME\n

\n"; - echo "Κλείσε αυτό το παράθυρο\n

\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient_el/phone_stats.php b/LANG_admin/astguiclient_el/phone_stats.php deleted file mode 100644 index 133ce3cd..00000000 --- a/LANG_admin/astguiclient_el/phone_stats.php +++ /dev/null @@ -1,244 +0,0 @@ - LICENSE: GPLv2 -# -# -# changes: -# 60620-1333 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$admin_page = './admin.php'; - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname from phones where server_ip='$server_ip' and extension='$extension'"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $row[0]; - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK ADMIN: Στατιστικά Τηλεφώνου - - -
-
- - - - - - -\n"; -echo "
  ΣΥΣΤΗΜΑ ΚΛΗΣΕΩΝ: Διαχείριση  
  ΛΙΣΤΑ ΤΗΛΕΦΩΝΩΝ | ΠΡΟΣΘΗΚΗ ΤΗΛΕΦΩΝΟΥ | ΑΝΑΖΗΤΗΣΗ ΤΗΛΕΦΩΝΟΥ | ΠΡΟΣΘΗΚΗ ΔΙΑΚΟΜΙΣΤΗ | ΛΙΣΤΑ ΔΙΑΚΟΜΙΣΤΩΝ
  ΕΜΦΑΝΙΣΗ ΣΥΝΔΙΑΛΕΞΕΩΝ | ΠΡΟΣΘΗΚΗ ΣΥΝΔΙΑΛΕΞΗΣ
  \n"; - -echo "\n"; -echo "\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' group by channel_group order by channel_group"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - -echo "
\n"; - -echo "ΧΡΟΝΟΣ ΟΜΙΛΙΑΣ ΚΑΙ ΚΑΝΑΛΙΑ:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} -# echo "|$stmt|\n"; - -echo "\n"; -echo "
ΚΑΝΑΛΙ ΟΜΑΔΑΣ ΚΑΤΑΜΕΤΡΗΣΗ ΩΡΕΣ:ΛΕΠΤΑ
$row[1] $row[0] $call_hours_int:$call_minutes_int
ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "ΤΕΛΕΥΤΑΙΕΣ 1000 ΚΛΗΣΕΙΣ ΓΙΑ ΤΟ ΔΙΑΣΤΗΜΑ ΗΜΕΡΟΜΗΝΙΑΣ:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' LIMIT 1000"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - - - $call_seconds=0; - $o++; - } - - -echo "
ΑΡΙΘΜΟΣ ΚΑΝΑΛΙ ΟΜΑΔΑΣ ΗΜΕΡΑ LENGTH(MIN.)
$row[0] $row[1] $row[2] $row[3]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient_el/remote_inbound.php b/LANG_admin/astguiclient_el/remote_inbound.php deleted file mode 100644 index 4c44b1ad..00000000 --- a/LANG_admin/astguiclient_el/remote_inbound.php +++ /dev/null @@ -1,162 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]; if (!$ΕΠΙΒΕΒΑΙΩΣΗ) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - echo"\n"; - echo"ASTERISK ΑΠΟΜΑΚΡΥΣΜΕΝΟ ΕΙΣΕΡΧΟΜΕΝΟ: Κύριο\n"; - echo"\n"; - echo"\n"; - echo"\n"; - -?> - - -
- -
\n"; - -echo "Πατήστε στο κανάλι παρακάτω, που θα επιθυμούσατε να έχετε κατευθύνει στο τηλέφωνό σας

\n"; - -echo "
\n";
-echo "CHANNEL    ΔΙΑΚΟΜΙΣΤΗΣ        CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME        \n";
-echo "----------------------------------------------------------------------------------------------\n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='$user_server_ip' order by parked_time";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='$user_server_ip' and channel_group LIKE \"IN_%\" order by parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$extension =		sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		echo "$channel$server$channel_group$extension$parked_by$parked_time\n";
-
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "*************************************** NO PARKED CALLS **************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient_en/AST_inboundEXTstats.php b/LANG_admin/astguiclient_en/AST_inboundEXTstats.php deleted file mode 100644 index 28c5b20d..00000000 --- a/LANG_admin/astguiclient_en/AST_inboundEXTstats.php +++ /dev/null @@ -1,400 +0,0 @@ - LICENSE: GPLv2 -# -# CHANGES -# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.11.20';} - -$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$inbound_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $inbound_to_print) - { - $row=mysql_fetch_row($rslt); - $inbound[$i] =$row[0]; - $fullnum[$i] =$row[1]; - $inbname[$i] =$row[2]; - $i++; - } -?> - - - - - -\n"; -#echo"\n"; -echo "ASTERISK: Inbound Calls Stats\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A NUMBER AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "ASTERISK: Inbound Calls Stats                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
-if (eregi("\*",$group))
-	{$extenSQL = "and extension LIKE \"%$group\"";}
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls That came into this number:       $TOTALcalls\n";
-echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-if ($row[0])
-	{
-	$average_hold_seconds = ($row[1] / $row[0]);
-	$average_hold_seconds = round($average_hold_seconds, 0);
-	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-	}
-else {$DROPpercent=0;   $average_hold_seconds=0;}
-echo "Total DROP Calls:   (less than 10 seconds)    $DROPcalls  $DROPpercent%\n";
-echo "Average Call Length(seconds) for DROP Calls:  $average_hold_seconds\n";
-
-
-##############################
-#########  CALLS STATS
-
-echo "\n";
-echo "---------- CALL LISTINGS\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-echo "| CALLERID             | CALLERIDNAME         | LENGTH | DATE TIME           |\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$CID =			sprintf("%-20s", $row[0]);
-	$CIDname =		sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$datetime =		sprintf("%-19s", $row[3]);
-	$USERavgTALK =	$row[2];
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
-
-	$i++;
-	}
-
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-##############################
-#########  TIME STATS
-
-if ($output == 'FULL')
-	{
-
-	echo "\n";
-	echo "---------- TIME STATS\n";
-
-	echo "\n";
-
-	$hi_hour_count=0;
-	$last_full_record=0;
-	$i=0;
-	$h=0;
-	while ($i <= 96)
-		{
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-		$h++;
-		}
-
-	$hour_multiplier = (100 / $hi_hour_count);
-	#$hour_multiplier = round($hour_multiplier, 0);
-
-	echo "\n";
-	echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS\n";
-
-	$k=1;
-	$Mk=0;
-	$call_scale = '0';
-	while ($k <= 102) 
-		{
-		if ($Mk >= 5) 
-			{
-			$Mk=0;
-			$scale_num=($k / $hour_multiplier);
-			$scale_num = round($scale_num, 0);
-			$LENscale_num = (strlen($scale_num));
-			$k = ($k + $LENscale_num);
-			$call_scale .= "$scale_num";
-			}
-		else
-			{
-			$call_scale .= " ";
-			$k++;   $Mk++;
-			}
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-	#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-	echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-	$ZZ = '00';
-	$i=0;
-	$h=4;
-	$hour= -1;
-	$no_lines_yet=1;
-
-	while ($i <= 96)
-		{
-		$char_counter=0;
-		$time = '      ';
-		if ($h >= 4) 
-			{
-			$hour++;
-			$h=0;
-			if ($hour < 10) {$hour = "0$hour";}
-			$time = "+$hour$ZZ+";
-			}
-		if ($h == 1) {$time = "   15 ";}
-		if ($h == 2) {$time = "   30 ";}
-		if ($h == 3) {$time = "   45 ";}
-		$Ghour_count = $hour_count[$i];
-		if ($Ghour_count < 1) 
-			{
-			if ( ($no_lines_yet) or ($i > $last_full_record) )
-				{
-				$do_nothing=1;
-				}
-			else
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				echo "|$time|";
-				$k=0;   while ($k <= 102) {echo " ";   $k++;}
-				echo "| $hour_count[$i] |\n";
-				}
-			}
-		else
-			{
-			$no_lines_yet=0;
-			$Xhour_count = ($Ghour_count * $hour_multiplier);
-			$Yhour_count = (99 - $Xhour_count);
-
-			$Gdrop_count = $drop_count[$i];
-			if ($Gdrop_count < 1) 
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "*X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 101) {echo " ";   $char_counter++;}
-				echo "| 0     | $hour_count[$i] |\n";
-
-				}
-			else
-				{
-				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-				echo "D";   $char_counter++;
-				$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 102) {echo " ";   $char_counter++;}
-				echo "| $drop_count[$i] | $hour_count[$i] |\n";
-				}
-			}
-		
-		
-		$i++;
-		$h++;
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-	}
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/astguiclient_en/admin.php b/LANG_admin/astguiclient_en/admin.php deleted file mode 100644 index 654e9f12..00000000 --- a/LANG_admin/astguiclient_en/admin.php +++ /dev/null @@ -1,1824 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI database administration -# -# CHANGES -# 50913-1118 - Added outbound_cid for web-client calls -# 50926-1356 - Modified to allow for language translation -# 50926-1613 - Added WeBRooTWritablE write controls -# 51128-1254 - Modified to allow PHP global vars off -# 51208-2120 - Added option to login with vicidial_user login if allowed -# 51213-1650 - Added option to delete phones if allowed by vicidial_users -# 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1137 - Fixed phone search bug -# 60620-1243 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '1.1.12'; -$build = '60620-1243'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_id"])) {$server_id=$_GET["server_id"];} - elseif (isset($_POST["server_id"])) {$server_id=$_POST["server_id"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} - elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} -if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} - elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} -if (isset($_GET["computer_ip"])) {$computer_ip=$_GET["computer_ip"];} - elseif (isset($_POST["computer_ip"])) {$computer_ip=$_POST["computer_ip"];} -if (isset($_GET["login"])) {$login=$_GET["login"];} - elseif (isset($_POST["login"])) {$login=$_POST["login"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["phone_type"])) {$phone_type=$_GET["phone_type"];} - elseif (isset($_POST["phone_type"])) {$phone_type=$_POST["phone_type"];} -if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} - elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} -if (isset($_GET["company"])) {$company=$_GET["company"];} - elseif (isset($_POST["company"])) {$company=$_POST["company"];} -if (isset($_GET["picture"])) {$picture=$_GET["picture"];} - elseif (isset($_POST["picture"])) {$picture=$_POST["picture"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} - elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} -if (isset($_GET["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"];} - elseif (isset($_POST["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];} -if (isset($_GET["ASTmgrSECRET"])) {$ASTmgrSECRET=$_GET["ASTmgrSECRET"];} - elseif (isset($_POST["ASTmgrSECRET"])) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];} -if (isset($_GET["login_user"])) {$login_user=$_GET["login_user"];} - elseif (isset($_POST["login_user"])) {$login_user=$_POST["login_user"];} -if (isset($_GET["login_pass"])) {$login_pass=$_GET["login_pass"];} - elseif (isset($_POST["login_pass"])) {$login_pass=$_POST["login_pass"];} -if (isset($_GET["login_campaign"])) {$login_campaign=$_GET["login_campaign"];} - elseif (isset($_POST["login_campaign"])) {$login_campaign=$_POST["login_campaign"];} -if (isset($_GET["park_on_extension"])) {$park_on_extension=$_GET["park_on_extension"];} - elseif (isset($_POST["park_on_extension"])) {$park_on_extension=$_POST["park_on_extension"];} -if (isset($_GET["conf_on_extension"])) {$conf_on_extension=$_GET["conf_on_extension"];} - elseif (isset($_POST["conf_on_extension"])) {$conf_on_extension=$_POST["conf_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"];} - elseif (isset($_POST["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"];} - elseif (isset($_POST["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];} -if (isset($_GET["monitor_prefix"])) {$monitor_prefix=$_GET["monitor_prefix"];} - elseif (isset($_POST["monitor_prefix"])) {$monitor_prefix=$_POST["monitor_prefix"];} -if (isset($_GET["recording_exten"])) {$recording_exten=$_GET["recording_exten"];} - elseif (isset($_POST["recording_exten"])) {$recording_exten=$_POST["recording_exten"];} -if (isset($_GET["voicemail_exten"])) {$voicemail_exten=$_GET["voicemail_exten"];} - elseif (isset($_POST["voicemail_exten"])) {$voicemail_exten=$_POST["voicemail_exten"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["dtmf_send_extension"])) {$dtmf_send_extension=$_GET["dtmf_send_extension"];} - elseif (isset($_POST["dtmf_send_extension"])) {$dtmf_send_extension=$_POST["dtmf_send_extension"];} -if (isset($_GET["call_out_number_group"])) {$call_out_number_group=$_GET["call_out_number_group"];} - elseif (isset($_POST["call_out_number_group"])) {$call_out_number_group=$_POST["call_out_number_group"];} -if (isset($_GET["client_browser"])) {$client_browser=$_GET["client_browser"];} - elseif (isset($_POST["client_browser"])) {$client_browser=$_POST["client_browser"];} -if (isset($_GET["install_directory"])) {$install_directory=$_GET["install_directory"];} - elseif (isset($_POST["install_directory"])) {$install_directory=$_POST["install_directory"];} -if (isset($_GET["local_web_callerID_URL"])) {$local_web_callerID_URL=$_GET["local_web_callerID_URL"];} - elseif (isset($_POST["local_web_callerID_URL"])) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];} -if (isset($_GET["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"];} - elseif (isset($_POST["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];} -if (isset($_GET["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"];} - elseif (isset($_POST["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];} -if (isset($_GET["user_switching_enabled"])) {$user_switching_enabled=$_GET["user_switching_enabled"];} - elseif (isset($_POST["user_switching_enabled"])) {$user_switching_enabled=$_POST["user_switching_enabled"];} -if (isset($_GET["conferencing_enabled"])) {$conferencing_enabled=$_GET["conferencing_enabled"];} - elseif (isset($_POST["conferencing_enabled"])) {$conferencing_enabled=$_POST["conferencing_enabled"];} -if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} - elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} -if (isset($_GET["admin_hijack_enabled"])) {$admin_hijack_enabled=$_GET["admin_hijack_enabled"];} - elseif (isset($_POST["admin_hijack_enabled"])) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];} -if (isset($_GET["admin_monitor_enabled"])) {$admin_monitor_enabled=$_GET["admin_monitor_enabled"];} - elseif (isset($_POST["admin_monitor_enabled"])) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];} -if (isset($_GET["call_parking_enabled"])) {$call_parking_enabled=$_GET["call_parking_enabled"];} - elseif (isset($_POST["call_parking_enabled"])) {$call_parking_enabled=$_POST["call_parking_enabled"];} -if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["updater_check_enabled"];} - elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];} -if (isset($_GET["AFLogging_enabled"])) {$AFLogging_enabled=$_GET["AFLogging_enabled"];} - elseif (isset($_POST["AFLogging_enabled"])) {$AFLogging_enabled=$_POST["AFLogging_enabled"];} -if (isset($_GET["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"];} - elseif (isset($_POST["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];} -if (isset($_GET["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"];} - elseif (isset($_POST["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];} -if (isset($_GET["voicemail_button_enabled"])) {$voicemail_button_enabled=$_GET["voicemail_button_enabled"];} - elseif (isset($_POST["voicemail_button_enabled"])) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];} -if (isset($_GET["enable_fast_refresh"])) {$enable_fast_refresh=$_GET["enable_fast_refresh"];} - elseif (isset($_POST["enable_fast_refresh"])) {$enable_fast_refresh=$_POST["enable_fast_refresh"];} -if (isset($_GET["fast_refresh_rate"])) {$fast_refresh_rate=$_GET["fast_refresh_rate"];} - elseif (isset($_POST["fast_refresh_rate"])) {$fast_refresh_rate=$_POST["fast_refresh_rate"];} -if (isset($_GET["enable_persistant_mysql"])) {$enable_persistant_mysql=$_GET["enable_persistant_mysql"];} - elseif (isset($_POST["enable_persistant_mysql"])) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];} -if (isset($_GET["auto_dial_next_number"])) {$auto_dial_next_number=$_GET["auto_dial_next_number"];} - elseif (isset($_POST["auto_dial_next_number"])) {$auto_dial_next_number=$_POST["auto_dial_next_number"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["DBX_server"])) {$DBX_server=$_GET["DBX_server"];} - elseif (isset($_POST["DBX_server"])) {$DBX_server=$_POST["DBX_server"];} -if (isset($_GET["DBX_database"])) {$DBX_database=$_GET["DBX_database"];} - elseif (isset($_POST["DBX_database"])) {$DBX_database=$_POST["DBX_database"];} -if (isset($_GET["DBX_user"])) {$DBX_user=$_GET["DBX_user"];} - elseif (isset($_POST["DBX_user"])) {$DBX_user=$_POST["DBX_user"];} -if (isset($_GET["DBX_pass"])) {$DBX_pass=$_GET["DBX_pass"];} - elseif (isset($_POST["DBX_pass"])) {$DBX_pass=$_POST["DBX_pass"];} -if (isset($_GET["DBX_port"])) {$DBX_port=$_GET["DBX_port"];} - elseif (isset($_POST["DBX_port"])) {$DBX_port=$_POST["DBX_port"];} -if (isset($_GET["DBY_server"])) {$DBY_server=$_GET["DBY_server"];} - elseif (isset($_POST["DBY_server"])) {$DBY_server=$_POST["DBY_server"];} -if (isset($_GET["DBY_database"])) {$DBY_database=$_GET["DBY_database"];} - elseif (isset($_POST["DBY_database"])) {$DBY_database=$_POST["DBY_database"];} -if (isset($_GET["DBY_user"])) {$DBY_user=$_GET["DBY_user"];} - elseif (isset($_POST["DBY_user"])) {$DBY_user=$_POST["DBY_user"];} -if (isset($_GET["DBY_pass"])) {$DBY_pass=$_GET["DBY_pass"];} - elseif (isset($_POST["DBY_pass"])) {$DBY_pass=$_POST["DBY_pass"];} -if (isset($_GET["DBY_port"])) {$DBY_port=$_GET["DBY_port"];} - elseif (isset($_POST["DBY_port"])) {$DBY_port=$_POST["DBY_port"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["old_extension"])) {$old_extension=$_GET["old_extension"];} - elseif (isset($_POST["old_extension"])) {$old_extension=$_POST["old_extension"];} -if (isset($_GET["old_server_ip"])) {$old_server_ip=$_GET["old_server_ip"];} - elseif (isset($_POST["old_server_ip"])) {$old_server_ip=$_POST["old_server_ip"];} -if (isset($_GET["old_server_id"])) {$old_server_id=$_GET["old_server_id"];} - elseif (isset($_POST["old_server_id"])) {$old_server_id=$_POST["old_server_id"];} -if (isset($_GET["server_description"])) {$server_description=$_GET["server_description"];} - elseif (isset($_POST["server_description"])) {$server_description=$_POST["server_description"];} -if (isset($_GET["asterisk_version"])) {$asterisk_version=$_GET["asterisk_version"];} - elseif (isset($_POST["asterisk_version"])) {$asterisk_version=$_POST["asterisk_version"];} -if (isset($_GET["max_vicidial_trunks"])) {$max_vicidial_trunks=$_GET["max_vicidial_trunks"];} - elseif (isset($_POST["max_vicidial_trunks"])) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];} -if (isset($_GET["telnet_host"])) {$telnet_host=$_GET["telnet_host"];} - elseif (isset($_POST["telnet_host"])) {$telnet_host=$_POST["telnet_host"];} -if (isset($_GET["telnet_port"])) {$telnet_port=$_GET["telnet_port"];} - elseif (isset($_POST["telnet_port"])) {$telnet_port=$_POST["telnet_port"];} -if (isset($_GET["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"];} - elseif (isset($_POST["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];} -if (isset($_GET["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"];} - elseif (isset($_POST["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];} -if (isset($_GET["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"];} - elseif (isset($_POST["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];} -if (isset($_GET["answer_transfer_agent"])) {$answer_transfer_agent=$_GET["answer_transfer_agent"];} - elseif (isset($_POST["answer_transfer_agent"])) {$answer_transfer_agent=$_POST["answer_transfer_agent"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["old_conf_exten"])) {$old_conf_exten=$_GET["old_conf_exten"];} - elseif (isset($_POST["old_conf_exten"])) {$old_conf_exten=$_POST["old_conf_exten"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS and Dots -$phone_ip = ereg_replace("[^\.0-9]","",$phone_ip); -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$old_server_ip = ereg_replace("[^\.0-9]","",$old_server_ip); -$computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); - -### DIGITS ONLY ### -$dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); -$voicemail_id = ereg_replace("[^0-9]","",$voicemail_id); -$outbound_cid = ereg_replace("[^0-9]","",$outbound_cid); -$VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); -$park_on_extension = ereg_replace("[^0-9]","",$park_on_extension); -$conf_on_extension = ereg_replace("[^0-9]","",$conf_on_extension); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$old_conf_exten = ereg_replace("[^0-9]","",$old_conf_exten); -$voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); -$voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); -$recording_exten = ereg_replace("[^0-9]","",$recording_exten); -$monitor_prefix = ereg_replace("[^0-9]","",$monitor_prefix); -$answer_transfer_agent = ereg_replace("[^0-9]","",$answer_transfer_agent); -$DBX_port = ereg_replace("[^0-9]","",$DBX_port); -$DBY_port = ereg_replace("[^0-9]","",$DBY_port); -$telnet_port = ereg_replace("[^0-9]","",$telnet_port); -$max_vicidial_trunks = ereg_replace("[^0-9]","",$max_vicidial_trunks); -$auto_dial_next_number = ereg_replace("[^0-9]","",$auto_dial_next_number); -$VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); -$enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); -$enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); -$user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); -$updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); -$QUEUE_ACTION_enabled = ereg_replace("[^0-9]","",$QUEUE_ACTION_enabled); -$conferencing_enabled = ereg_replace("[^0-9]","",$conferencing_enabled); -$voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); -$CallerID_popup_enabled = ereg_replace("[^0-9]","",$CallerID_popup_enabled); -$call_parking_enabled = ereg_replace("[^0-9]","",$call_parking_enabled); -$AGI_call_logging_enabled = ereg_replace("[^0-9]","",$AGI_call_logging_enabled); -$AFLogging_enabled = ereg_replace("[^0-9]","",$AFLogging_enabled); -$admin_monitor_enabled = ereg_replace("[^0-9]","",$admin_monitor_enabled); -$admin_hijack_enabled = ereg_replace("[^0-9]","",$admin_hijack_enabled); -$admin_hangup_enabled = ereg_replace("[^0-9]","",$admin_hangup_enabled); -$fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); -$ADD = ereg_replace("[^0-9]","",$ADD); - -### ALPHA-NUMERIC and underscore and dash and slash and at and dot -$extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); -$old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); -$install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); -$client_browser = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$client_browser); -$dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); -$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); -$telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); -$DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); -$DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); - -### ALPHA-NUMERIC (and underscore and dash) -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$login = ereg_replace("[^-\_0-9a-zA-Z]","",$login); -$user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^-\_0-9a-zA-Z]","",$pass); -$status = ereg_replace("[^-\_0-9a-zA-Z]","",$status); -$protocol = ereg_replace("[^-\_0-9a-zA-Z]","",$protocol); -$ASTmgrUSERNAMEupdate = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEupdate); -$ASTmgrUSERNAMEsend = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEsend); -$ASTmgrUSERNAMElisten = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMElisten); -$ASTmgrUSERNAME = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAME); -$ASTmgrSECRET = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrSECRET); -$login_user = ereg_replace("[^-\_0-9a-zA-Z]","",$login_user); -$login_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$login_pass); -$login_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$login_campaign); -$DBX_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_user); -$DBY_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_user); -$DBX_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_pass); -$DBY_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_pass); -$DBX_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_database); -$DBY_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_database); -$VICIDIAL_park_on_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$VICIDIAL_park_on_filename); -$server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); -$old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); -$ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); -$CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); -$company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); -$picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); -$local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); -$server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); -$asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - -### VARIABLES TO BE mysql_real_escape_string ### -# $VICIDIAL_web_URL = -# $local_web_callerID_URL = - -##### END VARIABLE FILTERING FOR SECURITY ##### - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -if (!isset($ADD)) {$ADD=0;} - -$STARTtime = date("U"); -$STARTdate = date("Y-m-d H:i:s"); - -if ($ADD==1) {$process = 'ADD NEW PHONE';} -if ($ADD==11) {$process = 'ADD NEW SERVER';} -if ($ADD==111) {$process = 'ADD NEW CONFERENCE';} -if ($ADD==2) {$process = 'ADDING NEW PHONE';} -if ($ADD==21) {$process = 'ADDING NEW SERVER';} -if ($ADD==211) {$process = 'ADDING NEW CONFERENCE';} -if ($ADD==3) {$process = 'MODIFY PHONE';} -if ($ADD==31) {$process = 'MODIFY SERVER';} -if ($ADD==311) {$process = 'MODIFY CONFERENCE';} -if ($ADD==4) {$process = 'MODIFYING PHONE';} -if ($ADD==41) {$process = 'MODIFYING SERVER';} -if ($ADD==411) {$process = 'MODIFYING CONFERENCE';} -if ($ADD==5) {$process = 'DELETE PHONE';} -if ($ADD==6) {$process = 'DELETE PHONE';} -if ($ADD==55) {$process = 'SEARCH PHONES';} -if ($ADD==66) {$process = 'SEARCH PHONES RESULTS';} -if ($ADD==0) {$process = 'PHONE LIST';} -if ($ADD==10) {$process = 'SERVER LIST';} -if ($ADD==100) {$process = 'CONFERENCE LIST';} -if ($ADD==99999) {$process = 'HELP';} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if ($auth<1) - { - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > '6' and ast_admin_access='1';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGdelete_phones =$row[17]; - } - } - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - echo "|$stmt|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - if (strlen($LOGfullname) < 1) - { - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - } - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rsltx=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rsltx); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $servers_list .= "\n"; - $o++; - } - - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); - -$NWB = "   \"HELP\""; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "ASTERISK ADMIN: Administration - $process \n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
ASTERISK ADMIN: HELP


\n"; - -?> -PHONES TABLE

- -
-Phone extension - This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones make sure you use the full phones name: IAX2/IAXphone1@IAXphone1 would be IAXphone1@IAXphone1. For Zap phones make sure you put the full channel: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol below correctly for your type of phone. - -
-
-
-Dialplan number - This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server - -
-
-
-Voicemail Box - This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app. - -
-
-
-Outbound CallerID - This field is where you would enter the callerID number that you would like to appear on outbound calls placed form the astguiclient web-client. This does not work on RBS, non-PRI, T1/E1s. - -
-
-
-Phone IP address - This field is for the phone's IP address if it is a VOIP phone. This is an optional field - -
-
-
-Computer IP address - This field is for the user's computer IP address. This is an optional field - -
-
-
-Server IP - This menu is where you select which server the phone is active on. - -
-
-
-Login - The login used for the phone user to login to the client applications. - -
-
-
-Password - The password used for the phone user to login to the client applications. - -
-
-
-Status - The status of the phone in the system, ACTIVE and ADMIN allow for GUI clients to work. ADMIN allows access to this administrative web site. All other statuses do not allow GUI or Admin web access. - -
-
-
-Active Account - Whether the phone is active to put it in the list in the GUI client. - -
-
-
-Phone Type - Purely for administrative notes. - -
-
-
-Full Name - Used by the GUIclient in the list of active phones. - -
-
-
-Company - Purely for administrative notes. - -
-
-
-Picture - Not yet Implemented. - -
-
-
-New Messages - Number of new voicemail messages for this phone on the Asterisk server. - -
-
-
-Old Messages - Number of old voicemail messages for this phone on the Asterisk server. - -
-
-
-Client Protocol - The protocol that the phone uses to connect to the Asterisk server: SIP, IAX2, Zap . Also, there is EXTERNAL for remote dial numbers or speed dial numbers that you want to list as phones. - -
-
-
-Local GMT - The difference from Greenwich Mean time, or ZULU time where the phone is located. DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. This is used by the VICIDIAL campaign to accurately display the time and customer time. - -
-
-
-Manager Login - This is the login that the GUI clients for this phone will use to access the Database where the server data resides. - -
-
-
-Manager Secret - This is the password that the GUI clients for this phone will use to access the Database where the server data resides. - -
-
-
-VICIDIAL Default User - This is to place a default value in the VICIDIAL user field whenever this phone user opens the astVICIDIAL client app. Leave blank for no user. - -
-
-
-VICIDIAL Default Pass - This is to place a default value in the VICIDIAL password field whenever this phone user opens the astVICIDIAL client app. Leave blank for no pass. - -
-
-
-VICIDIAL Default Campaign - This is to place a default value in the VICIDIAL campaign field whenever this phone user opens the astVICIDIAL client app. Leave blank for no campaign. - -
-
-
-Park Exten - This is the default Parking extension for the client apps. Verify that a different one works before you change this. - -
-
-
-Conf Exten - This is the default Conference park extension for the client apps. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park Exten - This is the default Parking extension for VICIDIAL client app. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park File - This is the default VICIDIAL park extension file name for the client apps. Verify that a different one works before you change this. limited to 10 characters. - -
-
-
-Monitor Prefix - This is the dialplan prefix for monitoring of Zap channels automatically within the astGUIclient app. Only change according to the extensions.conf ZapBarge extensions records. - -
-
-
-Recording Exten - This is the dialplan extension for the recording extension that is used to drop into meetme conferences to record them. It usually lasts upto one hour if not stopped. verify with extensions.conf file before changing. - -
-
-
-VMAIL Main Exten - This is the dialplan extension going to check your voicemail. verify with extensions.conf file before changing. - -
-
-
-VMAIL Dump Exten - This is the dialplan prefix used to send calls directly to a user's voicemail from a live call in the astGUIclient app. verify with extensions.conf file before changing. - -
-
-
-Exten Context - This is the dialplan context that this phone primarily uses. It is assumed that all numbers dialed by the client apps are using this context so it is a good idea to make sure this is the most wide context possible. verify with extensions.conf file before changing. - -
-
-
-DTMF send Channel - This is the channel string used to send DTMF sounds into meetme conferences from the client apps. Verify the exten and context with the extensions.conf file. - -
-
-
-Outbound Call Group - This is the channel group that outbound calls from this phone are placed out of. There are a couple routines in the client apps that use this. For Zap channels you want to use something like Zap/g2 , for IAX2 trunks you would want to use the full IAX prefix like IAX2/VICItest1:secret@10.10.10.15:4569. Verify the trunks with the extensions.conf file, it is usually what you have defined as the TRUNK global variable at the top of the file. - -
-
-
-Browser Location - This is applicable to only UNIX/LINUX clients, the absolute path to Mozilla or Firefox browser on the machine. verify this by launching it manually. - -
-
-
-Install Directory - This is the place where the astGUIclient and astVICIDIAL scripts are located on your machine. For Win32 it should be something like C:\AST_VICI and for UNIX it should be something like /usr/local/perl_TK. verify this manually. - -
-
-
-CallerID URL - This is the web address of the page used to do custom callerID lookups. default testing address is: http://astguiclient.sf.net/test_callerid_output.php - -
-
-
-VICIDIAL Default URL - This is the web address of the page used to do custom VICIDIAL Web Form queries. default testing address is: http://astguiclient.sf.net/test_VICIDIAL_output.php - -
-
-
-Call Logging - This is set to true if the call_log.agi file is in place in the extensions.conf file for all outbound and hangup 'h' extensions to log all calls. This should always be 1 because it is manditory for many astGUIclient and VICIDIAL features to work properly. - -
-
-
-User Switching - Set to true to allow user to switch to another user account. NOTE: If user switches they can initiate recording on the new user's phone conversation - -
-
-
-Conferencing - Set to true to allow user to start conference calls with upto six external lines. - -
-
-
-Admin Hangup - Set to true to allow user to be able to hangup any line at will through astGUIclient. Good idea only to enable this for Admin users. - -
-
-
-Admin Hijack - Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers. - -
-
-
-Admin Monitor - Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers and as a training tool. - -
-
-
-Call Park - Set to true to allow user to be able to park calls on astGUIclient hold to be picked up by any other astGUIclient user on the system. Calls stay on hold for upto a half hour then hangup. Usually enabled for all. - -
-
-
-Updater Check - Set to true to display a popup warning that the updater time has not changed in 20 seconds. Useful for Admin users. - -
-
-
-AF Logging - Set to true to log many actions of astGUIclient usage to a text file on the user's computer. - -
-
-
-Queue Enabled - Set to true to have client apps use the Asterisk Central Queue system. Required for VICIDIAL and recommended for all users. - -
-
-
-CallerID Popup - Set to true to allow for numbers defined in the extensions.conf file to send CallerID popup screens to astGUIclient users. - -
-
-
-VMail Button - Set to true to display the VOICEMAIL button and the messages count display on astGUIclient. - -
-
-
-Fast Refresh - Set to true to enable a new rate of refresh of call information for the astGUIclient. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number. - -
-
-
-Fast Refresh Rate - in milliseconds. Only used if Fast Refresh is enabled. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number. - -
-
-
-Persistant MySQL - If enabled the astGUIclient connection will remain connected instead of connecting every second. Useful if you have a fast refresh rate set. It will increase the number of connections on your MySQL machine. - -
-
-
-Auto Dial Next Number - If enabled the VICIDIAL client will dial the next number on the list automatically upon disposition of a call unless they selected to "Stop Dialing" on the disposition screen. - -
-
-
-Stop Rec after each call - If enabled the VICIDIAL client will stop whatever recording is going on after each call has been dispositioned. Useful if you are doing a lot of recording or you are using a web form to trigger recording. - -
-
-
-DBX Server - The MySQL database server that this user should be connecting to. - -
-
-
-DBX Database - The MySQL database that this user should be connecting to. Default is asterisk. - -
-
-
-DBX User - The MySQL user login that this user should be using when connecting. Default is cron. - -
-
-
-DBX Pass - The MySQL user password that this user should be using when connecting. Default is 1234. - -
-
-
-DBX Port - The MySQL TCP port that this user should be using when connecting. Default is 3306. - -
-
-
-DBY Server - The MySQL database server that this user should be connecting to. Secondary server, not used currently. - -
-
-
-DBY Database - The MySQL database that this user should be connecting to. Default is asterisk. Secondary server, not used currently. - -
-
-
-DBY User - The MySQL user login that this user should be using when connecting. Default is cron. Secondary server, not used currently. - -
-
-
-DBY Pass - The MySQL user password that this user should be using when connecting. Default is 1234. Secondary server, not used currently. - -
-
-
-DBY Port - The MySQL TCP port that this user should be using when connecting. Default is 3306. Secondary server, not used currently. - - -



- -SERVERS TABLE

-
-
-Server ID - This field is where you put the Asterisk servers name, doesnt have to be an official domain sub, just a nickname to identify the server to Admin users. - -
-
-
-Server Description - The field where you use a small phrase to describe the Asterisk server. - -
-
-
-Server IP Address - The field where you put the Network IP address of the Asterisk server. - -
-
-
-Active - Set whether the Asterisk server is active or inactive. - -
-
-
-Asterisk Version - Set the version of Asterisk that you have installed on this server. Examples: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... This is used because versions 1.0.8 and 1.0.9 have a different method of dealing with Local/ channels, a bug that has been fixed in CVS v1.0, and need to be treated differently when handling their Local/ channels. Also, current CVS_HEAD and the 1.2 release tree uses different manager and command output so it must be treated differently as well. - -
-
-
-Max VICIDIAL Trunks - This field will determine the maximum number of lines that the VICIDIAL auto-dialer will attempt to call on this server. If you want to dedicate two full PRI T1s to VICIDIALing on a server then you would set this to 46. Default is 96. - -
-
-
-Telnet Host - This is the address or name of the Asterisk server and is how the manager applications connect to it from where they are running. If they are running on the Asterisk server, then the default of 'localhost' is fine. - -
-
-
-Telnet Port - This is the port of the Asterisk server Manager connection and is how the manager applications connect to it from where they are running. The default of '5038' is fine for a standard install. - -
-
-
-Manager User - The username or login used to connect genericly to the Asterisk server manager. Default is 'cron' - -
-
-
-Manager Secret - The secret or password used to connect genericly to the Asterisk server manager. Default is '1234' - -
-
-
-Manager Update User - The username or login used to connect to the Asterisk server manager optimized for the Update scripts. Default is 'updatecron' and assumes the same secret as the generic user. - -
-
-
-Manager Listen User - The username or login used to connect to the Asterisk server manager optimized for scripts that only listen for output. Default is 'listencron' and assumes the same secret as the generic user. - -
-
-
-Manager Send User - The username or login used to connect to the Asterisk server manager optimized for scripts that only send Actions to the manager. Default is 'sendcron' and assumes the same secret as the generic user. - -
-
-
-Server GMT offset - The difference in hours from GMT time not adjusted for Daylight-Savings-Time of the server. Default is '-5' - -
-
-
-VMail Dump Exten - The extension prefix used on this server to send calls directly through agc to a specific voicemail box. Default is '85026666666666' - -
-
-
-VICIDIAL AD extension - The default extension if none is present in the campaign to send calls to for VICIDIAL auto dialing. Default is '8365' - -
-
-
-Default Context - The default dialplan context used for scripts that operate for this server. Default is 'default' - - -



- -CONFERENCES TABLE

-
-
-Conference Number - This field is where you put the meetme conference dialpna number. It is also recommended that the meetme number in meetme.conf matches this number for each entry. This is for the conferences in astGUIclient and is used for leave-3way-call functionality in VICIDIAL. - -
-
-
-Server IP - The menu where you select the Asterisk server that this conference will be on. - - - - - - -







-







-THE END -
- - - -ASTERISK ADMIN: Administration - <? echo $process ?> - - - -
- - - - - - -
  ASTERISK ADMIN - Logout  
  LIST ALL PHONES | ADD A NEW PHONE | SEARCH FOR A PHONE | ADD A SERVER | LIST ALL SERVERS
  SHOW ALL CONFERENCES | ADD A NEW CONFERENCE
-"; - -echo "
ADD A NEW PHONE
\n"; -echo "\n"; -echo "
\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW SERVERS FORM SCREEN -###################### - -if ($ADD==11) -{ -echo ""; - -echo "
ADD A NEW SERVER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW CONFERENCES FORM SCREEN -###################### - -if ($ADD==111) -{ -echo ""; - -echo "
ADD A NEW CONFERENCE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\n"; - -} - - -###################### -# ADD=2 adds the new phone to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
PHONE NOT ADDED - there is already a Phone in the system with this extension/server\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
PHONE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
PHONE ADDED\n"; - - $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new server to the system -###################### - -if ($ADD==21) -{ - echo ""; - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SERVER NOT ADDED - there is already a server in the system with this ID\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVER NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
SERVER ADDED\n"; - - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new conference to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CONFERENCE NOT ADDED - there is already a conference in the system with this ID and server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
CONFERENCE ADDED\n"; - - $stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=100; -} - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of phone -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGdelete_phones < 1) ) - { - echo "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - echo "
PHONE DELETION CONFIRMATION: $extension - $server_ip\n"; - echo "

Click here to delete phone $extension - $server_ip


\n"; - } - -$ADD='3'; # go to phone modification below -} - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete phone record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGdelete_phones < 1) ) - { - echo "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } - echo "
PHONE DELETION COMPLETED: $extension - $server_ip\n"; - echo "

\n"; - } - -$ADD='0'; # go to phone list -} - - - - - - -###################### -# ADD=3 modify phone info in the system -###################### - -if ($ADD==3) -{ - echo ""; - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A PHONE RECORD: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
Old Messages: $row[15]$NWB#phones-old_messages$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
Manager Login: $NWB#phones-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Default User: $NWB#phones-login_user$NWE
VICIDIAL Default Pass: $NWB#phones-login_pass$NWE
VICIDIAL Default Campaign: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park File: $NWB#phones-VICIDIAL_park_on_filename$NWE
Monitor Prefix: $NWB#phones-monitor_prefix$NWE
Recording Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Context: $NWB#phones-ext_context$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
Browser Location: $NWB#phones-client_browser$NWE
Install Directory: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Default URL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
User Switching: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hangup: $NWB#phones-admin_hangup_enabled$NWE
Admin Hijack: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Call Park: $NWB#phones-call_parking_enabled$NWE
Updater Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Queue Enabled: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Button: $NWB#phones-voicemail_button_enabled$NWE
Fast Refresh: $NWB#phones-enable_fast_refresh$NWE
Fast Refresh Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Dial Next Number: $NWB#phones-auto_dial_next_number$NWE
Stop Rec after each call: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Server: (Primary DB Server)$NWB#phones-DBX_server$NWE
DBX Database: (Primary Server Database)$NWB#phones-DBX_database$NWE
DBX User: (Primary DB Login)$NWB#phones-DBX_user$NWE
DBX Pass: (Primary DB Secret)$NWB#phones-DBX_pass$NWE
DBX Port: (Primary DB Port)$NWB#phones-DBX_port$NWE
DBY Server: (Secondary DB Server)$NWB#phones-DBY_server$NWE
DBY Database: (Secondary Server Database)$NWB#phones-DBY_database$NWE
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Click here for phone stats\n"; - -if ($LOGdelete_phones > 0) - { - echo "

DELETE THIS PHONE\n"; - } - -} - - -###################### -# ADD=31 modify server info in the system -###################### - -if ($ADD==31) -{ - echo ""; - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A SERVER RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Max VICIDIAL Trunks: $NWB#servers-max_vicidial_trunks$NWE
Telnet Host: $NWB#servers-telnet_host$NWE
Telnet Port: $NWB#servers-telnet_port$NWE
Manager User: $NWB#servers-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#servers-ASTmgrSECRET$NWE
Manager Update User: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Listen User: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Send User: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL AD extension: $NWB#servers-answer_transfer_agent$NWE
Default Context: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
PHONES WITHIN THIS SERVER:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
EXTENSIONNAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This server has $active_lists active phones and $inactive_lists inactive phones

\n"; -echo "
\n"; -} - - -###################### -# ADD=311 modify conference info in the system -###################### - -if ($ADD==311) -{ - echo ""; - - $stmt="SELECT * from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A CONFERENCE RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; - -echo "
\n"; - -} - - - -###################### -# ADD=4 submit phone modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) - {echo "
PHONE NOT MODIFIED - there is already a Phone in the system with this extension/server\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
PHONE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
PHONE MODIFIED: $extension\n"; - - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid' where extension='$old_extension' and server_ip='$old_server_ip';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A PHONE RECORD: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
Old Messages: $row[15]$NWB#phones-old_messages$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
Manager Login: $NWB#phones-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Default User: $NWB#phones-login_user$NWE
VICIDIAL Default Pass: $NWB#phones-login_pass$NWE
VICIDIAL Default Campaign: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park File: $NWB#phones-VICIDIAL_park_on_filename$NWE
Monitor Prefix: $NWB#phones-monitor_prefix$NWE
Recording Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Context: $NWB#phones-ext_context$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
Browser Location: $NWB#phones-client_browser$NWE
Install Directory: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Default URL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
User Switching: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hangup: $NWB#phones-admin_hangup_enabled$NWE
Admin Hijack: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Call Park: $NWB#phones-call_parking_enabled$NWE
Updater Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Queue Enabled: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Button: $NWB#phones-voicemail_button_enabled$NWE
Fast Refresh: $NWB#phones-enable_fast_refresh$NWE
Fast Refresh Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Dial Next Number: $NWB#phones-auto_dial_next_number$NWE
Stop Rec after each call: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Server: (Primary DB Server)$NWB#phones-DBX_server$NWE
DBX Database: (Primary Server Database)$NWB#phones-DBX_database$NWE
DBX User: (Primary DB Login)$NWB#phones-DBX_user$NWE
DBX Pass: (Primary DB Secret)$NWB#phones-DBX_pass$NWE
DBX Port: (Primary DB Port)$NWB#phones-DBX_port$NWE
DBY Server: (Secondary DB Server)$NWB#phones-DBY_server$NWE
DBY Database: (Secondary Server Database)$NWB#phones-DBY_database$NWE
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Click here for phone stats\n"; - -if ($LOGdelete_phones > 0) - { - echo "

DELETE THIS PHONE\n"; - } - -} - -###################### -# ADD=41 submit server modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) - {echo "
SERVER NOT MODIFIED - there is already a server in the system with this server_id\n";} - else - { - $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) - {echo "
SERVER NOT MODIFIED - there is already a server in the system with this server_ip\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVER NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
SERVER MODIFIED: $server_ip\n"; - - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; - $rslt=mysql_query($stmt, $link); - } - } - } - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A SERVER RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Max VICIDIAL Trunks: $NWB#servers-max_vicidial_trunks$NWE
Telnet Host: $NWB#servers-telnet_host$NWE
Telnet Port: $NWB#servers-telnet_port$NWE
Manager User: $NWB#servers-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#servers-ASTmgrSECRET$NWE
Manager Update User: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Listen User: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Send User: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL AD extension: $NWB#servers-answer_transfer_agent$NWE
Default Context: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
PHONES WITHIN THIS SERVER:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
EXTENSIONNAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This server has $active_lists active phones and $inactive_lists inactive phones

\n"; -echo "
\n"; - -} - -###################### -# ADD=411 submit conference modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) - {echo "
CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
CONFERENCE MODIFIED: $conf_exten\n"; - - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from conferences where conf_exten='$conf_exten';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A CONFERENCE RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; - -echo "
\n"; - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo ""; - -echo "
SEARCH FOR A PHONE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
extension:
Full Name:
Phone type:
\n"; - -} - -###################### -# ADD=66 phone search results -###################### - -if ($ADD==66) -{ - echo ""; - - $SQL = ''; - if ($extension) {$SQL .= "extension LIKE \"%$extension%\" and";} - if ($fullname) {$SQL .= "fullname LIKE \"%$fullname%\" and";} - if ($phone_type) {$SQL .= "phone_type LIKE \"%$phone_type%\" and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from phones $SQL order by extension,server_ip;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
SEARCH RESULTS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFY | STATS
\n"; - -} - - - -###################### -# ADD=0 display all active phones -###################### -if ($ADD==0) -{ - echo ""; - - $stmt="SELECT * from phones order by extension,server_ip"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
PHONE LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFY | STATS
\n"; -} - -###################### -# ADD=10 display all servers -###################### -if ($ADD==10) -{ - echo ""; - - $stmt="SELECT * from servers order by server_id"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
SERVER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[1] $row[2] $row[4] $row[3]  MODIFY
\n"; -} - - -###################### -# ADD=100 display all conferences -###################### -if ($ADD==100) -{ - echo ""; - - $stmt="SELECT * from conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
CONFERENCE LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]  MODIFY
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; -echo "             VERSION: $version"; -echo "             BUILD: $build
\n"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient_en/dbconnect.php b/LANG_admin/astguiclient_en/dbconnect.php deleted file mode 100644 index fb6d5917..00000000 --- a/LANG_admin/astguiclient_en/dbconnect.php +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/LANG_admin/astguiclient_en/help.gif b/LANG_admin/astguiclient_en/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/astguiclient_en/help.gif and /dev/null differ diff --git a/LANG_admin/astguiclient_en/inbound_popup.php b/LANG_admin/astguiclient_en/inbound_popup.php deleted file mode 100644 index 6f451656..00000000 --- a/LANG_admin/astguiclient_en/inbound_popup.php +++ /dev/null @@ -1,228 +0,0 @@ - LICENSE: GPLv2 -### -# this is the inbound popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. -# -# changes: -# 60620-1329 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK REMOTE INBOUND: Popup - - -
- - 0) -{ - - $stmt="DELETE from parked_channels where server_ip='$user_server_ip' and parked_time='" . mysql_real_escape_string($parked_time) . "' and channel='" . mysql_real_escape_string($channel) . "' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$user_server_ip','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: " . mysql_real_escape_string($channel) . "','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for channel $channel       $NOW_TIME\n

\n"; - - - $url = 'https://10.10.10.15/internal/back_end_systems/cust_serv/index.php?Search=SEARCH&'; - $Suser = 'username='; - $Spass = '&passwd='; - $Sphone = '&phone='; - - $newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW$Sphone$phone"; - if ( ($phone == 'unknown') or (strlen($phone)<9) ) - {$newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW";} - - echo "Look up this customer in Customer Service System\n

\n"; - - echo "Close this window\n

\n"; -} -else -{ - echo "Redirect command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Close this window\n

\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient_en/phone_stats.php b/LANG_admin/astguiclient_en/phone_stats.php deleted file mode 100644 index 8498746a..00000000 --- a/LANG_admin/astguiclient_en/phone_stats.php +++ /dev/null @@ -1,244 +0,0 @@ - LICENSE: GPLv2 -# -# -# changes: -# 60620-1333 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$admin_page = './admin.php'; - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname from phones where server_ip='$server_ip' and extension='$extension'"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $row[0]; - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK ADMIN: Phone Stats - - -
-
- - - - - - -\n"; -echo "
  ASTERISK ADMIN: Administration  
  LIST ALL PHONES | ADD A NEW PHONE | SEARCH FOR A PHONE | ADD A SERVER | LIST ALL SERVERS
  SHOW ALL CONFERENCES | ADD A NEW CONFERENCE
  \n"; - -echo "\n"; -echo "\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' group by channel_group order by channel_group"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - -echo "
\n"; - -echo "CALL TIME AND CHANNELS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} -# echo "|$stmt|\n"; - -echo "\n"; -echo "
CHANNEL GROUP COUNT HOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LAST 1000 CALLS FOR DATE RANGE:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' LIMIT 1000"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - - - $call_seconds=0; - $o++; - } - - -echo "
NUMBER CHANNEL GROUP DATE LENGTH(MIN.)
$row[0] $row[1] $row[2] $row[3]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient_en/remote_inbound.php b/LANG_admin/astguiclient_en/remote_inbound.php deleted file mode 100644 index 06642677..00000000 --- a/LANG_admin/astguiclient_en/remote_inbound.php +++ /dev/null @@ -1,162 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - echo"\n"; - echo"ASTERISK REMOTE INBOUND: Main\n"; - echo"\n"; - echo"\n"; - echo"\n"; - -?> - - -
- -
\n"; - -echo "Click on the channel below that you would like to have directed to your phone

\n"; - -echo "
\n";
-echo "CHANNEL    SERVER        CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME        \n";
-echo "----------------------------------------------------------------------------------------------\n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='$user_server_ip' order by parked_time";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='$user_server_ip' and channel_group LIKE \"IN_%\" order by parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$extension =		sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		echo "$channel$server$channel_group$extension$parked_by$parked_time\n";
-
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "*************************************** NO PARKED CALLS **************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient_es/AST_inboundEXTstats.php b/LANG_admin/astguiclient_es/AST_inboundEXTstats.php deleted file mode 100644 index 0e39d450..00000000 --- a/LANG_admin/astguiclient_es/AST_inboundEXTstats.php +++ /dev/null @@ -1,400 +0,0 @@ - LICENSE: GPLv2 -# -# CHANGES -# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.11.20';} - -$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$inbound_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $inbound_to_print) - { - $row=mysql_fetch_row($rslt); - $inbound[$i] =$row[0]; - $fullnum[$i] =$row[1]; - $inbname[$i] =$row[2]; - $i++; - } -?> - - - - - -\n"; -#echo"\n"; -echo "ASTERISK: Estadística de Llamadas Entrantes\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "SELECCIONE POR FAVOR Un NÚMERO Y La FECHA ARRIBA Y El TECLEO SOMETEN\n";
-}
-
-else
-{
-
-
-echo "ASTERISK: Estadística de Llamadas Entrantes                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
-if (eregi("\*",$group))
-	{$extenSQL = "and extension LIKE \"%$group\"";}
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Llamadas totales que vinieron en este número:       $TOTALcalls\n";
-echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-if ($row[0])
-	{
-	$average_hold_seconds = ($row[1] / $row[0]);
-	$average_hold_seconds = round($average_hold_seconds, 0);
-	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-	}
-else {$DROPpercent=0;   $average_hold_seconds=0;}
-echo "Total DROP Calls:   (less than 10 seconds)    $DROPcalls  $DROPpercent%\n";
-echo "Average Call Length(seconds) for DROP Calls:  $average_hold_seconds\n";
-
-
-##############################
-#########  CALLS STATS
-
-echo "\n";
-echo "---------- CALL LISTINGS\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-echo "| CALLERID             | CALLERIDNAME         | LENGTH | DATE TIME           |\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$CID =			sprintf("%-20s", $row[0]);
-	$CIDname =		sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$datetime =		sprintf("%-19s", $row[3]);
-	$USERavgTALK =	$row[2];
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
-
-	$i++;
-	}
-
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-##############################
-#########  TIME STATS
-
-if ($output == 'FULL')
-	{
-
-	echo "\n";
-	echo "---------- ESTADÍSTICAS DEL TIEMPO\n";
-
-	echo "\n";
-
-	$hi_hour_count=0;
-	$last_full_record=0;
-	$i=0;
-	$h=0;
-	while ($i <= 96)
-		{
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-		$h++;
-		}
-
-	$hour_multiplier = (100 / $hi_hour_count);
-	#$hour_multiplier = round($hour_multiplier, 0);
-
-	echo "\n";
-	echo "GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LLAMADAS TOTALES\n";
-
-	$k=1;
-	$Mk=0;
-	$call_scale = '0';
-	while ($k <= 102) 
-		{
-		if ($Mk >= 5) 
-			{
-			$Mk=0;
-			$scale_num=($k / $hour_multiplier);
-			$scale_num = round($scale_num, 0);
-			$LENscale_num = (strlen($scale_num));
-			$k = ($k + $LENscale_num);
-			$call_scale .= "$scale_num";
-			}
-		else
-			{
-			$call_scale .= " ";
-			$k++;   $Mk++;
-			}
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-	#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-	echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-	$ZZ = '00';
-	$i=0;
-	$h=4;
-	$hour= -1;
-	$no_lines_yet=1;
-
-	while ($i <= 96)
-		{
-		$char_counter=0;
-		$time = '      ';
-		if ($h >= 4) 
-			{
-			$hour++;
-			$h=0;
-			if ($hour < 10) {$hour = "0$hour";}
-			$time = "+$hour$ZZ+";
-			}
-		if ($h == 1) {$time = "   15 ";}
-		if ($h == 2) {$time = "   30 ";}
-		if ($h == 3) {$time = "   45 ";}
-		$Ghour_count = $hour_count[$i];
-		if ($Ghour_count < 1) 
-			{
-			if ( ($no_lines_yet) or ($i > $last_full_record) )
-				{
-				$do_nothing=1;
-				}
-			else
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				echo "|$time|";
-				$k=0;   while ($k <= 102) {echo " ";   $k++;}
-				echo "| $hour_count[$i] |\n";
-				}
-			}
-		else
-			{
-			$no_lines_yet=0;
-			$Xhour_count = ($Ghour_count * $hour_multiplier);
-			$Yhour_count = (99 - $Xhour_count);
-
-			$Gdrop_count = $drop_count[$i];
-			if ($Gdrop_count < 1) 
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "*X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 101) {echo " ";   $char_counter++;}
-				echo "| 0     | $hour_count[$i] |\n";
-
-				}
-			else
-				{
-				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-				echo "D";   $char_counter++;
-				$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 102) {echo " ";   $char_counter++;}
-				echo "| $drop_count[$i] | $hour_count[$i] |\n";
-				}
-			}
-		
-		
-		$i++;
-		$h++;
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-	}
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/astguiclient_es/admin.php b/LANG_admin/astguiclient_es/admin.php deleted file mode 100644 index fcea423a..00000000 --- a/LANG_admin/astguiclient_es/admin.php +++ /dev/null @@ -1,1824 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI database administration -# -# CHANGES -# 50913-1118 - Added outbound_cid for web-client calls -# 50926-1356 - Modified to allow for language translation -# 50926-1613 - Added WeBRooTWritablE write controls -# 51128-1254 - Modified to allow PHP global vars off -# 51208-2120 - Added option to login with vicidial_user login if allowed -# 51213-1650 - Added option to delete phones if allowed by vicidial_users -# 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1137 - Fixed phone search bug -# 60620-1243 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '1.1.12'; -$build = '60620-1243'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_id"])) {$server_id=$_GET["server_id"];} - elseif (isset($_POST["server_id"])) {$server_id=$_POST["server_id"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} - elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} -if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} - elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} -if (isset($_GET["computer_ip"])) {$computer_ip=$_GET["computer_ip"];} - elseif (isset($_POST["computer_ip"])) {$computer_ip=$_POST["computer_ip"];} -if (isset($_GET["login"])) {$login=$_GET["login"];} - elseif (isset($_POST["login"])) {$login=$_POST["login"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["phone_type"])) {$phone_type=$_GET["phone_type"];} - elseif (isset($_POST["phone_type"])) {$phone_type=$_POST["phone_type"];} -if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} - elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} -if (isset($_GET["company"])) {$company=$_GET["company"];} - elseif (isset($_POST["company"])) {$company=$_POST["company"];} -if (isset($_GET["picture"])) {$picture=$_GET["picture"];} - elseif (isset($_POST["picture"])) {$picture=$_POST["picture"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} - elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} -if (isset($_GET["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"];} - elseif (isset($_POST["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];} -if (isset($_GET["ASTmgrSECRET"])) {$ASTmgrSECRET=$_GET["ASTmgrSECRET"];} - elseif (isset($_POST["ASTmgrSECRET"])) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];} -if (isset($_GET["login_user"])) {$login_user=$_GET["login_user"];} - elseif (isset($_POST["login_user"])) {$login_user=$_POST["login_user"];} -if (isset($_GET["login_pass"])) {$login_pass=$_GET["login_pass"];} - elseif (isset($_POST["login_pass"])) {$login_pass=$_POST["login_pass"];} -if (isset($_GET["login_campaign"])) {$login_campaign=$_GET["login_campaign"];} - elseif (isset($_POST["login_campaign"])) {$login_campaign=$_POST["login_campaign"];} -if (isset($_GET["park_on_extension"])) {$park_on_extension=$_GET["park_on_extension"];} - elseif (isset($_POST["park_on_extension"])) {$park_on_extension=$_POST["park_on_extension"];} -if (isset($_GET["conf_on_extension"])) {$conf_on_extension=$_GET["conf_on_extension"];} - elseif (isset($_POST["conf_on_extension"])) {$conf_on_extension=$_POST["conf_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"];} - elseif (isset($_POST["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"];} - elseif (isset($_POST["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];} -if (isset($_GET["monitor_prefix"])) {$monitor_prefix=$_GET["monitor_prefix"];} - elseif (isset($_POST["monitor_prefix"])) {$monitor_prefix=$_POST["monitor_prefix"];} -if (isset($_GET["recording_exten"])) {$recording_exten=$_GET["recording_exten"];} - elseif (isset($_POST["recording_exten"])) {$recording_exten=$_POST["recording_exten"];} -if (isset($_GET["voicemail_exten"])) {$voicemail_exten=$_GET["voicemail_exten"];} - elseif (isset($_POST["voicemail_exten"])) {$voicemail_exten=$_POST["voicemail_exten"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["dtmf_send_extension"])) {$dtmf_send_extension=$_GET["dtmf_send_extension"];} - elseif (isset($_POST["dtmf_send_extension"])) {$dtmf_send_extension=$_POST["dtmf_send_extension"];} -if (isset($_GET["call_out_number_group"])) {$call_out_number_group=$_GET["call_out_number_group"];} - elseif (isset($_POST["call_out_number_group"])) {$call_out_number_group=$_POST["call_out_number_group"];} -if (isset($_GET["client_browser"])) {$client_browser=$_GET["client_browser"];} - elseif (isset($_POST["client_browser"])) {$client_browser=$_POST["client_browser"];} -if (isset($_GET["install_directory"])) {$install_directory=$_GET["install_directory"];} - elseif (isset($_POST["install_directory"])) {$install_directory=$_POST["install_directory"];} -if (isset($_GET["local_web_callerID_URL"])) {$local_web_callerID_URL=$_GET["local_web_callerID_URL"];} - elseif (isset($_POST["local_web_callerID_URL"])) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];} -if (isset($_GET["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"];} - elseif (isset($_POST["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];} -if (isset($_GET["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"];} - elseif (isset($_POST["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];} -if (isset($_GET["user_switching_enabled"])) {$user_switching_enabled=$_GET["user_switching_enabled"];} - elseif (isset($_POST["user_switching_enabled"])) {$user_switching_enabled=$_POST["user_switching_enabled"];} -if (isset($_GET["conferencing_enabled"])) {$conferencing_enabled=$_GET["conferencing_enabled"];} - elseif (isset($_POST["conferencing_enabled"])) {$conferencing_enabled=$_POST["conferencing_enabled"];} -if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} - elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} -if (isset($_GET["admin_hijack_enabled"])) {$admin_hijack_enabled=$_GET["admin_hijack_enabled"];} - elseif (isset($_POST["admin_hijack_enabled"])) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];} -if (isset($_GET["admin_monitor_enabled"])) {$admin_monitor_enabled=$_GET["admin_monitor_enabled"];} - elseif (isset($_POST["admin_monitor_enabled"])) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];} -if (isset($_GET["call_parking_enabled"])) {$call_parking_enabled=$_GET["call_parking_enabled"];} - elseif (isset($_POST["call_parking_enabled"])) {$call_parking_enabled=$_POST["call_parking_enabled"];} -if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["updater_check_enabled"];} - elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];} -if (isset($_GET["AFLogging_enabled"])) {$AFLogging_enabled=$_GET["AFLogging_enabled"];} - elseif (isset($_POST["AFLogging_enabled"])) {$AFLogging_enabled=$_POST["AFLogging_enabled"];} -if (isset($_GET["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"];} - elseif (isset($_POST["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];} -if (isset($_GET["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"];} - elseif (isset($_POST["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];} -if (isset($_GET["voicemail_button_enabled"])) {$voicemail_button_enabled=$_GET["voicemail_button_enabled"];} - elseif (isset($_POST["voicemail_button_enabled"])) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];} -if (isset($_GET["enable_fast_refresh"])) {$enable_fast_refresh=$_GET["enable_fast_refresh"];} - elseif (isset($_POST["enable_fast_refresh"])) {$enable_fast_refresh=$_POST["enable_fast_refresh"];} -if (isset($_GET["fast_refresh_rate"])) {$fast_refresh_rate=$_GET["fast_refresh_rate"];} - elseif (isset($_POST["fast_refresh_rate"])) {$fast_refresh_rate=$_POST["fast_refresh_rate"];} -if (isset($_GET["enable_persistant_mysql"])) {$enable_persistant_mysql=$_GET["enable_persistant_mysql"];} - elseif (isset($_POST["enable_persistant_mysql"])) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];} -if (isset($_GET["auto_dial_next_number"])) {$auto_dial_next_number=$_GET["auto_dial_next_number"];} - elseif (isset($_POST["auto_dial_next_number"])) {$auto_dial_next_number=$_POST["auto_dial_next_number"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["DBX_server"])) {$DBX_server=$_GET["DBX_server"];} - elseif (isset($_POST["DBX_server"])) {$DBX_server=$_POST["DBX_server"];} -if (isset($_GET["DBX_database"])) {$DBX_database=$_GET["DBX_database"];} - elseif (isset($_POST["DBX_database"])) {$DBX_database=$_POST["DBX_database"];} -if (isset($_GET["DBX_user"])) {$DBX_user=$_GET["DBX_user"];} - elseif (isset($_POST["DBX_user"])) {$DBX_user=$_POST["DBX_user"];} -if (isset($_GET["DBX_pass"])) {$DBX_pass=$_GET["DBX_pass"];} - elseif (isset($_POST["DBX_pass"])) {$DBX_pass=$_POST["DBX_pass"];} -if (isset($_GET["DBX_port"])) {$DBX_port=$_GET["DBX_port"];} - elseif (isset($_POST["DBX_port"])) {$DBX_port=$_POST["DBX_port"];} -if (isset($_GET["DBY_server"])) {$DBY_server=$_GET["DBY_server"];} - elseif (isset($_POST["DBY_server"])) {$DBY_server=$_POST["DBY_server"];} -if (isset($_GET["DBY_database"])) {$DBY_database=$_GET["DBY_database"];} - elseif (isset($_POST["DBY_database"])) {$DBY_database=$_POST["DBY_database"];} -if (isset($_GET["DBY_user"])) {$DBY_user=$_GET["DBY_user"];} - elseif (isset($_POST["DBY_user"])) {$DBY_user=$_POST["DBY_user"];} -if (isset($_GET["DBY_pass"])) {$DBY_pass=$_GET["DBY_pass"];} - elseif (isset($_POST["DBY_pass"])) {$DBY_pass=$_POST["DBY_pass"];} -if (isset($_GET["DBY_port"])) {$DBY_port=$_GET["DBY_port"];} - elseif (isset($_POST["DBY_port"])) {$DBY_port=$_POST["DBY_port"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["old_extension"])) {$old_extension=$_GET["old_extension"];} - elseif (isset($_POST["old_extension"])) {$old_extension=$_POST["old_extension"];} -if (isset($_GET["old_server_ip"])) {$old_server_ip=$_GET["old_server_ip"];} - elseif (isset($_POST["old_server_ip"])) {$old_server_ip=$_POST["old_server_ip"];} -if (isset($_GET["old_server_id"])) {$old_server_id=$_GET["old_server_id"];} - elseif (isset($_POST["old_server_id"])) {$old_server_id=$_POST["old_server_id"];} -if (isset($_GET["server_description"])) {$server_description=$_GET["server_description"];} - elseif (isset($_POST["server_description"])) {$server_description=$_POST["server_description"];} -if (isset($_GET["asterisk_version"])) {$asterisk_version=$_GET["asterisk_version"];} - elseif (isset($_POST["asterisk_version"])) {$asterisk_version=$_POST["asterisk_version"];} -if (isset($_GET["max_vicidial_trunks"])) {$max_vicidial_trunks=$_GET["max_vicidial_trunks"];} - elseif (isset($_POST["max_vicidial_trunks"])) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];} -if (isset($_GET["telnet_host"])) {$telnet_host=$_GET["telnet_host"];} - elseif (isset($_POST["telnet_host"])) {$telnet_host=$_POST["telnet_host"];} -if (isset($_GET["telnet_port"])) {$telnet_port=$_GET["telnet_port"];} - elseif (isset($_POST["telnet_port"])) {$telnet_port=$_POST["telnet_port"];} -if (isset($_GET["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"];} - elseif (isset($_POST["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];} -if (isset($_GET["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"];} - elseif (isset($_POST["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];} -if (isset($_GET["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"];} - elseif (isset($_POST["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];} -if (isset($_GET["answer_transfer_agent"])) {$answer_transfer_agent=$_GET["answer_transfer_agent"];} - elseif (isset($_POST["answer_transfer_agent"])) {$answer_transfer_agent=$_POST["answer_transfer_agent"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["old_conf_exten"])) {$old_conf_exten=$_GET["old_conf_exten"];} - elseif (isset($_POST["old_conf_exten"])) {$old_conf_exten=$_POST["old_conf_exten"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS and Dots -$phone_ip = ereg_replace("[^\.0-9]","",$phone_ip); -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$old_server_ip = ereg_replace("[^\.0-9]","",$old_server_ip); -$computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); - -### DIGITS ONLY ### -$dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); -$voicemail_id = ereg_replace("[^0-9]","",$voicemail_id); -$outbound_cid = ereg_replace("[^0-9]","",$outbound_cid); -$VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); -$park_on_extension = ereg_replace("[^0-9]","",$park_on_extension); -$conf_on_extension = ereg_replace("[^0-9]","",$conf_on_extension); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$old_conf_exten = ereg_replace("[^0-9]","",$old_conf_exten); -$voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); -$voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); -$recording_exten = ereg_replace("[^0-9]","",$recording_exten); -$monitor_prefix = ereg_replace("[^0-9]","",$monitor_prefix); -$answer_transfer_agent = ereg_replace("[^0-9]","",$answer_transfer_agent); -$DBX_port = ereg_replace("[^0-9]","",$DBX_port); -$DBY_port = ereg_replace("[^0-9]","",$DBY_port); -$telnet_port = ereg_replace("[^0-9]","",$telnet_port); -$max_vicidial_trunks = ereg_replace("[^0-9]","",$max_vicidial_trunks); -$auto_dial_next_number = ereg_replace("[^0-9]","",$auto_dial_next_number); -$VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); -$enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); -$enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); -$user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); -$updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); -$QUEUE_ACTION_enabled = ereg_replace("[^0-9]","",$QUEUE_ACTION_enabled); -$conferencing_enabled = ereg_replace("[^0-9]","",$conferencing_enabled); -$voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); -$CallerID_popup_enabled = ereg_replace("[^0-9]","",$CallerID_popup_enabled); -$call_parking_enabled = ereg_replace("[^0-9]","",$call_parking_enabled); -$AGI_call_logging_enabled = ereg_replace("[^0-9]","",$AGI_call_logging_enabled); -$AFLogging_enabled = ereg_replace("[^0-9]","",$AFLogging_enabled); -$admin_monitor_enabled = ereg_replace("[^0-9]","",$admin_monitor_enabled); -$admin_hijack_enabled = ereg_replace("[^0-9]","",$admin_hijack_enabled); -$admin_hangup_enabled = ereg_replace("[^0-9]","",$admin_hangup_enabled); -$fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); -$ADD = ereg_replace("[^0-9]","",$ADD); - -### ALPHA-NUMERIC and underscore and dash and slash and at and dot -$extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); -$old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); -$install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); -$client_browser = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$client_browser); -$dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); -$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); -$telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); -$DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); -$DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); - -### ALPHA-NUMERIC (and underscore and dash) -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$login = ereg_replace("[^-\_0-9a-zA-Z]","",$login); -$user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^-\_0-9a-zA-Z]","",$pass); -$status = ereg_replace("[^-\_0-9a-zA-Z]","",$status); -$protocol = ereg_replace("[^-\_0-9a-zA-Z]","",$protocol); -$ASTmgrUSERNAMEupdate = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEupdate); -$ASTmgrUSERNAMEsend = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEsend); -$ASTmgrUSERNAMElisten = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMElisten); -$ASTmgrUSERNAME = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAME); -$ASTmgrSECRET = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrSECRET); -$login_user = ereg_replace("[^-\_0-9a-zA-Z]","",$login_user); -$login_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$login_pass); -$login_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$login_campaign); -$DBX_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_user); -$DBY_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_user); -$DBX_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_pass); -$DBY_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_pass); -$DBX_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_database); -$DBY_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_database); -$VICIDIAL_park_on_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$VICIDIAL_park_on_filename); -$server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); -$old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); -$ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); -$CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); -$company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); -$picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); -$local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); -$server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); -$asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - -### VARIABLES TO BE mysql_real_escape_string ### -# $VICIDIAL_web_URL = -# $local_web_callerID_URL = - -##### END VARIABLE FILTERING FOR SECURITY ##### - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Usted ahora ha salido. Gracias\n"; - exit; -} - -if (!isset($ADD)) {$ADD=0;} - -$STARTtime = date("U"); -$STARTdate = date("Y-m-d H:i:s"); - -if ($ADD==1) {$process = 'NUEVO TELÉFONO';} -if ($ADD==11) {$process = 'NUEVO SERVIDOR';} -if ($ADD==111) {$process = 'NUEVA CONFERENCIA';} -if ($ADD==2) {$process = 'CREANDO TELÉFONO';} -if ($ADD==21) {$process = 'CREANDO SERVIDOR';} -if ($ADD==211) {$process = 'CREANDO CONFERENCIA';} -if ($ADD==3) {$process = 'MODIFICAR EL TELÉFONO';} -if ($ADD==31) {$process = 'MODIFICAR EL SERVIDOR';} -if ($ADD==311) {$process = 'MODIFICAR LA CONFERENCIA';} -if ($ADD==4) {$process = 'MODIFICANDO EL TELÉFONO';} -if ($ADD==41) {$process = 'MODIFICANDO EL SERVIDOR';} -if ($ADD==411) {$process = 'MODIFICANDO LA CONFERENCIA';} -if ($ADD==5) {$process = 'DELETE PHONE';} -if ($ADD==6) {$process = 'DELETE PHONE';} -if ($ADD==55) {$process = 'BUSCAR TELÉFONOS';} -if ($ADD==66) {$process = 'RESULTADO DE LA BÚSQUEDA DE TELÉFONOS';} -if ($ADD==0) {$process = 'LISTA DE TELÉFONOS';} -if ($ADD==10) {$process = 'LISTA DE SERVIDORES';} -if ($ADD==100) {$process = 'LISTA DE CONFERENCIAS';} -if ($ADD==99999) {$process = 'AYUDA';} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if ($auth<1) - { - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > '6' and ast_admin_access='1';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGdelete_phones =$row[17]; - } - } - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - echo "|$stmt|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - if (strlen($LOGfullname) < 1) - { - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - } - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rsltx=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rsltx); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $servers_list .= "\n"; - $o++; - } - - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); - -$NWB = "   \"AYUDA\""; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "ASTERISK ADMIN: Administración - $process \n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
ASTERISK ADMIN: AYUDA


\n"; - -?> -TABLA DE LOS TELÉFONOS

- -
-Extensión del teléfono - este campo es donde usted pone los nombres del teléfono que aparecen al marcar con asterisco no incluyendo el protocolo o la barra vertical del principio. Por ejemplo: para el teléfono SIP/test101 del SIP la extensión del teléfono sería test101. También, para los teléfonos IAX2 compruebe que usted utiliza el nombre del teléfono completo: IAX2/IAXphone1@IAXphone1 sería IAXphone1@IAXphone1. Para zap los teléfonos compruebe que usted pone el canal completo: Zap/25-1 sería 25-1. Otra nota, compruebe que usted fija el protocolo abajo correctamente para su tipo de teléfono. - -
-
-
-Número del Dialplan - este campo está para el número que usted marca para tener el anillo del teléfono. Este número se define en el archivo de extensions.conf de su servidor asterisco - -
-
-
-Caja de Buzón de Voz - este campo es para la caja del buzón de voz donde van los mensajes para al usuario de este teléfono. Utilizamos esto para comprobar los mensajes del buzón de voz y para que el usuario pueda acceder al Buzón de Voz desde astGUIclient. - -
-
-
-CallerID de salida - este campo es donde usted incorporara el número del callerID que usted quiera que aparezca en las llamadas de salida. Esto no funciona en las líneas RTB(non-PRI) T1/E1. - -
-
-
-Dirección IP del teléfono - este campo es para la dirección IP del teléfono si es un teléfono de VOZIP. Este es un campo opcional - -
-
-
-Dirección IP del ordenador - este campo es para la dirección IP del ordenador del usuario. Es un campo opcional - -
-
-
-IP del servidor - Este menú es donde usted selecciona en que servidor está el teléfono activo. - -
-
-
-Conexión - la conexión usada para el usuario del teléfono a laconexión a los usos del cliente. - -
-
-
-Contraseña - la contraseña usada para el usuario del teléfono a laconexión a los usos del cliente. - -
-
-
-Estado - el estado del teléfono en el sistema, puede ser ACTIVO y ADMIN permiten que los clientes del GUI trabajen. ADMIN permite el acceso a este Web site de administración. El resto de los estados no permiten el acceso al GUI o al Web de Admin. - -
-
-
-Cuenta activa - si el teléfono está activado ponerla en la lista del cliente del GUI. - -
-
-
-Tipo de teléfono - solamente para información administrativas. - -
-
-
-Nombre completo - usado por el GUIclient en la lista de teléfonos activos. - -
-
-
-Compañía - solamente para las notas administrativas. - -
-
-
-Cuadro - todavía no puesto en ejecución. - -
-
-
-Nuevos mensajes - número de los nuevos mensajes del Buzón de Voz para este teléfono en el servidor del asterisco. - -
-
-
-Viejos mensajes - número de los viejos mensajes del Buzón de Voz para este teléfono en el servidor del asterisco. - -
-
-
-Protocolo del cliente - el protocolo que el teléfono utiliza para conectar con el servidor del asterisco: El Sip, IAX2, Zap. También, para los números External remotos o los números SpeedDial que usted desea enumerar como teléfonos. - -
-
-
-GMT local - La diferencia a partir del tiempo malo del ZULÚ del time(or de Greenwich) donde se localiza el teléfono. NO AJUSTE POR TIEMPO DE LOS AHORROS DE LA LUZ DEL DÍA. Esto es utilizada por la campaña de VICIDIAL para exhibir exactamente el tiempo y el tiempo del cliente. - -
-
-
-Conexión del encargado - Ésta es la conexión que los clientes del GUI para este teléfono utilizarán tener acceso a la base de datos donde residen los datos del servidor. - -
-
-
-Secreto del encargado - Ésta es la contraseña que los clientes del GUI para este teléfono utilizarán tener acceso a la base de datos donde residen los datos del servidor. - -
-
-
-Usuario del defecto de VICIDIAL - éste debe poner un valor prefijado en el campo del usuario de VICIDIAL siempre que este usuario del teléfono abra a cliente app de astVICIDIAL. Deje el espacio en blanco para ningún usuario. - -
-
-
-Paso del defecto de VICIDIAL - éste debe poner un valor prefijado en el campo de la contraseña de VICIDIAL siempre que este usuario del teléfono abra a cliente app de astVICIDIAL. Deje el espacio en blanco para ningún paso. - -
-
-
-Campaña del defecto de VICIDIAL - éste debe poner un valor prefijado en el campo de la campaña de VICIDIAL siempre que este usuario del teléfono abra a cliente app de astVICIDIAL. Deje el espacio en blanco para ninguna campaña. - -
-
-
-Parque Exten - Ésta es la extensión del estacionamiento del defecto para los apps del cliente. Verifique que diverso trabaje antes de que usted cambie esto. - -
-
-
-Extensión de la conferencia - Ésta es la extensión del parque de la conferencia del defecto para los apps del cliente. Verifique que diverso trabaje antes de que usted cambie esto. - -
-
-
-Parque Exten de VICIDIAL - Ésta es la extensión del estacionamiento del defecto para el cliente app de VICIDIAL. Verifique que diverso trabaje antes de que usted cambie esto. - -
-
-
-Archivo del parque de VICIDIAL - éste es el nombre del archivo de la extensión del parque del defecto VICIDIAL para los apps del cliente. Verifique que diverso trabaje antes de que usted cambie éste limitado a 10 caracteres. - -
-
-
-Prefijo del monitor - éste es el prefijo dialplan para supervisar de zap los canales automáticamente dentro del app astGUIclient. Cambie solamente según los expedientes de extensiones de extensions.conf ZapBarge. - -
-
-
-Grabación Exten - Ésta es la extensión dialplan para la extensión de la grabación que se utiliza para caer en conferencias del meetme para registrarlas. Dura generalmente hasta que una hora si no parada verifica con el archivo de extensions.conf antes de cambiar. - -
-
-
-VMAIL Exten principal - Ésta es la extensión dialplan que va a comprobar su voicemail. verifica con el archivo de extensions.conf antes de cambiar. - -
-
-
-Descarga Exten de VMAIL - éste es el prefijo dialplan usado para enviar llamadas directamente al voicemail de un usuario de una llamada viva en el app. astGUIclient verifica con el archivo de extensions.conf antes de cambiar. - -
-
-
-Contexto de Exten - éste es el contexto dialplan que este teléfono utiliza sobre todo. Se asume que todos los números marcados por los apps del cliente están utilizando este contexto así que es una buena idea cerciorarse de que éste es el contexto más amplio posible verifica con el archivo de extensions.conf antes de cambiar. - -
-
-
-DTMF envían el canal - Ésta es la secuencia del canal usada para enviar sonidos de DTMF en conferencias del meetme de los apps del cliente. Verifique que exten y contexto con el archivo de extensions.conf. - -
-
-
-Grupo de salida de la llamada - éste es el grupo de canal que las llamadas de salida de este teléfono están puestas de. Hay rutinas de un par en los apps del cliente que utilizan esto. Para zap los canales que usted desea utilizar algo como Zap/g2, porque los troncos IAX2 usted desearía utilizar el prefijo completo de IAX como IAX2/VICItest1:secret@10.10.10.15:4569. Verifique que los troncos con el file(it de extensions.conf sean generalmente lo que usted ha definido como la variable global del TRUNK en la tapa del archivo). - -
-
-
-Localización del browser - esto es aplicable solamente a los clientes de UNIX/LINUX, el camino absoluto a Mozilla o el browser de Firefox en la máquina verifica esto lanzándolo manualmente. - -
-
-
-Instale el directorio - éste es el lugar en donde las escrituras astGUIclient y de astVICIDIAL están situadas en su máquina. Para Win32 debe ser algo como C:\AST_VICI y para UNIX debe ser algo como /usr/local/perl_TK. verifica esto manualmente. - -
-
-
-URL de CallerID - Ústa es la dirección de la tela de la página usada para hacer operaciones de búsqueda de encargo del callerID que es la dirección de prueba del defecto: http://astguiclient.sf.net/test_callerid_output.php - -
-
-
-URL del defecto de VICIDIAL - Ésta es la dirección de la tela de la página usada para hacer preguntas de encargo de la forma del Web de VICIDIAL que es la dirección de prueba del defecto: http://astguiclient.sf.net/test_VICIDIAL_output.php - -
-
-
-Registración de la llamada - esto se fija para verdad si el archivo de call_log.agi está en lugar en el archivo de extensions.conf para todo el de salida y las extensiones del retraso ' h ' para registrar todo llama. Ústa debe siempre ser 1 porque es manditory para muchos astGUIclient y características de VICIDIAL a trabajar correctamente. - -
-
-
-Conmutación del usuario - fije para verdad para permitir que el usuario cambie a otra cuenta del usuario. NOTA: Si los interruptores del usuario ellos pueden iniciar la grabación en la conversación de teléfono del nuevo usuario - -
-
-
-Comunicación - fije para verdad para permitir que el usuario comience llamadas de conferencia con hasta que seis líneas externas. - -
-
-
-Retraso del Admin - sistema a verdad para permitir que el usuario pueda al retraso cualquier línea en la voluntad con astGUIclient. Buena idea de permitir solamente esto para los usuarios del Admin. - -
-
-
-Secuestro del Admin - fije para verdad para permitir que el usuario pueda asir y volver a dirigir a su extensión cualquier línea en la voluntad con astGUIclient. Buena idea de permitir solamente esto para los usuarios del Admin. Pero es muy útil para los encargados. - -
-
-
-Monitor del Admin - fije para verdad para permitir que el usuario pueda asir y volver a dirigir a su extensión cualquier línea en la voluntad con astGUIclient. Buena idea de permitir solamente esto para los usuarios del Admin. Pero es muy útil para los encargados y como herramienta del entrenamiento. - -
-
-
-Parque de llamada - el sistema a verdad para permitir que el usuario pueda parquear invita el asimiento astGUIclient para ser tomado por cualquier otro usuario astGUIclient en el sistema. Las llamadas permanecen en el asimiento para hasta que un retraso de la media-hora entonces. Permitido generalmente para todos. - -
-
-
-Cheque de Updater - fije para verdad para exhibir una advertencia del popup que el tiempo del updater no ha cambiado en 20 segundos. Útil para los usuarios del Admin. - -
-
-
-Af que registra - fije para verdad para registrar muchas acciones del uso astGUIclient a un archivo de texto en la computadora del usuario. - -
-
-
-La coleta permitió - al sistema verdad para hacer que los apps del cliente utilicen el sistema central de la coleta del asterisco. Requerido para VICIDIAL y recomendado para todos los usuarios. - -
-
-
-Ventana emergente del CallerID - sistema a verdad para tener en cuenta los números definidos en el archivo de extensions.conf para enviar las pantallas del popup de CallerID a los usuarios astGUIclient. - -
-
-
-Botón de VMail - fije para verdad para exhibir el botón de VOICEMAIL y los mensajes cuentan la exhibición en astGUIclient. - -
-
-
-Rápido restaure - fije para verdad para permitir un nuevo índice de restauran de la información de la llamada para el astGUIclient. La tarifa inhabilitada defecto es el ms 1000 (1 segundo). Puede aumentar la carga de sistema si usted baja este número. - -
-
-
-Rápido restaure la tarifa - en milisegundos. Utilizado solamente si es rápido restaure se permite. La tarifa inhabilitada defecto es el ms 1000 (1 segundo). Puede aumentar la carga de sistema si usted baja este número. - -
-
-
-Persistant MySQL - si está permitida la conexión astGUIclient seguirá conectada en vez de conectar cada segundo. Útil si usted hace que un rápido restaure la tarifa fijada. Aumentará el número de conexiones en su máquina de MySQL. - -
-
-
-Número siguiente del dial auto - si está permitido el cliente de VICIDIAL marcará el número siguiente en la lista automáticamente sobre la disposición de una llamada a menos que seleccionaran "para parar el marcar" en la pantalla de la disposición. - -
-
-
-Pare Rec después de cada llamada - si está permitido el cliente de VICIDIAL parará se está encendiendo cualquier grabación después de que haya sido cada llamada dispositioned. Útil si usted está haciendo muchos de la grabación o usted están utilizando una forma de la tela para accionar la grabación. - -
-
-
-Servidor de DBX - el servidor de la base de datos de MySQL con el cual este usuario debe conectar. - -
-
-
-Base de datos de DBX - la base de datos de MySQL con la cual este usuario debe conectar. El defecto es asterisco. - -
-
-
-Usuario de DBX - la conexión del usuario de MySQL que este usuario debe utilizar al conectar. El defecto es cron. - -
-
-
-Paso de DBX - la contraseña del usuario de MySQL que este usuario debe utilizar al conectar. El defecto es 1234. - -
-
-
-DBX viran - el puerto de MySQL hacia el lado de babor TCP que este usuario debe utilizar al conectar. El defecto es 3306. - -
-
-
-Servidor de DBY - el servidor de la base de datos de MySQL con el cual este usuario debe conectar. Secundario server, no utilizado actualmente. - -
-
-
-Base de datos de DBY - la base de datos de MySQL con la cual este usuario debe conectar. El defecto es asterisco. Secundario server, no utilizado actualmente. - -
-
-
-Usuario de DBY - la conexión del usuario de MySQL que este usuario debe utilizar al conectar. El defecto es cron. Secundario server, no utilizado actualmente. - -
-
-
-Paso de DBY - la contraseña del usuario de MySQL que este usuario debe utilizar al conectar. El defecto es 1234. Secundario server, no utilizado actualmente. - -
-
-
-DBY viran - el puerto de MySQL hacia el lado de babor TCP que este usuario debe utilizar al conectar. El defecto es 3306. Secundario server, no utilizado actualmente. - - -



- -TABLA DE LOS SERVIDORES

-
-
-ID Del Servidor - Este campo es donde usted pone el nombre del servidor del asterisco, no tiene que ser un submarino oficial del dominio, apenas un apodo para identificar el servidor a los usuarios del Admin. - -
-
-
-Descripción del servidor - el campo donde usted utiliza una frase pequeña para describir el servidor del asterisco. - -
-
-
-IP address del servidor - el campo donde usted puso el IP address de la red del servidor del asterisco. - -
-
-
-Activo - fije si el servidor del asterisco es activo o inactivo. - -
-
-
-Versión del asterisco - fije la versión del asterisco que usted ha instalado en este servidor. Ejemplos: ' 1.2 ', ' 1.0.8 ', ' 1.0.7 ', ' CVS_HEAD ', ' REALMENTE VIEJO ', etc... Se utiliza esto porque las versiones 1.0.8 y 1.0.9 tienen un diverso método de ocuparse del insecto local del channels(a que ha estado fijado en CVS v1.0) y necesidad de ser tratado diferentemente cuando la manipulación de su Local/ acanala. También, CVS_HEAD actual y las 1.2 aplicaciones diverso encargado y comando del árbol del lanzamiento hicieron salir así que debe ser tratado diverso también. - -
-
-
-Troncos máximos de VICIDIAL - este campo determinará el número de las líneas máximo que el auto-dialer de VICIDIAL procurará invitar este servidor. Si usted desea dedicar dos PRI llenos T1 a VICIDIALing en un servidor entonces usted fijaría esto a 46. E1 defecto es 96. - -
-
-
-Anfitrión del telnet - éste es la dirección o el nombre del servidor del asterisco y es cómo los usos del encargado conectan con él de donde están funcionando. Si están funcionando en el servidor del asterisco, después el defecto del ' localhost ' está muy bien. - -
-
-
-El telnet vira hacia el lado de babor - éste es el puerto de la conexión del encargado del servidor del asterisco y es cómo los usos del encargado conectan con ella de donde están funcionando. El defecto de ' 5038 ' está para un estándar instala muy bien. - -
-
-
-Usuario del encargado - el username o la conexión conectaba genericly con el encargado del servidor del asterisco. El defecto es 'cron' - -
-
-
-Secreto del encargado - el secreto o la contraseña conectaba genericly con el encargado del servidor del asterisco. El defecto es '1234' - -
-
-
-Usuario en modo actualización del encargado - el username o la conexión conectaba con el encargado del servidor del asterisco optimizado para las escrituras de la actualización. Omita es 'updatecron' y asume el mismo secreto que el usuario genérico. - -
-
-
-El encargado escucha usuario - el username o la conexión usada para conectar con el encargado del servidor del asterisco optimizado para las escrituras que esperan a escuchar solamente salida. Omita es 'listencron' y asume el mismo secreto que el usuario genérico. - -
-
-
-El encargado envía a usuario - el username o la conexión usada para conectar con el encargado del servidor del asterisco optimizado para las escrituras que envían solamente acciones al encargado. Omita es 'sendcron' y asume el mismo secreto que el usuario genérico. - -
-
-
-El GMT del servidor compensó - la diferencia sobre horas a partir del tiempo del GMT no ajustado según el Luz del di'a-Ahorro-Tiempo del servidor. El defecto es '-5' - -
-
-
-Descarga Exten - el prefijo de VMail de la extensión usado en este servidor para enviar llamadas directamente a través de agc a una caja específica del voicemail. El defecto es '85026666666666' - -
-
-
-Extensión del ANUNCIO de VICIDIAL - la extensión del defecto si ninguno está presente en la campaña enviar llamadas para a marcar auto de VICIDIAL. El defecto es '8365' - -
-
-
-Contexto del defecto - el contexto dialplan del defecto usado para las escrituras que funcionan para este servidor. El defecto es 'defecto' - - -



- -TABLA DE CONFERENCIAS

-
-
-Número de la conferencia - este campo es donde usted pone el número del dialpna de la conferencia del meetme. También se recomienda que el número del meetme en meetme.conf empareja este número para cada entrada. Esto está para las conferencias en astGUIclient y se utiliza para la funcionalidad de leave-3way-call en VICIDIAL. - -
-
-
-IP del servidor - El menú donde usted selecciona el servidor del asterisco que esta conferencia estará encendido. - - - - - - -







-







-EL EXTREMO -
- - - -ASTERISK ADMIN: Administración - <? echo $process ?> - - - -
- - - - - - -
  ASTERISK ADMIN - Salir  
  ENUMERE TODOS LOS TELÉFONOS | AGREGUE Un TELÉFONO NUEVO | BÚSQUEDA PARA Un TELÉFONO | AGREGUE Un SERVIDOR | ENUMERE TODOS LOS SERVIDORES
  DEMUESTRE TODAS LAS CONFERENCIAS | AGREGUE Una NUEVA CONFERENCIA
-"; - -echo "
AGREGUE Un TELÉFONO NUEVO
\n"; -echo "\n"; -echo "
\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Extensión del teléfono: $NWB#phones-extension$NWE
Número De Dialplan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
Buzón de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
Dirección IP del teléfono: (optional)$NWB#phones-phone_ip$NWE
Dirección IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
IP Del Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Contraseña: $NWB#phones-pass$NWE
Estado: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del Teléfono: $NWB#phones-phone_type$NWE
Nombre Completo: $NWB#phones-fullname$NWE
Compañía: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW SERVERS FORM SCREEN -###################### - -if ($ADD==11) -{ -echo ""; - -echo "
AGREGAR Un SERVIDOR NUEVO\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Del Servidor: $NWB#servers-server_id$NWE
Descripción Del Servidor: $NWB#servers-server_description$NWE
Dirección IP del Servidor: $NWB#servers-server_ip$NWE
Activo: $NWB#servers-active$NWE
Versión De Asterisk: $NWB#servers-asterisk_version$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW CONFERENCES FORM SCREEN -###################### - -if ($ADD==111) -{ -echo ""; - -echo "
AGREGUE Una NUEVA CONFERENCIA\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Número de la Conferencia: (Solamente dígitos)$NWB#conferences-conf_exten$NWE
IP Del Servidor: $NWB#conferences-server_ip$NWE
\n"; - -} - - -###################### -# ADD=2 adds the new phone to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
TELÉFONO NO AGREGADO - hay ya un teléfono en el sistema con esta extensión/servidor\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
TELÉFONO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n";} - else - { - echo "
EL TELÉFONO AGREGÚ\n"; - - $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new server to the system -###################### - -if ($ADD==21) -{ - echo ""; - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SERVIDOR NO AGREGADO - hay ya un servidor en el sistema con esta identificación\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVIDOR NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n";} - else - { - echo "
SERVIDOR AGREGADO\n"; - - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new conference to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CONFERENCIA NO AGREGADA - hay ya una conferencia en el sistema con esta identificación y servidor\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCIA NO AGREGADA - vaya por favor detrás y mire los datos que usted incorporó\n";} - else - { - echo "
LA CONFERENCIA AGREGÚ\n"; - - $stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=100; -} - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of phone -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGdelete_phones < 1) ) - { - echo "
TELÉFONO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
IP Del Servidor be at least 7 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DEL TELÉFONO: $extension - $server_ip\n"; - echo "

Chasque aquí para suprimir el teléfono $extension - $server_ip


\n"; - } - -$ADD='3'; # go to phone modification below -} - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete phone record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGdelete_phones < 1) ) - { - echo "
TELÉFONO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
IP Del Servidor be at least 7 characters in length\n"; - } - else - { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } - echo "
LA CANCELADURA DEL TELÉFONO TERMINÓ: $extension - $server_ip\n"; - echo "

\n"; - } - -$ADD='0'; # go to phone list -} - - - - - - -###################### -# ADD=3 modify phone info in the system -###################### - -if ($ADD==3) -{ - echo ""; - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFICANDO EL TELÉFONO: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Extensión del teléfono: $NWB#phones-extension$NWE
Número De Dialplan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
Buzón de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
Dirección IP del teléfono: (optional)$NWB#phones-phone_ip$NWE
Dirección IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
IP Del Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Contraseña: $NWB#phones-pass$NWE
Estado: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del Teléfono: $NWB#phones-phone_type$NWE
Nombre Completo: $NWB#phones-fullname$NWE
Compañía: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Mensajes Nuevos: $row[14]$NWB#phones-messages$NWE
Mensajes Viejos: $row[15]$NWB#phones-old_messages$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
Login del Manager: $NWB#phones-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#phones-ASTmgrSECRET$NWE
Usuario por defecto de VICIDIAL: $NWB#phones-login_user$NWE
Contraseña por defecto de VICIDIAL: $NWB#phones-login_pass$NWE
Campaña por defecto de VICIDIAL: $NWB#phones-login_campaign$NWE
Extensión del parking: $NWB#phones-park_on_extension$NWE
Extensión de la conferencia: $NWB#phones-conf_on_extension$NWE
Exten. Del parking de VICIDIAL: $NWB#phones-VICIDIAL_park_on_extension$NWE
Archivo para música del parking de VICIDIAL: $NWB#phones-VICIDIAL_park_on_filename$NWE
Prefijo al monitorizar: $NWB#phones-monitor_prefix$NWE
Exten de Grabación: $NWB#phones-recording_exten$NWE
Exten de VmailMain: $NWB#phones-voicemail_exten$NWE
Exten de VmaiDumpl: $NWB#phones-voicemail_dump_exten$NWE
Contexto De Exten: $NWB#phones-ext_context$NWE
Canal de envío del DTMF: $NWB#phones-dtmf_send_extension$NWE
Grupo de las llamadas de salida: $NWB#phones-call_out_number_group$NWE
Localización del Navegador: $NWB#phones-client_browser$NWE
Directorio de instalación: $NWB#phones-install_directory$NWE
URL del CallerID: $NWB#phones-local_web_callerID_URL$NWE
URL por defecto de VICIDIAL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
Cambio de Usuario: $NWB#phones-user_switching_enabled$NWE
Conferencias: $NWB#phones-conferencing_enabled$NWE
Colgar del Admin: $NWB#phones-admin_hangup_enabled$NWE
Captura del Admin: $NWB#phones-admin_hijack_enabled$NWE
Monitorización del Admin: $NWB#phones-admin_monitor_enabled$NWE
Parking de Llamada: $NWB#phones-call_parking_enabled$NWE
Uptader Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Colas permitidas: $NWB#phones-QUEUE_ACTION_enabled$NWE
Ventana emergente del CallerID: $NWB#phones-CallerID_popup_enabled$NWE
Botón Vmail: $NWB#phones-voicemail_button_enabled$NWE
Refresco rápido: $NWB#phones-enable_fast_refresh$NWE
Refresco rápido de la tarifa: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Marcar el Siguiente Número: $NWB#phones-auto_dial_next_number$NWE
Parar de Grabar después de cada llamada: $NWB#phones-VDstop_rec_after_each_call$NWE
Servidor de DBX: (Primario DB Server)$NWB#phones-DBX_server$NWE
Base de datos de DBX: (Primario Server Database)$NWB#phones-DBX_database$NWE
Usuario de DBX: (Primario DB Login)$NWB#phones-DBX_user$NWE
Contraseña de DBX: (Primario DB Secret)$NWB#phones-DBX_pass$NWE
Puerto de DBX: (Primario DB Port)$NWB#phones-DBX_port$NWE
Servidor de DBY: (Secundario DB Server)$NWB#phones-DBY_server$NWE
Base de datos de DBY: (Secundario Server Database)$NWB#phones-DBY_database$NWE
Usuario de DBY: (Secundario DB Login)$NWB#phones-DBY_user$NWE
Contraseña de DBY: (Secundario DB Secret)$NWB#phones-DBY_pass$NWE
Puerto de DBY: (Secundario DB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Pinchar aquí­ para ver las estadísticas del teléfono\n"; - -if ($LOGdelete_phones > 0) - { - echo "

SUPRIMA ESTE TELÉFONO\n"; - } - -} - - -###################### -# ADD=31 modify server info in the system -###################### - -if ($ADD==31) -{ - echo ""; - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFICAR UN REGISTRO DEL SERVIDOR: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Del Servidor: $NWB#servers-server_id$NWE
Descripción Del Servidor: $NWB#servers-server_description$NWE
Dirección IP del Servidor: $NWB#servers-server_ip$NWE
Activo: $NWB#servers-active$NWE
Versión De Asterisk: $NWB#servers-asterisk_version$NWE
Máx. Trunks en VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
Host Del Telnet: $NWB#servers-telnet_host$NWE
Puerto Del Telnet: $NWB#servers-telnet_port$NWE
Usuario Del Manager: $NWB#servers-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#servers-ASTmgrSECRET$NWE
Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extensión de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extensión del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto por Defecto: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
TELÉFONOS DENTRO DE ESTE SERVIDOR:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
EXTENSIÓNNOMBREACTIVO
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Este servidor tiene $active_lists Teléfonos activos y $inactive_lists Teléfonos inactivos

\n"; -echo "
\n"; -} - - -###################### -# ADD=311 modify conference info in the system -###################### - -if ($ADD==311) -{ - echo ""; - - $stmt="SELECT * from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFICAR UN REGISTRO DE LA CONFERENCIA: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conferencia: $NWB#conferences-conf_exten$NWE
IP Del Servidor: $NWB#conferences-server_ip$NWE
Extensión Actual:
\n"; - -echo "
\n"; - -} - - - -###################### -# ADD=4 submit phone modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) - {echo "
TELÉFONO NO MODIFICADO - hay ya un teléfono en el sistema con esta extensión/servidor\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
TELÉFONO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n";} - else - { - echo "
TELÉFONO MODIFICADO: $extension\n"; - - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid' where extension='$old_extension' and server_ip='$old_server_ip';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFICANDO EL TELÉFONO: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Extensión del teléfono: $NWB#phones-extension$NWE
Número De Dialplan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
Buzón de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
Dirección IP del teléfono: (optional)$NWB#phones-phone_ip$NWE
Dirección IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
IP Del Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Contraseña: $NWB#phones-pass$NWE
Estado: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del Teléfono: $NWB#phones-phone_type$NWE
Nombre Completo: $NWB#phones-fullname$NWE
Compañía: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Mensajes Nuevos: $row[14]$NWB#phones-messages$NWE
Mensajes Viejos: $row[15]$NWB#phones-old_messages$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
Login del Manager: $NWB#phones-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#phones-ASTmgrSECRET$NWE
Usuario por defecto de VICIDIAL: $NWB#phones-login_user$NWE
Contraseña por defecto de VICIDIAL: $NWB#phones-login_pass$NWE
Campaña por defecto de VICIDIAL: $NWB#phones-login_campaign$NWE
Extensión del parking: $NWB#phones-park_on_extension$NWE
Extensión de la conferencia: $NWB#phones-conf_on_extension$NWE
Exten. Del parking de VICIDIAL: $NWB#phones-VICIDIAL_park_on_extension$NWE
Archivo para música del parking de VICIDIAL: $NWB#phones-VICIDIAL_park_on_filename$NWE
Prefijo al monitorizar: $NWB#phones-monitor_prefix$NWE
Exten de Grabación: $NWB#phones-recording_exten$NWE
Exten de VmailMain: $NWB#phones-voicemail_exten$NWE
Exten de VmaiDumpl: $NWB#phones-voicemail_dump_exten$NWE
Contexto De Exten: $NWB#phones-ext_context$NWE
Canal de envío del DTMF: $NWB#phones-dtmf_send_extension$NWE
Grupo de las llamadas de salida: $NWB#phones-call_out_number_group$NWE
Localización del Navegador: $NWB#phones-client_browser$NWE
Directorio de instalación: $NWB#phones-install_directory$NWE
URL del CallerID: $NWB#phones-local_web_callerID_URL$NWE
URL por defecto de VICIDIAL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
Cambio de Usuario: $NWB#phones-user_switching_enabled$NWE
Conferencias: $NWB#phones-conferencing_enabled$NWE
Colgar del Admin: $NWB#phones-admin_hangup_enabled$NWE
Captura del Admin: $NWB#phones-admin_hijack_enabled$NWE
Monitorización del Admin: $NWB#phones-admin_monitor_enabled$NWE
Parking de Llamada: $NWB#phones-call_parking_enabled$NWE
Uptader Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Colas permitidas: $NWB#phones-QUEUE_ACTION_enabled$NWE
Ventana emergente del CallerID: $NWB#phones-CallerID_popup_enabled$NWE
Botón Vmail: $NWB#phones-voicemail_button_enabled$NWE
Refresco rápido: $NWB#phones-enable_fast_refresh$NWE
Refresco rápido de la tarifa: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Marcar el Siguiente Número: $NWB#phones-auto_dial_next_number$NWE
Parar de Grabar después de cada llamada: $NWB#phones-VDstop_rec_after_each_call$NWE
Servidor de DBX: (Primario DB Server)$NWB#phones-DBX_server$NWE
Base de datos de DBX: (Primario Server Database)$NWB#phones-DBX_database$NWE
Usuario de DBX: (Primario DB Login)$NWB#phones-DBX_user$NWE
Contraseña de DBX: (Primario DB Secret)$NWB#phones-DBX_pass$NWE
Puerto de DBX: (Primario DB Port)$NWB#phones-DBX_port$NWE
Servidor de DBY: (Secundario DB Server)$NWB#phones-DBY_server$NWE
Base de datos de DBY: (Secundario Server Database)$NWB#phones-DBY_database$NWE
Usuario de DBY: (Secundario DB Login)$NWB#phones-DBY_user$NWE
Contraseña de DBY: (Secundario DB Secret)$NWB#phones-DBY_pass$NWE
Puerto de DBY: (Secundario DB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Pinchar aquí­ para ver las estadísticas del teléfono\n"; - -if ($LOGdelete_phones > 0) - { - echo "

SUPRIMA ESTE TELÉFONO\n"; - } - -} - -###################### -# ADD=41 submit server modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) - {echo "
SERVIDOR NOT MODIFIED - there is already a server in the system with this server_id\n";} - else - { - $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) - {echo "
SERVIDOR NO MODIFICADO - hay ya un servidor en el sistema con este server_ip\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVIDOR NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n";} - else - { - echo "
SERVIDOR MODIFICADO: $server_ip\n"; - - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; - $rslt=mysql_query($stmt, $link); - } - } - } - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFICAR UN REGISTRO DEL SERVIDOR: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Del Servidor: $NWB#servers-server_id$NWE
Descripción Del Servidor: $NWB#servers-server_description$NWE
Dirección IP del Servidor: $NWB#servers-server_ip$NWE
Activo: $NWB#servers-active$NWE
Versión De Asterisk: $NWB#servers-asterisk_version$NWE
Máx. Trunks en VICIDIAL: $NWB#servers-max_vicidial_trunks$NWE
Host Del Telnet: $NWB#servers-telnet_host$NWE
Puerto Del Telnet: $NWB#servers-telnet_port$NWE
Usuario Del Manager: $NWB#servers-ASTmgrUSERNAME$NWE
Contraseña del Manager: $NWB#servers-ASTmgrSECRET$NWE
Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extensión de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extensión del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Contexto por Defecto: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
TELÉFONOS DENTRO DE ESTE SERVIDOR:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
EXTENSIÓNNOMBREACTIVO
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Este servidor tiene $active_lists Teléfonos activos y $inactive_lists Teléfonos inactivos

\n"; -echo "
\n"; - -} - -###################### -# ADD=411 submit conference modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) - {echo "
CONFERENCIA - hay ya una conferencia en el sistema con esta extensión - servidor NO MODIFICADO\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCIA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n";} - else - { - echo "
CONFERENCIA MODIFICADA: $conf_exten\n"; - - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from conferences where conf_exten='$conf_exten';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFICAR UN REGISTRO DE LA CONFERENCIA: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conferencia: $NWB#conferences-conf_exten$NWE
IP Del Servidor: $NWB#conferences-server_ip$NWE
Extensión Actual:
\n"; - -echo "
\n"; - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo ""; - -echo "
BÚSQUEDA PARA Un TELÉFONO\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Extensión:
Nombre Completo:
Phone type:
\n"; - -} - -###################### -# ADD=66 phone search results -###################### - -if ($ADD==66) -{ - echo ""; - - $SQL = ''; - if ($extension) {$SQL .= "extension LIKE \"%$extension%\" and";} - if ($fullname) {$SQL .= "fullname LIKE \"%$fullname%\" and";} - if ($phone_type) {$SQL .= "phone_type LIKE \"%$phone_type%\" and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from phones $SQL order by extension,server_ip;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
RESULTADOS DE LA BÚSQUEDA:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFICAR | ESTADÍSTICAS
\n"; - -} - - - -###################### -# ADD=0 display all active phones -###################### -if ($ADD==0) -{ - echo ""; - - $stmt="SELECT * from phones order by extension,server_ip"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
LISTADOS DE TELÉFONOS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFICAR | ESTADÍSTICAS
\n"; -} - -###################### -# ADD=10 display all servers -###################### -if ($ADD==10) -{ - echo ""; - - $stmt="SELECT * from servers order by server_id"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
LISTADOS DEL SERVIDOR:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[1] $row[2] $row[4] $row[3]  MODIFICAR
\n"; -} - - -###################### -# ADD=100 display all conferences -###################### -if ($ADD==100) -{ - echo ""; - - $stmt="SELECT * from conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
LISTADOS DE CONFERENCIAS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]  MODIFICAR
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds"; -echo "             VERSIÓN: $version"; -echo "             CONSTRUCCION: $build
\n"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient_es/dbconnect.php b/LANG_admin/astguiclient_es/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_admin/astguiclient_es/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_admin/astguiclient_es/help.gif b/LANG_admin/astguiclient_es/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/astguiclient_es/help.gif and /dev/null differ diff --git a/LANG_admin/astguiclient_es/inbound_popup.php b/LANG_admin/astguiclient_es/inbound_popup.php deleted file mode 100644 index 3f158865..00000000 --- a/LANG_admin/astguiclient_es/inbound_popup.php +++ /dev/null @@ -1,228 +0,0 @@ - LICENSE: GPLv2 -### -# this is the inbound popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. -# -# changes: -# 60620-1329 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK SALIENTES REMOTOS: Popup - - -
- - 0) -{ - - $stmt="DELETE from parked_channels where server_ip='$user_server_ip' and parked_time='" . mysql_real_escape_string($parked_time) . "' and channel='" . mysql_real_escape_string($channel) . "' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$user_server_ip','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: " . mysql_real_escape_string($channel) . "','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Vuelva a dirigir el comando enviado para el canal $channel       $NOW_TIME\n

\n"; - - - $url = 'https://10.10.10.15/internal/back_end_systems/cust_serv/index.php?Search=SEARCH&'; - $Suser = 'username='; - $Spass = '&passwd='; - $Sphone = '&phone='; - - $newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW$Sphone$phone"; - if ( ($phone == 'unknown') or (strlen($phone)<9) ) - {$newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW";} - - echo "Mire para arriba a este cliente en sistema del servicio de cliente\n

\n"; - - echo "Cierre esta ventana\n

\n"; -} -else -{ - echo "Vuelva a dirigir el comando FALLADO para el canal $channel       $NOW_TIME\n

\n"; - echo "Cierre esta ventana\n

\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/astguiclient_es/phone_stats.php b/LANG_admin/astguiclient_es/phone_stats.php deleted file mode 100644 index c5286b55..00000000 --- a/LANG_admin/astguiclient_es/phone_stats.php +++ /dev/null @@ -1,244 +0,0 @@ - LICENSE: GPLv2 -# -# -# changes: -# 60620-1333 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$admin_page = './admin.php'; - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname from phones where server_ip='$server_ip' and extension='$extension'"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $row[0]; - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK ADMIN: Estadísticas Del Teléfono - - -
-
- - - - - - -\n"; -echo "
  ASTERISK ADMIN: Administración  
  ENUMERE TODOS LOS TELÉFONOS | AGREGUE Un TELÉFONO NUEVO | BÚSQUEDA PARA Un TELÉFONO | AGREGUE Un SERVIDOR | ENUMERE TODOS LOS SERVIDORES
  DEMUESTRE TODAS LAS CONFERENCIAS | AGREGUE Una NUEVA CONFERENCIA
  \n"; - -echo "\n"; -echo "\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' group by channel_group order by channel_group"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - -echo "
\n"; - -echo "TIEMPO DE LLAMADA Y CANALES:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} -# echo "|$stmt|\n"; - -echo "\n"; -echo "
GRUPO DE CANALES CUENTA HORAS:MINUTOS
$row[1] $row[0] $call_hours_int:$call_minutes_int
LLAMADAS TOTALES $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LLAMADAS DEL ÚLTIMO 1000 PARA LA GAMA DE LA FECHA:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='$extension' and server_ip='$server_ip' and start_time >= '$begin_date 0:00:01' and start_time <= '$end_date 23:59:59' LIMIT 1000"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - - - $call_seconds=0; - $o++; - } - - -echo "
NÚMERO GRUPO DE CANALES FECHA LENGTH(MIN.)
$row[0] $row[1] $row[2] $row[3]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/astguiclient_es/remote_inbound.php b/LANG_admin/astguiclient_es/remote_inbound.php deleted file mode 100644 index c49b8e59..00000000 --- a/LANG_admin/astguiclient_es/remote_inbound.php +++ /dev/null @@ -1,162 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$ENVIAR=$_GET["ENVIAR"]; if (!$ENVIAR) {$ENVIAR=$_POST["ENVIAR"];} - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - echo"\n"; - echo"ASTERISK ENTRANTES REMOTOS: Principal\n"; - echo"\n"; - echo"\n"; - echo"\n"; - -?> - - -
- -
\n"; - -echo "Chasque encendido el canal debajo de ése que usted quisiera haber dirigido a su teléfono

\n"; - -echo "
\n";
-echo "CHANNEL    SERVIDOR        CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME        \n";
-echo "----------------------------------------------------------------------------------------------\n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='$user_server_ip' order by parked_time";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='$user_server_ip' and channel_group LIKE \"IN_%\" order by parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$extension =		sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		echo "$channel$server$channel_group$extension$parked_by$parked_time\n";
-
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "*************************************** NO PARKED CALLS **************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial/AST_CLOSERstats.php b/LANG_admin/vicidial/AST_CLOSERstats.php deleted file mode 100644 index b7a7bb8c..00000000 --- a/LANG_admin/vicidial/AST_CLOSERstats.php +++ /dev/null @@ -1,396 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select group_id from vicidial_inbound_groups;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Closer Stats\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Closer Stats                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls placed from this Campaign:        $TOTALcalls\n";
-echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total DROP Calls:                             $DROPcalls  $DROPpercent%\n";
-echo "Average Length for DROP Calls in seconds:     $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/AST_VDADstats.php b/LANG_admin/vicidial/AST_VDADstats.php deleted file mode 100644 index 9ac17006..00000000 --- a/LANG_admin/vicidial/AST_VDADstats.php +++ /dev/null @@ -1,417 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls placed from this Campaign:        $TOTALcalls\n";
-echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total DROP Calls:                             $DROPcalls  $DROPpercent%\n";
-echo "Average Length for DROP Calls in seconds:     $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- AUTO-DIAL NO ANSWERS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='NA' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$NAcalls =	sprintf("%10s", $row[0]);
-$NApercent = (($NAcalls / $TOTALcalls) * 100);
-$NApercent = round($NApercent, 0);
-
-$average_na_seconds = ($row[1] / $row[0]);
-$average_na_seconds = round($average_na_seconds, 0);
-$average_na_seconds =	sprintf("%10s", $average_na_seconds);
-
-echo "Total NA calls -Busy,Disconnect,BTvoicemail:  $NAcalls  $NApercent%\n";
-echo "Average Call Length for NA Calls in seconds:  $average_na_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/AST_VICIDIAL_hopperlist.php b/LANG_admin/vicidial/AST_VICIDIAL_hopperlist.php deleted file mode 100644 index 1824a939..00000000 --- a/LANG_admin/vicidial/AST_VICIDIAL_hopperlist.php +++ /dev/null @@ -1,161 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.10.15';} - -$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $campaign_id[$i] =$row[0]; - $campaign_name[$i] =$row[1]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Hopper List\n"; -echo "
\n"; -#echo "\n"; -#echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Live Current Hopper List                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-
-echo "Total leads in hopper right now:       $TOTALcalls\n";
-
-
-##############################
-#########  LEAD STATS
-
-echo "\n";
-echo "---------- LEADS IN HOPPER\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-echo "|      | LEAD_ID   | PHONE NUM  | STATE | STATUS | COUNT | GMT    |\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$FMT_i =		sprintf("%-4s", $i);
-	$lead_id =		sprintf("%-9s", $row[0]);
-	$phone_number =	sprintf("%-10s", $row[1]);
-	$state =		sprintf("%-5s", $row[2]);
-	$status =		sprintf("%-6s", $row[3]);
-	$count =		sprintf("%-5s", $row[4]);
-	$gmt =			sprintf("%-6s", $row[5]);
-
-	echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt |\n";
-
-	$i++;
-	}
-
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/AST_admin_log_display.php b/LANG_admin/vicidial/AST_admin_log_display.php deleted file mode 100644 index b5286873..00000000 --- a/LANG_admin/vicidial/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
-
-#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
-passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/AST_agent_performance.php b/LANG_admin/vicidial/AST_agent_performance.php deleted file mode 100644 index a489bc7d..00000000 --- a/LANG_admin/vicidial/AST_agent_performance.php +++ /dev/null @@ -1,232 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Agent Performance\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:33:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:33:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:33:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:33:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial/AST_agent_performance_detail.php b/LANG_admin/vicidial/AST_agent_performance_detail.php
deleted file mode 100644
index 2dd3dc5e..00000000
--- a/LANG_admin/vicidial/AST_agent_performance_detail.php
+++ /dev/null
@@ -1,406 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($group)) {$group = '';}
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-$stmt="select campaign_id from vicidial_campaigns;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$campaigns_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $campaigns_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 03:45:00";   
-	$query_date_END = "$query_date 15:15:00";
-	$time_BEGIN = "03:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:15:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$TOTtotWAIT=($TOTtotWAIT + $row[7]);
-	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
-	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-	$USERtotPAUSE =	$row[5];
-	$USERavgPAUSE =	$row[6];
-	$USERtotWAIT =	$row[7];
-	$USERavgWAIT =	$row[8];
-	$USERtotDISPO =	$row[9];
-	$USERavgDISPO =	$row[10];
-
-	$USERtime_M = ($USERtime / 60);
-	$USERtime_M = round($USERtime_M, 2);
-	$USERtime_M_int = intval("$USERtime_M");
-	$USERtime_S = ($USERtime_M - $USERtime_M_int);
-	$USERtime_S = ($USERtime_S * 60);
-	$USERtime_S = round($USERtime_S, 0);
-	if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
-	$USERtime_MS = "$USERtime_M_int:$USERtime_S";
-	$pfUSERtime_MS[$i] =		sprintf("%7s", $USERtime_MS);
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-
-	$USERtotPAUSE_M = ($USERtotPAUSE / 60);
-	$USERtotPAUSE_M = round($USERtotPAUSE_M, 2);
-	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M");
-	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
-	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
-	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
-	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
-	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
-	$pfUSERtotPAUSE_MS[$i] =		sprintf("%6s", $USERtotPAUSE_MS);
-
-	$USERavgPAUSE_M = ($USERavgPAUSE / 60);
-	$USERavgPAUSE_M = round($USERavgPAUSE_M, 2);
-	$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M");
-	$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
-	$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
-	$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
-	if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
-	$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
-	$pfUSERavgPAUSE_MS[$i] =		sprintf("%6s", $USERavgPAUSE_MS);
-
-	$USERtotWAIT_M = ($USERtotWAIT / 60);
-	$USERtotWAIT_M = round($USERtotWAIT_M, 2);
-	$USERtotWAIT_M_int = intval("$USERtotWAIT_M");
-	$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
-	$USERtotWAIT_S = ($USERtotWAIT_S * 60);
-	$USERtotWAIT_S = round($USERtotWAIT_S, 0);
-	if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
-	$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
-	$pfUSERtotWAIT_MS[$i] =		sprintf("%6s", $USERtotWAIT_MS);
-
-	$USERavgWAIT_M = ($USERavgWAIT / 60);
-	$USERavgWAIT_M = round($USERavgWAIT_M, 2);
-	$USERavgWAIT_M_int = intval("$USERavgWAIT_M");
-	$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
-	$USERavgWAIT_S = ($USERavgWAIT_S * 60);
-	$USERavgWAIT_S = round($USERavgWAIT_S, 0);
-	if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
-	$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
-	$pfUSERavgWAIT_MS[$i] =		sprintf("%6s", $USERavgWAIT_MS);
-	
-	$USERtotDISPO_M = ($USERtotDISPO / 60);
-	$USERtotDISPO_M = round($USERtotDISPO_M, 2);
-	$USERtotDISPO_M_int = intval("$USERtotDISPO_M");
-	$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
-	$USERtotDISPO_S = ($USERtotDISPO_S * 60);
-	$USERtotDISPO_S = round($USERtotDISPO_S, 0);
-	if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
-	$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
-	$pfUSERtotDISPO_MS[$i] =		sprintf("%6s", $USERtotDISPO_MS);
-
-	$USERavgDISPO_M = ($USERavgDISPO / 60);
-	$USERavgDISPO_M = round($USERavgDISPO_M, 2);
-	$USERavgDISPO_M_int = intval("$USERavgDISPO_M");
-	$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
-	$USERavgDISPO_S = ($USERavgDISPO_S * 60);
-	$USERavgDISPO_S = round($USERavgDISPO_S, 0);
-	if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
-	$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
-	$pfUSERavgDISPO_MS[$i] =		sprintf("%6s", $USERavgDISPO_MS);
-
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]);	$TOT_CB = ($TOT_CB + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtime_M = ($TOTtime / 60);
-	$TOTtime_M = round($TOTtime_M, 2);
-	$TOTtime_M_int = intval("$TOTtime_M");
-	$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
-	$TOTtime_S = ($TOTtime_S * 60);
-	$TOTtime_S = round($TOTtime_S, 0);
-	if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
-	$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
-	$TOTtime_MS =		sprintf("%7s", $TOTtime_MS);
-		while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOTtotDISPO_M = ($TOTtotDISPO / 60);
-	$TOTtotDISPO_M = round($TOTtotDISPO_M, 2);
-	$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M");
-	$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
-	$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
-	$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
-	if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
-	$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
-	$TOTtotDISPO_MS =		sprintf("%7s", $TOTtotDISPO_MS);
-		while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
-
-	$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
-	$TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2);
-	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M");
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
-	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
-	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
-	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
-	$TOTtotPAUSE_MS =		sprintf("%7s", $TOTtotPAUSE_MS);
-		while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
-
-	$TOTtotWAIT_M = ($TOTtotWAIT / 60);
-	$TOTtotWAIT_M = round($TOTtotWAIT_M, 2);
-	$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M");
-	$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
-	$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
-	$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
-	if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
-	$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
-	$TOTtotWAIT_MS =		sprintf("%7s", $TOTtotWAIT_MS);
-		while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
-
-
-	$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);
-	$TOTavgTALK_M = round($TOTavgTALK_M, 2);
-	$TOTavgTALK_M_int = intval("$TOTavgTALK_M");
-	$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
-	$TOTavgTALK_S = ($TOTavgTALK_S * 60);
-	$TOTavgTALK_S = round($TOTavgTALK_S, 0);
-	if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
-	$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
-	$TOTavgTALK_MS =		sprintf("%6s", $TOTavgTALK_MS);
-		while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
-
-	$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);
-	$TOTavgDISPO_M = round($TOTavgDISPO_M, 2);
-	$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M");
-	$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
-	$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
-	$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
-	if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
-	$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
-	$TOTavgDISPO_MS =		sprintf("%6s", $TOTavgDISPO_MS);
-		while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
-
-	$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);
-	$TOTavgPAUSE_M = round($TOTavgPAUSE_M, 2);
-	$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M");
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
-	$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
-	if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
-	$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
-	$TOTavgPAUSE_MS =		sprintf("%6s", $TOTavgPAUSE_MS);
-		while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
-
-	$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);
-	$TOTavgWAIT_M = round($TOTavgWAIT_M, 2);
-	$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M");
-	$TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int);
-	$TOTavgWAIT_S = ($TOTavgWAIT_S * 60);
-	$TOTavgWAIT_S = round($TOTavgWAIT_S, 0);
-	if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";}
-	$TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S";
-	$TOTavgWAIT_MS =		sprintf("%6s", $TOTavgWAIT_MS);
-		while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
-
-	
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_CB = sprintf("%-5s", $TOT_CB);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial/AST_agent_time_sheet.php b/LANG_admin/vicidial/AST_agent_time_sheet.php
deleted file mode 100644
index 46659eb6..00000000
--- a/LANG_admin/vicidial/AST_agent_time_sheet.php
+++ /dev/null
@@ -1,281 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
-	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["calls_summary"]))				{$calls_summary=$_GET["calls_summary"];}
-	elseif (isset($_POST["calls_summary"]))		{$calls_summary=$_POST["calls_summary"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from available agent log data\n";
-}
-
-else
-{
-$query_date_BEGIN = "$query_date 00:00:00";   
-$query_date_END = "$query_date 23:59:59";
-$time_BEGIN = "00:00:00";   
-$time_END = "23:59:59";
-
-$stmt="select full_name from vicidial_users where user='$agent';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$full_name = $row[0];
-
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n";
-
-if ($calls_summary)
-	{
-	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
-
-		$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "TOTAL CALLS TAKEN: $row[0]\n";
-	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
-	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
-	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
-	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
-	echo "----------------------------------------------------------------\n";
-	echo "TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial/AST_agent_time_sheet_archive.php b/LANG_admin/vicidial/AST_agent_time_sheet_archive.php
deleted file mode 100644
index f14eca16..00000000
--- a/LANG_admin/vicidial/AST_agent_time_sheet_archive.php
+++ /dev/null
@@ -1,281 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1721 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
-	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["calls_summary"]))				{$calls_summary=$_GET["calls_summary"];}
-	elseif (isset($_POST["calls_summary"]))		{$calls_summary=$_POST["calls_summary"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from available agent log data\n";
-}
-
-else
-{
-$query_date_BEGIN = "$query_date 00:00:00";   
-$query_date_END = "$query_date 23:59:59";
-$time_BEGIN = "00:00:00";   
-$time_END = "23:59:59";
-
-$stmt="select full_name from vicidial_users where user='$agent';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$full_name = $row[0];
-
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n";
-
-if ($calls_summary)
-	{
-	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log_archive where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
-
-		$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "TOTAL CALLS TAKEN: $row[0]\n";
-	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
-	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
-	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
-	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
-	echo "----------------------------------------------------------------\n";
-	echo "TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log_archive where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log_archive where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial/AST_parkstats.php b/LANG_admin/vicidial/AST_parkstats.php
deleted file mode 100644
index eef768ca..00000000
--- a/LANG_admin/vicidial/AST_parkstats.php
+++ /dev/null
@@ -1,396 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1717 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($group)) {$group = '';}
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-$stmt="select distinct channel_group from park_log;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$groups_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $groups_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Park Stats\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A GROUP AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Park Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(parked_sec) from park_log where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls taken in this Group:              $TOTALcalls\n";
-echo "Average Hold Time(seconds) for all Calls:     $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(parked_sec) from park_log where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Dropped Calls:                          $DROPcalls  $DROPpercent%\n";
-echo "Average Hold Time(seconds) for Dropped Calls: $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select park_log.user,full_name,count(*),sum(talked_sec),avg(talked_sec) from park_log,vicidial_users where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and park_log.user is not null and talked_sec is not null and talked_sec > 4 and park_log.user=vicidial_users.user group by park_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:00:00' and parked_time <= '$query_date $h:14:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:00:00' and parked_time <= '$query_date $h:14:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:15:00' and parked_time <= '$query_date $h:29:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:15:00' and parked_time <= '$query_date $h:29:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:30:00' and parked_time <= '$query_date $h:44:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:30:00' and parked_time <= '$query_date $h:44:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:45:00' and parked_time <= '$query_date $h:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:45:00' and parked_time <= '$query_date $h:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/AST_server_performance.php b/LANG_admin/vicidial/AST_server_performance.php deleted file mode 100644 index fdedb9d9..00000000 --- a/LANG_admin/vicidial/AST_server_performance.php +++ /dev/null @@ -1,310 +0,0 @@ - LICENSE: GPLv2 -# -# CHANGES -# -# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -# path from root to where ploticus files will be stored -$DOCroot = "$WeBServeRRooT/vicidial/ploticus/"; - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($group)) {$group = '';} - -$stmt="select server_ip from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Server Performance\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "             REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:32:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:32:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- TOTALS, PEAKS and AVERAGES\n";
-
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGload =	sprintf("%10s", $row[0]);
-$AVGchannels =	sprintf("%10s", $row[1]);
-
-$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGcpuUSER =	sprintf("%10s", $row[0]);
-$AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
-$AVGcpuIDLE =	sprintf("%10s", $row[2]);
-
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-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','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
-
-
-echo "Total Calls in/out on this server:        $TOTALcalls\n";
-echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
-echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
-echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
-echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
-
-echo "\n";
-echo "---------- LINE GRAPH:\n";
-
-
-
-##############################
-#########  Graph stats
-
-$DAT = '.dat';
-$HTM = '.htm';
-$PNG = '.png';
-$filedate = date("Y-m-d_His");
-$DATfile = "$group$query_date$shift$filedate$DAT";
-$HTMfile = "$group$query_date$shift$filedate$HTM";
-$PNGfile = "$group$query_date$shift$filedate$PNG";
-
-$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
-$DATfp = fopen ("$DOCroot/$DATfile", "a");
-
-$stmt="select DATE_FORMAT(start_time,'%H:%i:%s') as timex,sysload,processes,channels_total,live_recordings,cpu_user_percent,cpu_system_percent from server_performance where server_ip='" . mysql_real_escape_string($group) . "' and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' order by timex;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$row[5] = intval(($row[5] + $row[6]) * $HIGHmulti);
-	$row[6] = intval($row[6] * $HIGHmulti);
-	fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
-	$i++;
-	}
-fclose($DATfp);
-
-$rows_to_max = ($rows_to_print + 100);
-
-
-
-$HTMcontent  = '';
-$HTMcontent .= "#proc page\n";
-$HTMcontent .= "#if @DEVICE in png,gif\n";
-$HTMcontent .= "   scale: 0.6\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#endif\n";
-$HTMcontent .= "#proc getdata\n";
-$HTMcontent .= "file: $DOCroot/$DATfile\n";
-$HTMcontent .= "fieldnames: userproc sysproc time load processes channels\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc areadef\n";
-$HTMcontent .= "title: Server $group   $query_date_BEGIN to $query_date_END\n";
-$HTMcontent .= "titledetails: size=14  align=C\n";
-$HTMcontent .= "rectangle: 1 1 14 7\n";
-$HTMcontent .= "xscaletype: time hh:mm:ss\n";
-$HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
-$HTMcontent .= "stubformat: hh:mm:ssa\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc yaxis\n";
-$HTMcontent .= "stubs: inc 50\n";
-$HTMcontent .= "grid: color=yellow\n";
-$HTMcontent .= "gridskip: min\n";
-$HTMcontent .= "ticincrement: 100 1000\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: userproc\n";
-$HTMcontent .= "linedetails: color=purple width=.5\n";
-$HTMcontent .= "fill: lavender\n";
-$HTMcontent .= "legendlabel: user proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: sysproc\n";
-$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
-$HTMcontent .= "fill: dullyellow\n";
-$HTMcontent .= "legendlabel: system proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: load\n";
-$HTMcontent .= "linedetails: color=blue width=.5\n";
-$HTMcontent .= "legendlabel: load\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: processes\n";
-$HTMcontent .= "linedetails: color=red width=.5\n";
-$HTMcontent .= "legendlabel: processes\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: channels\n";
-$HTMcontent .= "linedetails: color=green width=.5\n";
-$HTMcontent .= "legendlabel: channels\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc legend\n";
-$HTMcontent .= "location: max-2 max\n";
-$HTMcontent .= "seglen: 0.2\n";
-$HTMcontent .= "\n";
-
-fwrite ($HTMfp, "$HTMcontent");
-fclose($HTMfp);
-
-
-passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
-
-sleep(1);
-
-echo "
\n"; -echo "\n"; -echo "\n"; - - -echo ""; - -} - - - -?> - - \ No newline at end of file diff --git a/LANG_admin/vicidial/AST_timeonVDAD.php b/LANG_admin/vicidial/AST_timeonVDAD.php deleted file mode 100644 index 52efd9cc..00000000 --- a/LANG_admin/vicidial/AST_timeonVDAD.php +++ /dev/null @@ -1,255 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 60620-1040 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Agents Time On Calls                         $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL    | STATUS | START TIME          | MINUTES |\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	$agentcount=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED",$row[4]))
-			{
-			$row[3]='';
-			$row[5]=' - WAITING - ';
-			$row[6]=$row[7];
-			}
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$sessionid =		sprintf("%-9s", $row[2]);
-		$channel =			sprintf("%-10s", $row[3]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[4]);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 5) {$G=''; $EG='';}
-		if ($call_time_M_int >= 10) {$G=''; $EG='';}
-		if (eregi("PAUSED",$row[4])) 
-			{
-			if ($call_time_M_int >= 1) 
-				{$i++; continue;} 
-			else
-				{$G=''; $EG='';}
-			}
-
-		$agentcount++;
-		echo "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-		echo "  $agentcount agents logged in on server $server_ip\n\n";
-
-		echo "             - Paused agents\n";
-		echo "             - 5 minutes or more on call\n";
-		echo "             - Over 10 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-echo "| CHANNEL    | STATUS | CAMPAIGN | PHONE NUMBER       | START TIME          | MINUTES |\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-8s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-		echo "  $i calls being placed on server $server_ip\n\n";
-
-		echo "             - LIVE CALL WAITING\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "******************************* NO LIVE CALLS WAITING *********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - diff --git a/LANG_admin/vicidial/AST_timeonVDAD_closer.php b/LANG_admin/vicidial/AST_timeonVDAD_closer.php deleted file mode 100644 index eb7d3c39..00000000 --- a/LANG_admin/vicidial/AST_timeonVDAD_closer.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# CHANGES -# -# 60620-1037 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - -\n"; -echo " - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Agents Time On Calls                         $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
-			}
-		$extension[$i] =		sprintf("%-10s", $row[0]);
-		$user[$i] =				sprintf("%-6s", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
-			$cc[$i]=0;
-		while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
-			{
-			$channel[$i] = eregi_replace(".$","",$channel[$i]);   
-			$cc[$i]++;
-			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
-			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
-			$cd[$i]=0;
-		while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
-			{
-			$start_time[$i] = eregi_replace("^.","",$start_time[$i]);   
-			$cd[$i]++;
-			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
-			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
-
-		$call_time_M[$i] = ($call_time_S[$i] / 60);
-		$call_time_M[$i] = round($call_time_M[$i], 2);
-		$call_time_M_int[$i] = intval("$call_time_M[$i]");
-		$call_time_SEC[$i] = ($call_time_M[$i] - $call_time_M_int[$i]);
-		$call_time_SEC[$i] = ($call_time_SEC[$i] * 60);
-		$call_time_SEC[$i] = round($call_time_SEC[$i], 0);
-		if ($call_time_SEC[$i] < 10) {$call_time_SEC[$i] = "0$call_time_SEC[$i]";}
-		$call_time_MS[$i] = "$call_time_M_int[$i]:$call_time_SEC[$i]";
-		$call_time_MS[$i] =		sprintf("%7s", $call_time_MS[$i]);
-		$i++;
-		}
-		$ext_count = $i;
-		$i=0;
-	while ($i < $ext_count)
-		{
-
-		$stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$camp_to_print = mysql_num_rows($rslt);
-		if ($camp_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$campaign = sprintf("%-12s", $row[0]);
-			$camp_color = $row[0];
-			}
-		else
-			{$campaign = 'DEAD        ';   	$camp_color = 'DEAD';}
-		if (eregi("READY|PAUSED|CLOSER",$status[$i]))
-			{$campaign = '            ';   	$camp_color = '';}
-
-		$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$xfer_to_print = mysql_num_rows($rslt);
-		if ($xfer_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$fronter = sprintf("%-6s", $row[0]);
-			}
-		else
-			{$fronter = '      ';}
-
-		$G = '';		$EG = '';
-		$G=""; $EG='';
-	#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
-	#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-
-		echo "| $G$extension[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-		echo "  $i agents logged in on server $server_ip\n\n";
-
-	#	echo "             - 5 minutes or more on call\n";
-	#	echo "             - Over 10 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-#echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-echo "| CHANNEL             | STATUS | CAMPAIGN     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-19s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 19) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 19) {$cc=101;}
-			}
-		$start_time =		sprintf("%-8s", $row[5]);
-			$cd=0;
-		while ( (strlen($start_time) > 8) and ($cd < 100) )
-			{
-			$start_time = eregi_replace("^.","",$start_time);   
-			$cd++;
-			if (strlen($start_time) <= 8) {$cd=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-12s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-		echo "  $i calls being placed on server $server_ip\n\n";
-
-		echo "             - LIVE CALL WAITING\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "******************************* NO LIVE CALLS WAITING *********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/AST_timeonVDADall.php b/LANG_admin/vicidial/AST_timeonVDADall.php deleted file mode 100644 index 540a5eb6..00000000 --- a/LANG_admin/vicidial/AST_timeonVDADall.php +++ /dev/null @@ -1,349 +0,0 @@ - LICENSE: GPLv2 -# -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60511-1343 - Added leads and drop info at the top of the screen -# 60608-1539 - Fixed CLOSER tallies for active calls -# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($group)) {$group='';} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -$rslt=mysql_query($stmt, $link); -if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!isset($RR)) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if (!isset($reset_counter)) {$reset_counter=0;} -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VICIDIAL: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$HOPlev = $row[8]; - -echo "
"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$VDhop = $row[0]; - -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
DIAL LEVEL:  $row[0]    STATUSES:  $row[1], $row[2], $row[3], $row[4], $row[5]     ORDER:  $row[6]     FILTER:  $row[7]    
HOPPER LEVEL:  $HOPlev     LEADS IN HOPPER:  $VDhop     DIALABLE LEADS:  $DAleads       TIME:
CALLS TODAY:  $callsTODAY     CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
"; - - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; - } -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - diff --git a/LANG_admin/vicidial/AST_timeonVDADall_SIPmonitor.php b/LANG_admin/vicidial/AST_timeonVDADall_SIPmonitor.php deleted file mode 100644 index 0b24f82e..00000000 --- a/LANG_admin/vicidial/AST_timeonVDADall_SIPmonitor.php +++ /dev/null @@ -1,301 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTERN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - - - - - - diff --git a/LANG_admin/vicidial/AST_timeoncall.php b/LANG_admin/vicidial/AST_timeoncall.php deleted file mode 100644 index fc8eeced..00000000 --- a/LANG_admin/vicidial/AST_timeoncall.php +++ /dev/null @@ -1,180 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Call\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Call                                          $NOW_TIME\n\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-echo "| STATION    | SESSIONID | CHANNEL   | NUMBER DIALED    | START TIME          | MINUTES |\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-
-$stmt="SELECT count(*) from live_sip_channels where server_ip='$server_ip';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="select extension from live_channels where server_ip='$server_ip';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$ext_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_zap_counter=0;
-	$sessions = '';
-	while ($i < $ext_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if (preg_match("/^8600/i",$row[0]))
-			{
-			$sessions .= "$row[0]|";
-			}
-		$i++;
-		}
-	$sessions = preg_replace("/\|$/",'',$sessions);
-
-	if ($DB) {echo "SESSIONS: -$sessions-\n";}
-
-	$stmt="select * from live_sip_channels where server_ip='$server_ip' order by channel;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_calls_counter=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ( (preg_match("/Zap\/|internal|ring/i",$row[3])) or (preg_match("/Local\//i",$row[0])) )
-			{
-			if ($DB) {echo "NOT STATION |$row[0]|$row[3]|\n";}
-			$session_id = '';
-			}
-		else 
-			{
-			if (preg_match("/$row[3]/i",$sessions))
-				{
-				if ($DB) {echo "LIVE STATION|$row[0]|$row[3]|\n";}
-				$session_id = $row[3];
-				$station = preg_replace("/SIP\//",'',$row[0]);
-				$station = preg_replace("/-.*/",'',$station);
-			
-				$LIVE_sessions[$live_calls_counter] =			"$session_id";
-				$LIVE_sessions_FORMAT[$live_calls_counter] =	sprintf("%-9s", $session_id);
-				$LIVE_stations[$live_calls_counter] =			"$station";
-				$LIVE_stations_FORMAT[$live_calls_counter] =	sprintf("%-10s", $station);
-
-		#		echo "| $station | $session_id | \n";
-
-				$live_calls_counter++;
-				}
-			else
-				{
-				if ($DB) {echo "NOT STATIONZ|$row[0]|$row[3]|\n";}
-				$session_id = '';
-				}
-			}
-
-		$i++;
-		}
-
-		if ($live_calls_counter > 0)
-		{
-		$i=0;
-		$LC_counter = $live_calls_counter;
-
-		while ($i < $live_calls_counter)
-			{
-			$stmt="select channel,extension,number_dialed,start_time,start_epoch from call_log where extension='$LIVE_stations[$i]' and server_ip='$server_ip' order by uniqueid desc LIMIT 1;";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$parked_to_print = mysql_num_rows($rslt);
-			$row=mysql_fetch_row($rslt);
-
-			$channel =			sprintf("%-9s", $row[0]);
-			$number_dialed =	sprintf("%-16s", $row[2]);
-			$start_time =		sprintf("%-19s", $row[3]);
-			$call_time_S = ($STARTtime - $row[4]);
-
-			$call_time_M = ($call_time_S / 60);
-			$call_time_M = round($call_time_M, 2);
-			$call_time_M_int = intval("$call_time_M");
-			$call_time_SEC = ($call_time_M - $call_time_M_int);
-			$call_time_SEC = ($call_time_SEC * 60);
-			$call_time_SEC = round($call_time_SEC, 0);
-			if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-			$call_time_MS = "$call_time_M_int:$call_time_SEC";
-			$call_time_MS =		sprintf("%7s", $call_time_MS);
-			$G = '';		$EG = '';
-			if ($call_time_M_int >= 12) {$G=''; $EG='';}
-			if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-			echo "| $G$LIVE_stations_FORMAT[$i]$EG | $G$LIVE_sessions_FORMAT[$i]$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-			$i++;
-			}
-
-		echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-		echo "  $i stations on live calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on live call\n";
-		echo "             - Over 30 minutes on live call\n";
-
-		}
-		else
-		{
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*************************************** NO LIVE STATIONS ********************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		}
-
-	}
-	else
-	{
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*************************************** NO LIVE STATIONS ********************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	}
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/AST_timeonpark.php b/LANG_admin/vicidial/AST_timeonpark.php deleted file mode 100644 index 2bc03bb1..00000000 --- a/LANG_admin/vicidial/AST_timeonpark.php +++ /dev/null @@ -1,197 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$timeONEhoursAGO = ($STARTtime - 3600); -$epochHALFhoursAGO = ($STARTtime - 1860); -$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO); -$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - $stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Park\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Park                       $NOW_TIME\n\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 1) {$G=''; $EG='';}
-		if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+-----------------+---------------------+---------+\n";
-		echo "  $i callers waiting on server $server_ip\n\n";
-
-		echo "             - 1 minute or more on hold\n";
-		echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	echo "******************** NO LIVE CALLS WAITING *********************\n";
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	}
-
-###################################################################################
-###### TIME ON INBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Agents Time On Inbound Calls                             $NOW_TIME\n\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-echo "| STATION    | USER   | CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 12) {$G=''; $EG='';}
-		if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-		echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-		echo "  $i agents on calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on call\n";
-		echo "             - Over 30 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/admin-old.php b/LANG_admin/vicidial/admin-old.php deleted file mode 100644 index 2adf48f2..00000000 --- a/LANG_admin/vicidial/admin-old.php +++ /dev/null @@ -1,2289 +0,0 @@ -0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN: "; - -if ($ADD==1) {echo "Add New User";} -if ($ADD==11) {echo "Add New Campaign";} -if ($ADD==111) {echo "Add New List";} -if ($ADD==1111) {echo "Add New In-Group";} -if ($ADD==11111) {echo "Add New Remote Agents";} -if ($ADD==111111) {echo "Add New Users Group";} -if ($ADD==2) {echo "New User Addition";} -if ($ADD==21) {echo "New Campaign Addition";} -if ($ADD==22) {echo "New Campaign Status Addition";} -if ($ADD==211) {echo "New List Addition";} -if ($ADD==2111) {echo "New In-Group Addition";} -if ($ADD==21111) {echo "New Remote Agents Addition";} -if ($ADD==211111) {echo "New Users Group Addition";} -if ($ADD==3) {echo "Modify User";} -if ($ADD==31) {echo "Modify Campaign";} -if ($ADD==311) {echo "Modify List";} -if ($ADD==3111) {echo "Modify In-Group";} -if ($ADD==31111) {echo "Modify Remote Agents";} -if ($ADD==311111) {echo "Modify Users Groups";} -if ($ADD==4) {echo "Modify User";} -if ($ADD==41) {echo "Modify Campaign";} -if ($ADD==42) {echo "Modify Campaign Status";} -if ($ADD==411) {echo "Modify List";} -if ($ADD==4111) {echo "Modify In-Group";} -if ($ADD==41111) {echo "Modify Remote Agents";} -if ($ADD==411111) {echo "Modify Users Group";} -if ($ADD==0) {echo "Welcome";} -if ($ADD==10) {echo "Campaigns";} -if ($ADD==100) {echo "Lists";} -if ($ADD==1000) {echo "In-Groups";} -if ($ADD==10000) {echo "Remote Agents";} -if ($ADD==100000) {echo "User Groups";} -if ($ADD==5) {echo "Search Form";} -if ($ADD==6) {echo "Search Results";} -if ($ADD==99999) {echo "HELP";} - -if ( (strlen($ADD)>4) && ($ADD < 99998) ) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rsltx=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rsltx); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rsltx=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rsltx); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rsltx=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rsltx); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<50) - { - if ($group_id_value == $groups[$p]) - { - $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; - } - $p++; - } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; - $o++; - } - if (strlen($groups_value)>2) {$groups_value .= " -";} - } - - - - - -$NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
VICIDIAL ADMIN: HELP


\n"; - -?> -VICIDIAL_USERS TABLE

- -
-User ID - This field is where you put the VICIDIAL user's ID number, can be up to 8 digits in length, Must be at least 2 characters in length. - -
-
-
-Password - This field is where you put the VICIDIAL user's password. Must be at least 2 characters in length. - -
-
-
-Full Name - This field is where you put the VICIDIAL user's full name. Must be at least 2 characters in length. - -
-
-
-User Level - This menu is where you select the VICIDIAL user's user level. Must be a level of 1 to log into VICIDIAL, Must be level greater than 2 to log in as a closer, Must be user level 8 or greater to get into admin web section. - -
-
-
-User Group - This menu is where you select the VICIDIAL user's group that this user will belong to. This does not have any restrictions at this time, this is just to subdivide users and allow for future features based upon it. - - -



- -VICIDIAL_CAMPAIGNS TABLE

-
-
-Campaign ID - This is the short name of the campaign, it is not editable after initial submission, cannot contain spaces and must be between 2 and 8 characters in length. - -
-
-
-Campaign Name - This is the description of the campaign, it must be between 6 and 40 characters in length. - -
-
-
-Active - This is where you set the campaign to Active or Inactive. If Inactive, noone can log into it. - -
-
-
-Park Extension - This is where you can customize the on-hold music for VICIDIAL. Make sure the extension is in place in the extensions.conf and that it points to the filename below. - -
-
-
-Park File Name - This is where you can customize the on-hold music for VICIDIAL. Make sure the filename is 10 characters in length or less and that the file is in place in the /var/lib/asterisk/sounds directory. - -
-
-
-Web Form - This is where you can set the custom web page that will be opened when the user clicks on the WEB FORM button. - -
-
-
-Allow Closers - This is where you can set whether the users of this campaign will have the option to send the call to a closer. - -
-
-
-Dial Status - This is where you set the statuses that you are wanting to dial on within the lists that are active for the campaign below - -
-
-
-List Order - This menu is where you select how the leads(that match the statuses selected above) will be put in the lead hopper: -
  - DOWN: select the first leads loaded into the vicidial_list table -
  - UP: select the last leads loaded into the vicidial_list table -
  - UP PHONE: select the highest phone number and works it's way down -
  - DOWN PHONE: select the lowest phone number and works it's way up -
  - UP LAST NAME: starts with last names starting with Z and works it's way down -
  - DOWN LAST NAME: starts with last names starting with A and works it's way up -
  - UP COUNT: starts with most called leads and works its way down -
  - DOWN COUNT: starts with least called leads and works it's way up -
  - DOWN COUNT 2nd NEW: starts with least called leads and works it's way up inserting a NEW lead in every other lead(Must NOT have NEW selected in the dial statuses) -
  - DOWN COUNT 3nd NEW: starts with least called leads and works it's way up inserting a NEW lead in every third lead(Must NOT have NEW selected in the dial statuses) -
  - DOWN COUNT 4th NEW: starts with least called leads and works it's way up inserting a NEW lead in every forth lead(Must NOT have NEW selected in the dial statuses) - -
-
-
-Hopper Level - This is how many leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute. - -
-
-
-Force Reset of Hopper - This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. - -
-
-
-Auto Dial Level - This is where you set how many lines VICIDIAL should use per active agent. zero (0) means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. - -
-
-
-Local Call Time - This is where you set during which hours you would like to dial, as determined by the local time in the are in which you are calling. This is controlled by area code and is adjusted for Daylight Savings time if applicable. General Guidelines in the USA for Business to Business is 9am to 5pm and Business to Consumer calls is 9am to 9pm. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Dial Timeout - If defined, calls that would normally hangup after the timeout defined in extensions.conf would instead timeout at this amount of seconds if it is less than the extensions.conf timeout. This allows for quickly changing dial timeouts from server to server and limiting the effects to a single campaign. If you are having a lot of Answering Machine or Voicemail calls you may want to try changing this value to between 21-26 and see if results improve. - -
-
-
-Dial Prefix - This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dialplan(extensions.conf). - -
-
-
-Campaign CallerID - This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. This option is only available if you are using PRIs(ISDN T1s or E1s) that have the custom callerid feature turned on. This feature may also work with IAX2 trunks depending on what your provider allows. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID. - -
-
-
-Campaign VDAD extension - This field allows for a custom VDAD transfer extension. This allows you to use different VDADtransfer...agi scripts depending upon your campaign. The default transfer AGI(exten 8365 [agi-VDADtransfer.agi]) just immediately sends the calls on to agents as soon as they are picked up. An additional sample political survey AGI is also now included (8366 [agi-VDADtransferSURVEY.agi]) that plays a message to the called person and allows them to make a choice by pressing buttons(effectively pre-screening the lead). Please note that except for surveys, political calls and charities this form of calling is illegal in the United States. - - -



- -VICIDIAL_LISTS TABLE

-
-
-List ID - This is the numerical name of the list, it is not editable after initial submission, must contain only numbers and must be between 2 and 8 characters in length. - -
-
-
-List Name - This is the description of the list, it must be between 2 and 20 characters in length. - -
-
-
-Campaign - This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time. - -
-
-
-Active - This defines whether the list is to be dialed on or not. - -
-
-
-Reset Lead-Called-Status for this list - This resets all leads in this list to N for "not called since last reset" and means that any lead can now be called if it is the right status as defined in the campaign screen. - - -



- -VICIDIAL_INBOUND_GROUPS TABLE

-
-
-Group ID - This is the short name of the inbound group, it is not editable after initial submission, must not contain any spaces and must be between 2 and 20 characters in length. - -
-
-
-Group Name - This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes '-', plusses '+' or spaces ' '. - -
-
-
-Group Color - This is the color that displays in the VICIDIAL client app when a call comes in on this group. It must be between 2 and 7 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or VICIDIAL will not work properly. - -
-
-
-Active - This determines whether this group show up in the selection box when a VICIDIAL agent logs in. - -
-
-
-Web Form - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this group. - -
-
-
-Voicemail - If defined, this is the Voicemail box that calls will go to instead of being dropped if no agents are available after the hold time is up. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. - -
-
-
-Fronter Display - This field determines whether the inbound VICIDIAL agent would have the fronter name(if there is one) displayed in the Status field when the call comes to the agent. - - - -



- -VICIDIAL_REMOTE_AGENTS TABLE

-
-
-User ID Start - This is the starting User ID that is used when the remote agent entries are inserted into the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new VICIDIAL user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account. - -
-
-
-Number of Lines - This defines how many remote agent entries the system creates, and determines how many lines it thinks it can safely send to the number below. - -
-
-
-Server IP - A remote agent entry is only good for one specific server, here is where you select which server you want. - -
-
-
-External Extension - This is the number that you want the calls forwarded to. Make sure that it is a full dialplan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system. - -
-
-
-Status - Here is where you turn the remote agent on and off. As soon as the agent is Active the system assumes that it can send calls to it. It may take up to 30 seconds once you change the status to Inactive to stop receiving calls. - -
-
-
-Campaign - Here is where you select the campaign that these remote agents will be logged into. Inbound needs to use the CLOSER campaign and select the inbound campaigns below that you want to receive calls from. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - - -



- -VICIDIAL_CAMPAIGN_LISTS

-
-
-The lists within this campaign are listed here, whether they are active is denoted by the Y or N and you can go to the list screen by clicking on the list ID in the first column. - - -



- -VICIDIAL_CAMPAIGN_STATUSES TABLE

-
-
-Through the use of Custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition. - - - - - -



- -VICIDIAL_USER_GROUPS TABLE

-
-
-User Group - This is the short name of a Vicidial User group, try not to use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters. - -
-
-
-Group Name - This is the description of the vicidial user group max of 40 characters. - - - - - -



- -VICIDIAL LIST LOADER FUNCTIONALITY

-
-
-The VICIDIAL web-based lead loader is designed simply to take a lead file(up to 8MB in size) that is either tab or pipe delimited and load it into the vicidial_list table. The lead loader does not do data validation or check for duplicates in itself or other lists, so that is something you need to do before you load the leads. Also, make sure that you have created the list that these leads are to be under so that you can use them. There is also the matter of time-zone-coding these leads. You may want to increase the frequency that the ADMIN_adjust_GMTnow_on_leads.pl is being run in the cron on your Asterisk server so that any loaded leads can be coded faster. Here is a list of the fields in their proper order for the lead files: -
    -
  1. Vendor Lead Code - shows up in the Vendor ID field of the GUI -
  2. Source Code - internal use only for admins and DBAs -
  3. List ID - the list number that these leads will show up under -
  4. Phone Code - the prefix for the phone number(1 for US, 01144 for UK, 01161 for AUS, etc) -
  5. Phone Number - must be at least 8 digits long -
  6. Title - title of the customer(Mr. Ms. Mrs, etc...) -
  7. First Name -
  8. Middle Initial -
  9. Last Name -
  10. Address Line 1 -
  11. Address Line 2 -
  12. Address Line 3 -
  13. City -
  14. State - limited to 2 characters -
  15. Province -
  16. Postal Code -
  17. Country -
  18. Gender -
  19. Date of Birth -
  20. Alternate Phone Number -
  21. Email Address -
  22. Security Phrase -
  23. Comments -
- - - -







-







-THE END -
- - - - - -
- - - - - - - -
  VICIDIAL ADMIN - Logout  
  LIST USERS | ADD NEW USER | SEARCH FOR A USER | ADD USER GROUP | LIST USER GROUPS
  ADD CAMPAIGN | LIST CAMPAIGNS | SHOW LISTS | ADD NEW LIST |               | LOAD NEW LEADS
  SHOW IN-GROUPS | ADD NEW IN-GROUP | SHOW REMOTE AGENTS | ADD NEW REMOTE AGENTS
  SERVER STATS | PARK REPORT | VDAD REPORT | CLOSER REPORT |               | SEARCH FOR A LEAD | GROUP HOURLY
-"; - -echo "
ADD A NEW USER
\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group: $NWB#vicidial_users-user_group$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN -###################### - -if ($ADD==11) -{ -echo ""; - -echo "
ADD A NEW CAMPAIGN\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $NWB#vicidial_campaigns-park_ext$NWE
Park Filename: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ -echo ""; - -echo "
ADD A NEW LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List ID: (digits only)$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
\n"; - -} - - -###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN -###################### - -if ($ADD==1111) -{ -echo ""; - -echo "
ADD A NEW INBOUND GROUP\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
\n"; - -} - - -###################### -# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN -###################### - -if ($ADD==11111) -{ -echo ""; - -echo "
ADD NEW REMOTE AGENTS\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dialplan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - -###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN -###################### - -if ($ADD==111111) -{ -echo ""; - -echo "
ADD NEW USERS GROUP\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -} - - -###################### -# ADD=2 adds the new person to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USER NOT ADDED - there is already a user in the system with this user number\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
USER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
user id must be between 2 and 8 characters long\n"; - echo "
full name and password must be at least 2 characters long\n"; - } - else - { - echo "
USER ADDED: $user\n"; - - $stmt="INSERT INTO vicidial_users values('','$user','$pass','$full_name','$user_level','$user_group');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level'|\n"); - fclose($fp); - } - } -$ADD=0; -} - -###################### -# ADD=21 adds the new campaign to the system -###################### - -if ($ADD==21) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) ) - { - echo "
CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n"; - echo "
campaign ID must be between 2 and 8 characters in length\n"; - echo "
campaign name must be between 6 and 40 characters in length\n"; - } - else - { - echo "
CAMPAIGN ADDED: $campaign_id\n"; - - $stmt="INSERT INTO vicidial_campaigns values('$campaign_id','$campaign_name','$active','','','','','','DOWN','$park_ext','$park_file_name','$web_form_address','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','','','','');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN |$PHP_AUTH_USER|$ip|'$campaign_id','$campaign_name','$active','','','','','','DOWN','$park_ext','$park_file_name','$web_form_address','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','','','',''|\n"); - fclose($fp); - - } - } -$ADD=31; -} - -###################### -# ADD=22 adds the new campaign status to the system -###################### - -if ($ADD==22) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a campaign-status in the system with this name\n";} - else - { - $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a global-status in the system with this name\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 8 characters in length\n"; - echo "
status name must be between 2 and 30 characters in length\n"; - } - else - { - echo "
CAMPAIGN STATUS ADDED: $campaign_id - $status\n"; - - $stmt="INSERT INTO vicidial_campaign_statuses values('$status','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN STATUS |$PHP_AUTH_USER|$ip|'$status','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - - } - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new list to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
LIST NOT ADDED - there is already a list in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or (strlen($list_id) < 2) or (strlen($list_id) > 8) ) - { - echo "
LIST NOT ADDED - Please go back and look at the data you entered\n"; - echo "
List ID must be between 2 and 8 characters in length\n"; - echo "
List name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST ADDED: $list_id\n"; - - $stmt="INSERT INTO vicidial_lists values('$list_id','$list_name','$campaign_id','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|'$list_id','$list_name','$campaign_id','$active'|\n"); - fclose($fp); - - } - } -$ADD=311; -} - - - -###################### -# ADD=2111 adds the new inbound group to the system -###################### - -if ($ADD==2111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
GROUP NOT ADDED - there is already a group in the system with this ID\n";} - else - { - if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi('-',$group_id)) or (eregi('+',$group_id)) ) - { - echo "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; - echo "
Group name and group color must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_inbound_groups values('$group_id','$group_name','$group_color','$active','$web_form_address','$voicemail_ext','$next_agent_call','$fronter_display');"; - $rslt=mysql_query($stmt, $link); - - echo "
GROUP ADDED: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|'$group_id','$group_name','$group_color','$active','$web_form_address','$voicemail_ext','$next_agent_call','$fronter_display'|\n"); - fclose($fp); - - } - } -$ADD=1000; -} - - -###################### -# ADD=21111 adds new remote agents to the system -###################### - -if ($ADD==21111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
REMOTE AGENTS NOT ADDED - there is already a remote agents entry starting with this userID\n";} - else - { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
User ID start and external extension must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTE AGENTS ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - - } - } -$ADD=10000; -} - -###################### -# ADD=211111 adds new user group to the system -###################### - -if ($ADD==211111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USER GROUP NOT ADDED - there is already a user group entry with this name\n";} - else - { - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_user_groups values('$user_group','$group_name');"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW USER GROUP ENTRY |$PHP_AUTH_USER|$ip|'$user_group','$group_name'|\n"); - fclose($fp); - - } - } -$ADD=100000; -} - - - - - -###################################################################################################### -###################################################################################################### -####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below -###################################################################################################### -###################################################################################################### - - - -###################### -# ADD=4 submit user modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group' where user='$user'|\n"); - fclose($fp); - - } - -$ADD=3; # go to user modification below -} - -###################### -# ADD=41 submit campaign modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - - $stmt="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten' where campaign_id='$campaign_id'|$reset_hopper|\n"); - fclose($fp); - - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=42 delete campaign status in the system -###################### - -if ($ADD==42) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - } - else - { - echo "
CUSTOM CAMPAIGN STATUS DELETED: $campaign_id - $status\n"; - - $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status'|\n"); - fclose($fp); - - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=411 submit list modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) - { - echo "
LIST NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
list name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST MODIFIED: $list_id\n"; - - $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') - { - echo "
RESETTING LIST-CALLED-STATUS\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - ### LOG RESET TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } - if ($campaign_id != "$old_campaign_id") - { - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id'|\n"); - fclose($fp); - - } - -$ADD=311; # go to list modification form below -} - - -###################### -# ADD=4111 modify group info in the system -###################### - -if ($ADD==4111) -{ - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) - { - echo "
GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
group name and group color must be at least 2 characters in length\n"; - } - else - { - echo "
GROUP MODIFIED: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='$web_form_address', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|group_name='$group_name',group_color='$group_color',active='$active', web_form_address='$web_form_address', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display' where group_id='$group_id'|\n"); - fclose($fp); - - } - -$ADD=3111; # go to group modification form below -} - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
User ID Start and External Extension must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTE AGENTS MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - - } - -$ADD=31111; # go to remote agents modification form below -} - - - -###################### -# ADD=411111 modify user group info in the system -###################### - -if ($ADD==411111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group'|\n"); - fclose($fp); - - } - -$ADD=311111; # go to user group modification form below -} - - - - - - - - -###################################################################################################### -###################################################################################################### -####### 3 series, record modification forms -###################################################################################################### -###################################################################################################### - - - - -###################### -# ADD=3 modify user info in the system -###################### - -if ($ADD==3) -{ - echo ""; - - $stmt="SELECT * from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[5]; - -echo "
MODIFY A USER'S RECORD: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User Number: $row[1]$NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group: $NWB#vicidial_users-user_group$NWE
\n"; - -echo "

Click here for user stats\n"; - -} - - -###################### -# ADD=31 modify campaign info in the system -###################### - -if ($ADD==31) -{ - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - -echo "
MODIFY A CAMPAIGN'S RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; -echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Web Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Dial status 1: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE
List Order: $NWB#vicidial_campaigns-lead_order$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Dial Timeout: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Dial Prefix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Campaign CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Campaign VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
\n"; - - ##### calculate what gmt_offset_now values are within the allowed local_call_time setting - if ($local_call_time == '24hours') - { - $p='13'; - $GMT_allowed = ''; - while ($p > -13) - { - $tz = sprintf("%.2f", $p); $GMT_allowed = "$GMT_allowed'$tz',"; - $p = ($p - 0.25); - } - } - if ($local_call_time == '9am-9pm') - { - $p='13'; - $GMT_allowed = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $phour=gmdate("G", time() + $pzone); - if ( ($phour >= 9) && ($phour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed = "$GMT_allowed'$tz',";} - $p = ($p - 0.25); - } - } - if ($local_call_time == '9am-5pm') - { - $p='13'; - $GMT_allowed = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $phour=gmdate("G", time() + $pzone); - if ( ($phour >= 9) && ($phour <= 16) ){$tz = sprintf("%.2f", $p); $GMT_allowed = "$GMT_allowed'$tz',";} - $p = ($p - 0.25); - } - } - if ($local_call_time == '12pm-5pm') - { - $p='13'; - $GMT_allowed = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $phour=gmdate("G", time() + $pzone); - if ( ($phour >= 12) && ($phour <= 16) ){$tz = sprintf("%.2f", $p); $GMT_allowed = "$GMT_allowed'$tz',";} - $p = ($p - 0.25); - } - } - if ($local_call_time == '12pm-9pm') - { - $p='13'; - $GMT_allowed = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $phour=gmdate("G", time() + $pzone); - if ( ($phour >= 12) && ($phour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed = "$GMT_allowed'$tz',";} - $p = ($p - 0.25); - } - } - if ($local_call_time == '5pm-9pm') - { - $p='13'; - $GMT_allowed = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $phour=gmdate("G", time() + $pzone); - if ( ($phour >= 17) && ($phour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed = "$GMT_allowed'$tz',";} - $p = ($p - 0.25); - } - } - - $GMT_allowed = "$GMT_allowed'99'"; - - - - - - - - - - -echo "
\n"; -echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\n"; - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and gmt_offset_now IN($GMT_allowed)"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rsltx_rows = mysql_num_rows($rsltx); - if ($rsltx_rows) - { - $rowx=mysql_fetch_row($rsltx); - $active_leads = "$rowx[0]"; - } - else {$active_leads = '0';} - -echo "This campaign has $active_leads leads to be dialed in those lists

\n"; - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $hopper_leads = "$rowx[0]"; - -echo "This campaign has $hopper_leads leads in the dial hopper

\n"; -echo "Click here to see what leads are in the hopper right now

\n"; -echo "
\n"; - - - - -echo "
\n"; -echo "
CUSTOM STATUSES WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_statuses$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; - $rsltx=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rsltx); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
STATUSDESCRIPTIONSELECTABLEDELETE
$rowx[0]$rowx[1]$rowx[2]DELETE
\n"; - -echo "
ADD NEW CUSTOM CAMPAIGN STATUS
\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Description:   \n"; -echo "Selectable:   \n"; -echo "
\n"; - -echo "

\n"; - -} - - -###################### -# ADD=311 modify list info in the system -###################### - -if ($ADD==311) -{ - echo ""; - - $stmt="SELECT * from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $campaign_id = $row[2]; - $active = $row[3]; - -echo "
MODIFY A LIST'S RECORD: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List ID: $row[0]$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
Reset Lead-Called-Status for this list: $NWB#vicidial_lists-reset_list$NWE
\n"; - -echo "
\n"; -echo "
STATUSES WITHIN THIS LIST:
\n"; -echo "\n"; -echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; - $rsltx=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rsltx); - - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $leads_in_list = ($leads_in_list + $rowx[2]); - - 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 "
STATUSCALLEDNOT CALLED
$rowx[0] $rowx[2]
$rowx[0]$rowx[2]
SUBTOTALS$leads_in_list_Y$leads_in_list_N
TOTAL$leads_in_list

\n"; - - - - - -echo "
\n"; -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]); - - $LOCALzone=3600 * $rowx[0]; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - - if ($rowx[0] >= 0) {$rowx[0] = "$plus$rowx[0]";} - 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 "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
$rowx[0]     ($LOCALdate) $rowx[2]
$rowx[0]     ($LOCALdate)$rowx[2]
SUBTOTALS$leads_in_list_Y$leads_in_list_N
TOTAL$leads_in_list

\n"; - - - - - - - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; - $rsltx=mysql_query($stmt, $link); - $status_called_to_print = mysql_num_rows($rsltx); - - $o=0; - $sts=0; - $first_row=1; - $all_called_first=1000; - $all_called_last=0; - while ($status_called_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $leads_in_list = ($leads_in_list + $rowx[2]); - $count_statuses[$o] = "$rowx[0]"; - $count_called[$o] = "$rowx[1]"; - $count_count[$o] = "$rowx[2]"; - $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); - - if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) - { - if ($first_row) {$first_row=0;} - else {$sts++;} - $status[$sts] = "$rowx[0]"; - $status_called_first[$sts] = "$rowx[1]"; - if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} - } - $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); - $status_called_last[$sts] = "$rowx[1]"; - if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} - - $o++; - } - - - - -echo "
\n"; -echo "
CALLED COUNTS WITHIN THIS LIST:
\n"; -echo "\n"; -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - echo ""; - $first++; - } -echo "\n"; - - $sts=0; - $statuses_called_to_print = count($status); - while ($statuses_called_to_print > $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 ""; - - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $sts)) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - else - { - if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - - $called_printed=0; - $o=0; - while ($status_called_to_print > $o) - { - if ( ($count_statuses[$o] == "$status[$sts]") and ($count_called[$o] == "$first") ) - { - $called_printed++; - echo ""; - } - - - $o++; - } - if (!$called_printed) - {echo "";} - $first++; - } - echo "\n\n"; - - $sts++; - } - -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - echo ""; - $first++; - } -echo "\n"; - -echo "
STATUS$firstSUBTOTAL
$status[$sts] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; - - - - - -echo "
\n"; - -} - - - -###################### -# ADD=3111 modify in-group info in the system -###################### - -if ($ADD==3111) -{ - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $group_name = $row[1]; - $group_color = $row[2]; - $active = $row[3]; - $web_form_address = $row[4]; - $voicemail_ext = $row[5]; - $next_agent_call = $row[6]; - $fronter_display = $row[7]; - -echo "
MODIFY A GROUP'S RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
Group ID: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
\n"; - -echo "

\n"; - -echo "
\n"; - -} - - - -###################### -# ADD=31111 modify remote agents info in the system -###################### - -if ($ADD==31111) -{ - echo ""; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dialplan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - -###################### -# ADD=311111 modify user group info in the system -###################### - -if ($ADD==311111) -{ - echo ""; - - $stmt="SELECT * from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; -echo ""; - -echo "
MODIFY A USERS GROUP ENTRY\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -} - - - - - - - - -###################### -# ADD=5 search form -###################### - -if ($ADD==5) -{ -echo ""; - -echo "
SEARCH FOR A USER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User Number:
Full Name:
User Level:
User Group:
\n"; - -} - -###################### -# ADD=6 user search results -###################### - -if ($ADD==6) -{ - echo ""; - - $SQL = ''; - if ($user) {$SQL .= " user LIKE \"%$user%\" and";} - if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";} - if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";} - if ($user_group) {$SQL .= " user_group LIKE \"%$user_group%\" and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SEARCH RESULTS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS
\n"; - -} - - - -###################### -# ADD=0 display all active users -###################### -if ($ADD==0) -{ - echo ""; - - $stmt="SELECT * from vicidial_users order by full_name"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS
\n"; -} - -###################### -# ADD=10 display all campaigns -###################### -if ($ADD==10) -{ - echo ""; - - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  MODIFY
\n"; -} - - -###################### -# ADD=100 display all lists -###################### -if ($ADD==100) -{ - echo ""; - - $stmt="SELECT * from vicidial_lists order by list_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
LIST LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]  MODIFY
\n"; -} - - - -###################### -# ADD=1000 display all inbound groups -###################### -if ($ADD==1000) -{ - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
INBOUND GROUP LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[5]  MODIFY
\n"; -} - - -###################### -# ADD=10000 display all remote agents -###################### -if ($ADD==10000) -{ - echo ""; - - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
REMOTE AGENTS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFY
\n"; -} - - -###################### -# ADD=100000 display all user groups -###################### -if ($ADD==100000) -{ - echo ""; - - $stmt="SELECT * from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER GROUPS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - - diff --git a/LANG_admin/vicidial/admin.php b/LANG_admin/vicidial/admin.php deleted file mode 100644 index e296c40c..00000000 --- a/LANG_admin/vicidial/admin.php +++ /dev/null @@ -1,6514 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["user_level"])) {$user_level=$_GET["user_level"];} - elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];} -if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} - elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["campaign_name"])) {$campaign_name=$_GET["campaign_name"];} - elseif (isset($_POST["campaign_name"])) {$campaign_name=$_POST["campaign_name"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["park_ext"])) {$park_ext=$_GET["park_ext"];} - elseif (isset($_POST["park_ext"])) {$park_ext=$_POST["park_ext"];} -if (isset($_GET["park_file_name"])) {$park_file_name=$_GET["park_file_name"];} - elseif (isset($_POST["park_file_name"])) {$park_file_name=$_POST["park_file_name"];} -if (isset($_GET["web_form_address"])) {$web_form_address=$_GET["web_form_address"];} - elseif (isset($_POST["web_form_address"])) {$web_form_address=$_POST["web_form_address"];} -if (isset($_GET["allow_closers"])) {$allow_closers=$_GET["allow_closers"];} - elseif (isset($_POST["allow_closers"])) {$allow_closers=$_POST["allow_closers"];} -if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} - elseif (isset($_POST["hopper_level"])) {$hopper_level=$_POST["hopper_level"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["next_agent_call"])) {$next_agent_call=$_GET["next_agent_call"];} - elseif (isset($_POST["next_agent_call"])) {$next_agent_call=$_POST["next_agent_call"];} -if (isset($_GET["local_call_time"])) {$local_call_time=$_GET["local_call_time"];} - elseif (isset($_POST["local_call_time"])) {$local_call_time=$_POST["local_call_time"];} -if (isset($_GET["voicemail_ext"])) {$voicemail_ext=$_GET["voicemail_ext"];} - elseif (isset($_POST["voicemail_ext"])) {$voicemail_ext=$_POST["voicemail_ext"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} - elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} -if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} - elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["group_color"])) {$group_color=$_GET["group_color"];} - elseif (isset($_POST["group_color"])) {$group_color=$_POST["group_color"];} -if (isset($_GET["fronter_display"])) {$fronter_display=$_GET["fronter_display"];} - elseif (isset($_POST["fronter_display"])) {$fronter_display=$_POST["fronter_display"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["dial_status_a"])) {$dial_status_a=$_GET["dial_status_a"];} - elseif (isset($_POST["dial_status_a"])) {$dial_status_a=$_POST["dial_status_a"];} -if (isset($_GET["dial_status_b"])) {$dial_status_b=$_GET["dial_status_b"];} - elseif (isset($_POST["dial_status_b"])) {$dial_status_b=$_POST["dial_status_b"];} -if (isset($_GET["dial_status_c"])) {$dial_status_c=$_GET["dial_status_c"];} - elseif (isset($_POST["dial_status_c"])) {$dial_status_c=$_POST["dial_status_c"];} -if (isset($_GET["dial_status_d"])) {$dial_status_d=$_GET["dial_status_d"];} - elseif (isset($_POST["dial_status_d"])) {$dial_status_d=$_POST["dial_status_d"];} -if (isset($_GET["dial_status_e"])) {$dial_status_e=$_GET["dial_status_e"];} - elseif (isset($_POST["dial_status_e"])) {$dial_status_e=$_POST["dial_status_e"];} -if (isset($_GET["lead_order"])) {$lead_order=$_GET["lead_order"];} - elseif (isset($_POST["lead_order"])) {$lead_order=$_POST["lead_order"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["campaign_vdad_exten"])) {$campaign_vdad_exten=$_GET["campaign_vdad_exten"];} - elseif (isset($_POST["campaign_vdad_exten"])) {$campaign_vdad_exten=$_POST["campaign_vdad_exten"];} -if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec_exten"];} - elseif (isset($_POST["campaign_rec_exten"])) {$campaign_rec_exten=$_POST["campaign_rec_exten"];} -if (isset($_GET["campaign_recording"])) {$campaign_recording=$_GET["campaign_recording"];} - elseif (isset($_POST["campaign_recording"])) {$campaign_recording=$_POST["campaign_recording"];} -if (isset($_GET["campaign_rec_filename"])) {$campaign_rec_filename=$_GET["campaign_rec_filename"];} - elseif (isset($_POST["campaign_rec_filename"])) {$campaign_rec_filename=$_POST["campaign_rec_filename"];} -if (isset($_GET["hotkey"])) {$hotkey=$_GET["hotkey"];} - elseif (isset($_POST["hotkey"])) {$hotkey=$_POST["hotkey"];} -if (isset($_GET["reset_list"])) {$reset_list=$_GET["reset_list"];} - elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} -if (isset($_GET["old_campaign_id"])) {$old_campaign_id=$_GET["old_campaign_id"];} - elseif (isset($_POST["old_campaign_id"])) {$old_campaign_id=$_POST["old_campaign_id"];} -if (isset($_GET["OLDuser_group"])) {$OLDuser_group=$_GET["OLDuser_group"];} - elseif (isset($_POST["OLDuser_group"])) {$OLDuser_group=$_POST["OLDuser_group"];} -if (isset($_GET["status_name"])) {$status_name=$_GET["status_name"];} - elseif (isset($_POST["status_name"])) {$status_name=$_POST["status_name"];} -if (isset($_GET["selectable"])) {$selectable=$_GET["selectable"];} - elseif (isset($_POST["selectable"])) {$selectable=$_POST["selectable"];} -if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} - elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["delete_users"])) {$delete_users=$_GET["delete_users"];} - elseif (isset($_POST["delete_users"])) {$delete_users=$_POST["delete_users"];} -if (isset($_GET["delete_user_groups"])) {$delete_user_groups=$_GET["delete_user_groups"];} - elseif (isset($_POST["delete_user_groups"])) {$delete_user_groups=$_POST["delete_user_groups"];} -if (isset($_GET["delete_lists"])) {$delete_lists=$_GET["delete_lists"];} - elseif (isset($_POST["delete_lists"])) {$delete_lists=$_POST["delete_lists"];} -if (isset($_GET["delete_campaigns"])) {$delete_campaigns=$_GET["delete_campaigns"];} - elseif (isset($_POST["delete_campaigns"])) {$delete_campaigns=$_POST["delete_campaigns"];} -if (isset($_GET["delete_ingroups"])) {$delete_ingroups=$_GET["delete_ingroups"];} - elseif (isset($_POST["delete_ingroups"])) {$delete_ingroups=$_POST["delete_ingroups"];} -if (isset($_GET["delete_remote_agents"])) {$delete_remote_agents=$_GET["delete_remote_agents"];} - elseif (isset($_POST["delete_remote_agents"])) {$delete_remote_agents=$_POST["delete_remote_agents"];} -if (isset($_GET["load_leads"])) {$load_leads=$_GET["load_leads"];} - elseif (isset($_POST["load_leads"])) {$load_leads=$_POST["load_leads"];} -if (isset($_GET["campaign_detail"])) {$campaign_detail=$_GET["campaign_detail"];} - elseif (isset($_POST["campaign_detail"])) {$campaign_detail=$_POST["campaign_detail"];} -if (isset($_GET["ast_admin_access"])) {$ast_admin_access=$_GET["ast_admin_access"];} - elseif (isset($_POST["ast_admin_access"])) {$ast_admin_access=$_POST["ast_admin_access"];} -if (isset($_GET["ast_delete_phones"])) {$ast_delete_phones=$_GET["ast_delete_phones"];} - elseif (isset($_POST["ast_delete_phones"])) {$ast_delete_phones=$_POST["ast_delete_phones"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} -if (isset($_GET["delete_scripts"])) {$delete_scripts=$_GET["delete_scripts"];} - elseif (isset($_POST["delete_scripts"])) {$delete_scripts=$_POST["delete_scripts"];} -if (isset($_GET["script_id"])) {$script_id=$_GET["script_id"];} - elseif (isset($_POST["script_id"])) {$script_id=$_POST["script_id"];} -if (isset($_GET["script_name"])) {$script_name=$_GET["script_name"];} - elseif (isset($_POST["script_name"])) {$script_name=$_POST["script_name"];} -if (isset($_GET["script_comments"])) {$script_comments=$_GET["script_comments"];} - elseif (isset($_POST["script_comments"])) {$script_comments=$_POST["script_comments"];} -if (isset($_GET["script_text"])) {$script_text=$_GET["script_text"];} - elseif (isset($_POST["script_text"])) {$script_text=$_POST["script_text"];} -if (isset($_GET["reset_hopper"])) {$reset_hopper=$_GET["reset_hopper"];} - elseif (isset($_POST["reset_hopper"])) {$reset_hopper=$_POST["reset_hopper"];} -if (isset($_GET["get_call_launch"])) {$get_call_launch=$_GET["get_call_launch"];} - elseif (isset($_POST["get_call_launch"])) {$get_call_launch=$_POST["get_call_launch"];} -if (isset($_GET["am_message_exten"])) {$am_message_exten=$_GET["am_message_exten"];} - elseif (isset($_POST["am_message_exten"])) {$am_message_exten=$_POST["am_message_exten"];} -if (isset($_GET["amd_send_to_vmx"])) {$amd_send_to_vmx=$_GET["amd_send_to_vmx"];} - elseif (isset($_POST["amd_send_to_vmx"])) {$amd_send_to_vmx=$_POST["amd_send_to_vmx"];} -if (isset($_GET["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_GET["xferconf_a_dtmf"];} - elseif (isset($_POST["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_POST["xferconf_a_dtmf"];} -if (isset($_GET["xferconf_a_number"])) {$xferconf_a_number=$_GET["xferconf_a_number"];} - elseif (isset($_POST["xferconf_a_number"])) {$xferconf_a_number=$_POST["xferconf_a_number"];} -if (isset($_GET["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_GET["xferconf_b_dtmf"];} - elseif (isset($_POST["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_POST["xferconf_b_dtmf"];} -if (isset($_GET["xferconf_b_number"])) {$xferconf_b_number=$_GET["xferconf_b_number"];} - elseif (isset($_POST["xferconf_b_number"])) {$xferconf_b_number=$_POST["xferconf_b_number"];} -if (isset($_GET["modify_leads"])) {$modify_leads=$_GET["modify_leads"];} - elseif (isset($_POST["modify_leads"])) {$modify_leads=$_POST["modify_leads"];} -if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} - elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} -if (isset($_GET["change_agent_campaign"])) {$change_agent_campaign=$_GET["change_agent_campaign"];} - elseif (isset($_POST["change_agent_campaign"])) {$change_agent_campaign=$_POST["change_agent_campaign"];} -if (isset($_GET["agent_choose_ingroups"])) {$agent_choose_ingroups=$_GET["agent_choose_ingroups"];} - elseif (isset($_POST["agent_choose_ingroups"])) {$agent_choose_ingroups=$_POST["agent_choose_ingroups"];} -if (isset($_GET["alt_number_dialing"])) {$alt_number_dialing=$_GET["alt_number_dialing"];} - elseif (isset($_POST["alt_number_dialing"])) {$alt_number_dialing=$_POST["alt_number_dialing"];} -if (isset($_GET["scheduled_callbacks"])) {$scheduled_callbacks=$_GET["scheduled_callbacks"];} - elseif (isset($_POST["scheduled_callbacks"])) {$scheduled_callbacks=$_POST["scheduled_callbacks"];} -if (isset($_GET["lead_filter_id"])) {$lead_filter_id=$_GET["lead_filter_id"];} - elseif (isset($_POST["lead_filter_id"])) {$lead_filter_id=$_POST["lead_filter_id"];} -if (isset($_GET["lead_filter_name"])) {$lead_filter_name=$_GET["lead_filter_name"];} - elseif (isset($_POST["lead_filter_name"])) {$lead_filter_name=$_POST["lead_filter_name"];} -if (isset($_GET["lead_filter_comments"])) {$lead_filter_comments=$_GET["lead_filter_comments"];} - elseif (isset($_POST["lead_filter_comments"])) {$lead_filter_comments=$_POST["lead_filter_comments"];} -if (isset($_GET["lead_filter_sql"])) {$lead_filter_sql=$_GET["lead_filter_sql"];} - elseif (isset($_POST["lead_filter_sql"])) {$lead_filter_sql=$_POST["lead_filter_sql"];} -if (isset($_GET["agentonly_callbacks"])) {$agentonly_callbacks=$_GET["agentonly_callbacks"];} - elseif (isset($_POST["agentonly_callbacks"])) {$agentonly_callbacks=$_POST["agentonly_callbacks"];} -if (isset($_GET["agentcall_manual"])) {$agentcall_manual=$_GET["agentcall_manual"];} - elseif (isset($_POST["agentcall_manual"])) {$agentcall_manual=$_POST["agentcall_manual"];} -if (isset($_GET["vicidial_recording"])) {$vicidial_recording=$_GET["vicidial_recording"];} - elseif (isset($_POST["vicidial_recording"])) {$vicidial_recording=$_POST["vicidial_recording"];} -if (isset($_GET["vicidial_transfers"])) {$vicidial_transfers=$_GET["vicidial_transfers"];} - elseif (isset($_POST["vicidial_transfers"])) {$vicidial_transfers=$_POST["vicidial_transfers"];} -if (isset($_GET["delete_filters"])) {$delete_filters=$_GET["delete_filters"];} - elseif (isset($_POST["delete_filters"])) {$delete_filters=$_POST["delete_filters"];} -if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_options=$_GET["alter_agent_interface_options"];} - elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];} -if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];} - elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];} -if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];} - elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];} -if (isset($_GET["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} -if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];} - elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];} -if (isset($_GET["drop_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} -if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];} - elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];} -if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];} - elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];} -if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];} - elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];} -if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];} - elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];} -if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];} - elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];} -if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];} - elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];} -if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];} - elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];} -if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];} - elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];} -if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];} - elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];} -if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];} - elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];} -if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];} - elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];} -if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];} - elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];} -if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];} - elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];} -if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];} - elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];} -if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];} - elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];} -if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];} - elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];} -if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];} - elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];} -if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];} - elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];} -if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];} - elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];} -if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];} - elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];} -if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];} - elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];} -if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];} - elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];} -if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];} - elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];} -if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];} - elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];} -if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];} - elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} -if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} - elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} -if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} - elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} -if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} - elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} - - if (isset($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS ONLY ### -$user_level = ereg_replace("[^0-9]","",$user_level); -$wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); -$drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); -$am_message_exten = ereg_replace("[^0-9]","",$am_message_exten); -$campaign_rec_exten = ereg_replace("[^0-9]","",$campaign_rec_exten); -$campaign_vdad_exten = ereg_replace("[^0-9]","",$campaign_vdad_exten); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); -$dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); -$park_ext = ereg_replace("[^0-9]","",$park_ext); -$hopper_level = ereg_replace("[^0-9]","",$hopper_level); -$agent_choose_ingroups = ereg_replace("[^0-9]","",$agent_choose_ingroups); -$hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); -$agentonly_callbacks = ereg_replace("[^0-9]","",$agentonly_callbacks); -$agentcall_manual = ereg_replace("[^0-9]","",$agentcall_manual); -$vicidial_recording = ereg_replace("[^0-9]","",$vicidial_recording); -$vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); -$closer_default_blended = ereg_replace("[^0-9]","",$closer_default_blended); -$alter_agent_interface_options = ereg_replace("[^0-9]","",$alter_agent_interface_options); -$delete_users = ereg_replace("[^0-9]","",$delete_users); -$delete_user_groups = ereg_replace("[^0-9]","",$delete_user_groups); -$delete_scripts = ereg_replace("[^0-9]","",$delete_scripts); -$delete_remote_agents = ereg_replace("[^0-9]","",$delete_remote_agents); -$delete_lists = ereg_replace("[^0-9]","",$delete_lists); -$delete_ingroups = ereg_replace("[^0-9]","",$delete_ingroups); -$delete_filters = ereg_replace("[^0-9]","",$delete_filters); -$delete_campaigns = ereg_replace("[^0-9]","",$delete_campaigns); -$delete_call_times = ereg_replace("[^0-9]","",$delete_call_times); -$load_leads = ereg_replace("[^0-9]","",$delete_call_times); -$campaign_detail = ereg_replace("[^0-9]","",$campaign_detail); -$ast_delete_phones = ereg_replace("[^0-9]","",$ast_delete_phones); -$ast_admin_access = ereg_replace("[^0-9]","",$ast_admin_access); -$modify_leads = ereg_replace("[^0-9]","",$modify_leads); -$change_agent_campaign = ereg_replace("[^0-9]","",$change_agent_campaign); -$modify_call_times = ereg_replace("[^0-9]","",$modify_call_times); -$ct_wednesday_stop = ereg_replace("[^0-9]","",$ct_wednesday_stop); -$ct_wednesday_start = ereg_replace("[^0-9]","",$ct_wednesday_start); -$ct_tuesday_stop = ereg_replace("[^0-9]","",$ct_tuesday_stop); -$ct_tuesday_start = ereg_replace("[^0-9]","",$ct_tuesday_start); -$ct_thursday_stop = ereg_replace("[^0-9]","",$ct_thursday_stop); -$ct_thursday_start = ereg_replace("[^0-9]","",$ct_thursday_start); -$ct_sunday_stop = ereg_replace("[^0-9]","",$ct_sunday_stop); -$ct_sunday_start = ereg_replace("[^0-9]","",$ct_sunday_start); -$ct_saturday_stop = ereg_replace("[^0-9]","",$ct_saturday_stop); -$ct_saturday_start = ereg_replace("[^0-9]","",$ct_saturday_start); -$ct_monday_stop = ereg_replace("[^0-9]","",$ct_monday_stop); -$ct_monday_start = ereg_replace("[^0-9]","",$ct_monday_start); -$ct_friday_stop = ereg_replace("[^0-9]","",$ct_friday_stop); -$ct_friday_start = ereg_replace("[^0-9]","",$ct_friday_start); -$ct_default_stop = ereg_replace("[^0-9]","",$ct_default_stop); -$ct_default_start = ereg_replace("[^0-9]","",$ct_default_start); -$number_of_lines = ereg_replace("[^0-9]","",$number_of_lines); -$user_start = ereg_replace("[^0-9]","",$user_start); -$phone_number = ereg_replace("[^0-9]","",$phone_number); -$remote_agent_id = ereg_replace("[^0-9]","",$remote_agent_id); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); -$attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); -$hotkey = ereg_replace("[^0-9]","",$hotkey); -$list_id = ereg_replace("[^0-9]","",$list_id); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); -$allow_closers = ereg_replace("[^NY]","",$allow_closers); -$reset_hopper = ereg_replace("[^NY]","",$reset_hopper); -$amd_send_to_vmx = ereg_replace("[^NY]","",$amd_send_to_vmx); -$alt_number_dialing = ereg_replace("[^NY]","",$alt_number_dialing); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); -$selectable = ereg_replace("[^NY]","",$selectable); -$reset_list = ereg_replace("[^NY]","",$reset_list); -$fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); -$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); - -### ALPHA-NUMERIC ONLY ### -$user = ereg_replace("[^0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^0-9a-zA-Z]","",$pass); -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); -$submit = ereg_replace("[^0-9a-zA-Z]","",$submit); -$CoNfIrM = ereg_replace("[^0-9a-zA-Z]","",$CoNfIrM); -$campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid); -$get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch); -$campaign_recording = ereg_replace("[^0-9a-zA-Z]","",$campaign_recording); -$ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD); -$dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix); -$state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state); -$scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); - -### DIGITS and Dots -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); - -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); - -### ALPHA-NUMERIC and underscore and dash -$dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); -$dial_status_d = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_d); -$dial_status_c = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_c); -$dial_status_b = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_b); -$dial_status_a = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_a); -$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage); -$lead_filter_id = ereg_replace("[^-\_0-9a-zA-Z]","",$lead_filter_id); -$campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id); -$old_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_campaign_id); -$park_file_name = ereg_replace("[^-\_0-9a-zA-Z]","",$park_file_name); -$next_agent_call = ereg_replace("[^-\_0-9a-zA-Z]","",$next_agent_call); -$local_call_time = ereg_replace("[^-\_0-9a-zA-Z]","",$local_call_time); -$call_time_id = ereg_replace("[^-\_0-9a-zA-Z]","",$call_time_id); -$phone_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_pass); -$phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); -$group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); -$user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); -$OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); -$state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); - -### ALPHA-NUMERIC and spaces -$lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); -### ALPHA-NUMERIC and hash -$group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); -$campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); -$status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); -$HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); -$status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); -$script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); -$script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); -$list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); -$lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); -$lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); -$campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); -$call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); -$call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - -### remove semi-colons ### -$lead_filter_sql = ereg_replace(";","",$lead_filter_sql); - -### VARIABLES TO BE mysql_real_escape_string ### -# $web_form_address -# $script_text - -##### END VARIABLE FILTERING FOR SECURITY ##### - - -# AST GUI database administration -# admin.php -# -# CHANGES -# 50315-1110 - Added Custom Campaign Statuses -# 50317-1438 - Added Fronter Display var to inbound groups -# 50322-1355 - Added custom callerID per campaign -# 50517-1356 - Added user_groups sections and user_group to vicidial_users -# 50517-1440 - Added ability to logout (must click OK with empty user/pass) -# 50602-1622 - Added lead loader pages to load new files into vicidial_list -# 50620-1351 - Added custom vdad transfer AGI extension per campaign -# 50810-1414 - modified in groups to kick out spaces and dashes -# 50908-2136 - Added Custom Campaign HotKeys -# 50914-0950 - Fixed user search by user_group -# 50926-1358 - Modified to allow for language translation -# 50926-1615 - Added WeBRooTWritablE write controls -# 51020-1008 - Added editable web address and park ext - NEW dial campaigns -# 51020-1056 - Added fields and help for campaign recording control -# 51123-1335 - Altered code to function in php globals=off -# 51208-1038 - Added user_level changes, function controls and default user phones -# 51208-1556 - Added deletion of users/lists/campaigns/in groups/remote agents -# 51213-1706 - Added add/delete/modify vicidial scripts -# 51214-1737 - Added preview of vicidial script in popup window -# 51219-1225 - Added campaign and ingroups script selector and get_call_launch field -# 51222-1055 - Added am_message_exten to campaigns to allow for AM Message button -# 51222-1125 - Fixed new vicidial_campaigns default values not being assigned bug -# 51222-1156 - Added LOG OUT ALL AGENTS ON THIS CAMPAIGN button to campaign screen -# 60204-0659 - Fixed hopper reset bug -# 60207-1413 - Added AMD send to voicemail extension and xfer-conf dtmf presets -# 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 -# 60417-1416 - Added vicidial_lead_filters sections -# - Changed the header links to color-coded sectional with sublinks below -# - Added filter name and script name to campaign and in-group modify sections -# - Added callback and alt dial options to campaigns section -# - Added callback, alt dial and other options to users section -# 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered -# 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60425-2355 - Added agent options to vicidial_users, reformatted user page -# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen -# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen -# 60505-1117 - Added initial framework for new local_call_times tables and definitions -# 60506-1033 - More revisions to the local_call_time section -# 60508-1354 - Finished call_times and state_call_times sections -# - Added modify/delete options for call_times -# 60509-1311 - Functionalize campaign dialable leads calculation -# - Change state_call_times selection from call_times to only allow one per state -# - Added dialable leads count popup to campaign screen if auto-calc is disabled -# - Added test dialable leads count popup to filter screen -# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen -# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen -# 60609-1051 - Added add-to-dnc in LISTS section -# 60613-1415 - Added lead recycling options to campaign detail screen -# 60619-1523 - Added variable filtering to eliminate SQL injection attack threat -# 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug -# - -# 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.12-3'; -$build = '60623-1159'; - -$STARTtime = date("U"); - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGuser_level =$row[4]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN: "; - -if (!isset($ADD)) {$ADD=0;} - -if ($ADD==1) {$hh='users'; echo "Add New User";} -if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";} -if ($ADD==111) {$hh='lists'; echo "Add New List";} -if ($ADD==121) {$hh='lists'; echo "Add New DNC";} -if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} -if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} -if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} -if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";} -if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";} -if ($ADD==111111111) {$hh='times'; echo "Add New Call Time";} -if ($ADD==1111111111) {$hh='times'; echo "Add New State Call Time";} -if ($ADD==2) {$hh='users'; echo "New User Addition";} -if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} -if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} -if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; echo "New Campaign Lead Recycle Addition";} -if ($ADD==211) {$hh='lists'; echo "New List Addition";} -if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} -if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";} -if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";} -if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";} -if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";} -if ($ADD==211111111) {$hh='times'; echo "New Call Time Addition";} -if ($ADD==2111111111) {$hh='times'; echo "New State Call Time Addition";} -if ($ADD==3) {$hh='users'; echo "Modify User";} -if ($ADD==31) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==34) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==311) {$hh='lists'; echo "Modify List";} -if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==311111111) {$hh='times'; echo "Modify Call Time";} -if ($ADD==321111111) {$hh='times'; echo "Modify Call Time State Definitions List";} -if ($ADD==3111111111) {$hh='times'; echo "Modify State Call Time";} -if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";} -if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";} -if ($ADD==4) {$hh='users'; echo "Modify User";} -if ($ADD==41) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==42) {$hh='campaigns'; echo "Modify Campaign Status";} -if ($ADD==43) {$hh='campaigns'; echo "Modify Campaign HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==45) {$hh='campaigns'; echo "Modify Campaign Lead Recycle";} -if ($ADD==411) {$hh='lists'; echo "Modify List";} -if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==411111111) {$hh='times'; echo "Modify Call Time";} -if ($ADD==4111111111) {$hh='times'; echo "Modify State Call Time";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==52) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==511111111) {$hh='times'; echo "Delete Call Time";} -if ($ADD==5111111111) {$hh='times'; echo "Delete State Call Time";} -if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==65) {$hh='campaigns'; echo "Delete Lead Recycle";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==611111111) {$hh='times'; echo "Delete Call Time";} -if ($ADD==6111111111) {$hh='times'; echo "Delete State Call Time";} -if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";} -if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} -if ($ADD==0) {$hh='users'; echo "Users List";} -if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} -if ($ADD==81) {$hh='campaigns'; echo "CallBacks Within Campaign";} -if ($ADD==811) {$hh='campaigns'; echo "CallBacks Within List";} -if ($ADD==10) {$hh='campaigns'; echo "Campaigns";} -if ($ADD==100) {$hh='lists'; echo "Lists";} -if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} -if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";} -if ($ADD==100000) {$hh='usergroups'; echo "User Groups";} -if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} -if ($ADD==10000000) {$hh='filters'; echo "Filters";} -if ($ADD==100000000) {$hh='times'; echo "Call Times";} -if ($ADD==1000000000) {$hh='times'; echo "State Call Times";} -if ($ADD==55) {$hh='users'; echo "Search Form";} -if ($ADD==66) {$hh='users'; echo "Search Results";} -if ($ADD==99999) {$hh='users'; echo "HELP";} - -if ( ($ADD>9) && ($ADD < 99998) ) - { - ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $scripts_to_print = mysql_num_rows($rslt); - $scripts_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($scripts_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $scriptname_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - $filters_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($filters_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $filtername_list["$rowx[0]"] = "$rowx[1]"; - $filtersql_list["$rowx[0]"] = "$rowx[2]"; - $o++; - } - - ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $times_to_print = mysql_num_rows($rslt); - - $o=0; - while ($times_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $call_timename_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - } - -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD==31) or ($ADD==41) or ($ADD=="4A") or ($ADD=="4B") ) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ($ADD==31) - { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ($ADD==3) - { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) - { - if ($group_id_value == $groups[$p]) - { - $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; - } - $p++; - } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; - $o++; - } - if (strlen($groups_value)>2) {$groups_value .= " -";} - } - - - - - -$NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
VICIDIAL ADMIN: HELP


\n"; - -?> -VICIDIAL_USERS TABLE

- -
-User ID - This field is where you put the VICIDIAL users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. - -
-
-
-Password - This field is where you put the VICIDIAL users password. Must be at least 2 characters in length. - -
-
-
-Full Name - This field is where you put the VICIDIAL users full name. Must be at least 2 characters in length. - -
-
-
-User Level - This menu is where you select the VICIDIAL users user level. Must be a level of 1 to log into VICIDIAL, Must be level greater than 2 to log in as a closer, Must be user level 8 or greater to get into admin web section. - -
-
-
-User Group - This menu is where you select the VICIDIAL users group that this user will belong to. This does not have any restrictions at this time, this is just to subdivide users and allow for future features based upon it. - -
-
-
-Phone Login - Here is where you can set a default phone login value for when the user logs into vicidial.php. This value will populate the phone_login automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen. - -
-
-
-Phone Pass - Here is where you can set a default phone pass value for when the user logs into vicidial.php. This value will populate the phone_pass automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen. - -
-
-
-HotKeys Active - This option if set to 1 allows the user to use the HotKeys quick-dispositioning function in vicidial.php. - -
-
-
-Agent Choose Ingroups - This option if set to 1 allows the user to choose the ingroups that they will receive calls from when they login to a CLOSER or INBOUND campaign. Otherwise the Manager will need to set this in their user detail screen of the admin page. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - -
-
-
-Scheduled Callbacks - This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated. - -
-
-
-Agent-Only Callbacks - This option allows an agent to set a callback so that they are the only Agent that can call the customer back. This also allows the agent to see their callback listings and call them back any time they want to. - -
-
-
-Agent Call Manual - This option allows an agent to manually enter a new lead into the system and call them. This also allows the calling of any phone number from their vicidial screen and puts that call into their session. Use this option with caution. - -
-
-
-Vicidial Recording - This option can prevent an agent from doing any recordings after they log in to vicidial. This option must be on for vicidial to follow the campaign recording session. - -
-
-
-Vicidial Transfers - This option can prevent an agent from opening the transfer - conference session of vicidial. If this is disabled, the agent cannot third party call or blind transfer any calls. - -
-
-
-Closer Default Blended - This option simply defaults the Blended checkbox on a CLOSER login screen. - -
-
-
-Alter Agent Interface Options - This option if set to 1 allows the administrative user to modify the Agents interface options in admin.php. - -
-
-
-Delete Users - This option if set to 1 allows the user to delete other users of equal or lesser user level from the system. - -
-
-
-Delete User Groups - This option if set to 1 allows the user to delete user groups from the system. - -
-
-
-Delete Lists - This option if set to 1 allows the user to delete vicidial lists from the system. - -
-
-
-Delete Campaigns - This option if set to 1 allows the user to delete vicidial campaigns from the system. - -
-
-
-Delete In-Groups - This option if set to 1 allows the user to delete vicidial In-Groups from the system. - -
-
-
-Delete Remote Agents - This option if set to 1 allows the user to delete vicidial remote agents from the system. - -
-
-
-Load Leads - This option if set to 1 allows the user to load vicidial leads into the vicidial_list table by way of the web based lead loader. - -
-
-
-Campaign Detail - This option if set to 1 allows the user to view and modify the campaign detail screen elements. - -
-
-
-AGC Admin Access - This option if set to 1 allows the user to login to the astGUIclient admin pages. - -
-
-
-AGC Delete Phones - This option if set to 1 allows the user to delete phone entries in the astGUIclient admin pages. - -
-
-
-Delete Scripts - This option if set to 1 allows the user to delete Campaign scripts in the script modification screen. - -
-
-
-Modify Leads - This option if set to 1 allows the user to modify leads in the admin section lead search results page. - -
-
-
-Change Agent Campaign - This option if set to 1 allows the user to alter the campaign that an agent is logged into while they are logged into it. - -
-
-
-Delete Filters - This option allows the user to be able to delete vicidial lead filters from the system. - -
-
-
-Delete Call Times - This option allows the user to be able to delete vicidial call times records and vicidial state call times records from the system. - -
-
-
-Modify Call Times - This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen. - - - - -



- -VICIDIAL_CAMPAIGNS TABLE

-
-
-Campaign ID - This is the short name of the campaign, it is not editable after initial submission, cannot contain spaces and must be between 2 and 8 characters in length. - -
-
-
-Campaign Name - This is the description of the campaign, it must be between 6 and 40 characters in length. - -
-
-
-Active - This is where you set the campaign to Active or Inactive. If Inactive, noone can log into it. - -
-
-
-Park Extension - This is where you can customize the on-hold music for VICIDIAL. Make sure the extension is in place in the extensions.conf and that it points to the filename below. - -
-
-
-Park File Name - This is where you can customize the on-hold music for VICIDIAL. Make sure the filename is 10 characters in length or less and that the file is in place in the /var/lib/asterisk/sounds directory. - -
-
-
-Web Form - This is where you can set the custom web page that will be opened when the user clicks on the WEB FORM button. - -
-
-
-Allow Closers - This is where you can set whether the users of this campaign will have the option to send the call to a closer. - -
-
-
-Dial Status - This is where you set the statuses that you are wanting to dial on within the lists that are active for the campaign below - -
-
-
-List Order - This menu is where you select how the leads that match the statuses selected above will be put in the lead hopper: -
  - DOWN: select the first leads loaded into the vicidial_list table -
  - UP: select the last leads loaded into the vicidial_list table -
  - UP PHONE: select the highest phone number and works its way down -
  - DOWN PHONE: select the lowest phone number and works its way up -
  - UP LAST NAME: starts with last names starting with Z and works its way down -
  - DOWN LAST NAME: starts with last names starting with A and works its way up -
  - UP COUNT: starts with most called leads and works its way down -
  - DOWN COUNT: starts with least called leads and works its way up -
  - DOWN COUNT 2nd NEW: starts with least called leads and works its way up inserting a NEW lead in every other lead - Must NOT have NEW selected in the dial statuses -
  - DOWN COUNT 3nd NEW: starts with least called leads and works its way up inserting a NEW lead in every third lead - Must NOT have NEW selected in the dial statuses -
  - DOWN COUNT 4th NEW: starts with least called leads and works its way up inserting a NEW lead in every forth lead - Must NOT have NEW selected in the dial statuses - -
-
-
-Hopper Level - This is how many leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute. - -
-
-
-Lead Filter - This is a method of filtering your leads using a fragment of a SQL query. Use this feature with caution, it is easy to stop dialing accidentally with the slightest alteration to the SQL statement. Default is NONE. - -
-
-
-Force Reset of Hopper - This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. - -
-
-
-Auto Dial Level - This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. -
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. - -
-
-
-Local Call Time - This is where you set during which hours you would like to dial, as determined by the local time in the are in which you are calling. This is controlled by area code and is adjusted for Daylight Savings time if applicable. General Guidelines in the USA for Business to Business is 9am to 5pm and Business to Consumer calls is 9am to 9pm. - -
-
-
-Dial Timeout - If defined, calls that would normally hangup after the timeout defined in extensions.conf would instead timeout at this amount of seconds if it is less than the extensions.conf timeout. This allows for quickly changing dial timeouts from server to server and limiting the effects to a single campaign. If you are having a lot of Answering Machine or Voicemail calls you may want to try changing this value to between 21-26 and see if results improve. - -
-
-
-Dial Prefix - This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dialplan - extensions.conf. - -
-
-
-Campaign CallerID - This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID. - -
-
-
-Campaign VDAD extension - This field allows for a custom VDAD transfer extension. This allows you to use different VDADtransfer...agi scripts depending upon your campaign. The default transfer AGI - exten 8365 agi-VDADtransfer.agi - just immediately sends the calls on to agents as soon as they are picked up. An additional sample political survey AGI is also now included - 8366 agi-VDADtransferSURVEY.agi - that plays a message to the called person and allows them to make a choice by pressing buttons - effectively pre-screening the lead - . Please note that except for surveys, political calls and charities this form of calling is illegal in the United States. - -
-
-
-Campaign Rec extension - This field allows for a custom recording extension to be used with VICIDIAL. This allows you to use different extensions depending upon how long you want to allow a maximum recording and what type of codec you want to record in. The default exten is 8309 which if you follow the SCRATCH_INSTALL examples will record in the WAV format for upto one hour. Another option included in the examples is 8310 which will record in GSM format for upto one hour. - -
-
-
-Campaign Recording - This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. - -
-
-
-Campaign Rec Filename - This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. - -
-
-
-Campaign Script - This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign. - -
-
-
-Get Call Launch - This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. - -
-
-
-Answering Machine Message - This field is for entering in an extension to blind transfer calls to when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this exten up in the dialplan - extensions.conf - and make sure it plays an audio file then hangs up. - -
-
-
-AMD send to vm exten - This menu allows you to define whether a message is left on an answering machine when it is detected. the call will be immediately forwarded to the Answering-Machine-Message extension if AMD is active and it is determined that the call is an answering machine. - -
-
-
-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. - -
-
-
-Agent Alt Num Dialing - This option allows an agent to manually dial the alternate phone number or address3 field after the main number has been called. - -
-
-
-Scheduled Callbacks - This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated. - -
-
-
-Drop Call Seconds - The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Safe Harbor Message - If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y. - -
-
-
-Safe Harbor Exten - This is the dialplan extension that the desired Safe Harbor audio file is located at on your server. - -
-
-
-Wrapup Seconds - The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition. - -
-
-
-Wrapup Message - This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set. - -
-
-
-Wrapup Message - This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set. - -
-
-
-Use Internal DNC List - This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N. - -
-
-
-Allowed Inbound Groups - For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. - - - -



- -VICIDIAL_LISTS TABLE

-
-
-List ID - This is the numerical name of the list, it is not editable after initial submission, must contain only numbers and must be between 2 and 8 characters in length. - -
-
-
-List Name - This is the description of the list, it must be between 2 and 20 characters in length. - -
-
-
-Campaign - This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time. - -
-
-
-Active - This defines whether the list is to be dialed on or not. - -
-
-
-Reset Lead-Called-Status for this list - This resets all leads in this list to N for "not called since last reset" and means that any lead can now be called if it is the right status as defined in the campaign screen. - -
-
-
-VICIDIAL DNC List - This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add a number to this list so that it will not be called by campaigns that use the internal DNC list. - - - -



- -VICIDIAL_INBOUND_GROUPS TABLE

-
-
-Group ID - This is the short name of the inbound group, it is not editable after initial submission, must not contain any spaces and must be between 2 and 20 characters in length. - -
-
-
-Group Name - This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes, plusses or spaces . - -
-
-
-Group Color - This is the color that displays in the VICIDIAL client app when a call comes in on this group. It must be between 2 and 7 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or VICIDIAL will not work properly. - -
-
-
-Active - This determines whether this group show up in the selection box when a VICIDIAL agent logs in. - -
-
-
-Web Form - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this group. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. -
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. - -
-
-
-Fronter Display - This field determines whether the inbound VICIDIAL agent would have the fronter name - if there is one - displayed in the Status field when the call comes to the agent. - -
-
-
-Campaign Script - This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign. - -
-
-
-Get Call Launch - This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. - -
-
-
-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. - -
-
-
-Drop Call Seconds - The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Drop Message - If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y. - -
-
-
-Drop Exten - This is the dialplan extension that the desired Dropped call audio file is located at on your server. - - - -



- -VICIDIAL_REMOTE_AGENTS TABLE

-
-
-User ID Start - This is the starting User ID that is used when the remote agent entries are inserted into the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new VICIDIAL user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account. - -
-
-
-Number of Lines - This defines how many remote agent entries the system creates, and determines how many lines it thinks it can safely send to the number below. - -
-
-
-Server IP - A remote agent entry is only good for one specific server, here is where you select which server you want. - -
-
-
-External Extension - This is the number that you want the calls forwarded to. Make sure that it is a full dialplan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system. - -
-
-
-Status - Here is where you turn the remote agent on and off. As soon as the agent is Active the system assumes that it can send calls to it. It may take up to 30 seconds once you change the status to Inactive to stop receiving calls. - -
-
-
-Campaign - Here is where you select the campaign that these remote agents will be logged into. Inbound needs to use the CLOSER campaign and select the inbound campaigns below that you want to receive calls from. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - - -



- -VICIDIAL_CAMPAIGN_LISTS

-
-
-The lists within this campaign are listed here, whether they are active is denoted by the Y or N and you can go to the list screen by clicking on the list ID in the first column. - - -



- -VICIDIAL_CAMPAIGN_STATUSES TABLE

-
-
-Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition. - - - -



- -VICIDIAL_CAMPAIGN_HOTKEYS TABLE

-
-
-Through the use of custom campaign hotkeys, agents that use the vicidial web-client can hangup and disposition calls just by pressing a single key on their keyboard. - - - - -



- -VICIDIAL_LEAD_RECYCLE TABLE

-
-
-Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links. This feature only works in auto-dial mode, where dial level is greater than 0. - - - - - -



- -VICIDIAL_USER_GROUPS TABLE

-
-
-User Group - This is the short name of a Vicidial User group, try not to use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters. - -
-
-
-Group Name - This is the description of the vicidial user group max of 40 characters. - - - - - -



- -VICIDIAL_SCRIPTS TABLE

-
-
-Script ID - This is the short name of a Vicidial Script. This needs to be a unique identifier. Try not to use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Script Name - This is the title of a Vicidial Script. This is a short summary of the script. max 50 characters, minimum of 2 characters. There should be no spaces or punctuation of any kind in theis field. - -
-
-Script Comments - This is where you can place comments for a Vicidial Script such as -changed to free upgrade on Sept 23-. max 255 characters, minimum of 2 characters. - -
-
-Script Text - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today? - -
-
-
-Active - This determines whether this script can be selected to be used by a campaign. - - - - - -



- -VICIDIAL_LEAD_FILTERS TABLE

-
-
-Filter ID - This is the short name of a Vicidial Lead Filter. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Filter Name - This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters. - -
-
-Filter Comments - This is where you can place comments for a Vicidial Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters. - -
-
-Filter SQL - This is where you place the SQL query fragment that you want to filter by. do not begin or end with an AND, that will be added by the hopper cron script automatically. an example SQL query that would work here is- called_count > 4 and called_count < 8 -. - - - - - -



- -VICIDIAL_CALL TIMES TABLE

-
-
-Call Time ID - This is the short name of a Vicidial Call Time Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Call Time Name - This is a more descriptive name of the Call Time Definition. This is a short summary of the Call Time definition. max 30 characters, minimum of 2 characters. - -
-
-Call Time Comments - This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters. - -
-
-Default Start and Stop Times - This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400. - -
-
-Weekday Start and Stop Times - These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times. - -
-
-State Call Time Definitions - This is the list of State specific call time definitions that are followed in this Call Time Definition. - -
-
-State Call Time State - This is the two letter code for the state that this calling time definition is for. For this to be in effect the local call time that is set in the campaign must have this state call time record in it as well as all of the leads having two letter state codes in them. - - - - -



- -VICIDIAL LIST LOADER FUNCTIONALITY

-
-
-The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. There is also a new beta version super lead loader that allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation or check for duplicates in itself or other lists, so that is something you need to do before you load the leads. Also, make sure that you have created the list that these leads are to be under so that you can use them. There is also the matter of time-zone-coding these leads. You may want to increase the frequency that the ADMIN_adjust_GMTnow_on_leads.pl is being run in the cron on your Asterisk server so that any loaded leads can be coded faster. Here is a list of the fields in their proper order for the lead files: -
    -
  1. Vendor Lead Code - shows up in the Vendor ID field of the GUI -
  2. Source Code - internal use only for admins and DBAs -
  3. List ID - the list number that these leads will show up under -
  4. Phone Code - the prefix for the phone number - 1 for US, 01144 for UK, 01161 for AUS, etc -
  5. Phone Number - must be at least 8 digits long -
  6. Title - title of the customer - Mr. Ms. Mrs, etc... -
  7. First Name -
  8. Middle Initial -
  9. Last Name -
  10. Address Line 1 -
  11. Address Line 2 -
  12. Address Line 3 -
  13. City -
  14. State - limited to 2 characters -
  15. Province -
  16. Postal Code -
  17. Country -
  18. Gender -
  19. Date of Birth -
  20. Alternate Phone Number -
  21. Email Address -
  22. Security Phrase -
  23. Comments -
- -
NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /home/cron/AST_SERVER_conf.pl file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. - -







-







-THE END -
-\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$dial_status_a = $row[3]; -$dial_status_b = $row[4]; -$dial_status_c = $row[5]; -$dial_status_d = $row[6]; -$dial_status_e = $row[7]; -$local_call_time = $row[16]; -if ($lead_filter_id=='') - { - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') - { - $lead_filter_id='NONE'; - } - } - -$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; -$rslt=mysql_query($stmt, $link); -$lists_to_print = mysql_num_rows($rslt); -$camp_lists=''; -$o=0; -while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; -if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} -} -$camp_lists = eregi_replace(".$","",$camp_lists); - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - -echo "

\n"; -echo "Show Dialable Leads Count -

\n"; -echo "CAMPAIGN: $campaign_id
\n"; -echo "LISTS: $camp_lists
\n"; -echo "STATUSES: $dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e
\n"; -echo "FILTER: $lead_filter_id
\n"; -echo "CALL TIME: $local_call_time

\n"; - -### call function to calculate and print dialable leads -dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - -echo "

\n"; -echo "\n"; - -exit; -} - - -###################### -# ADD=7111111 view sample script with test variables -###################### - -if ($ADD==7111111) -{ - ##### TEST VARIABLES ##### - $vendor_lead_code = 'VENDORLEADCODE'; - $list_id = 'LISTID'; - $gmt_offset_now = 'GMTOFFSET'; - $phone_code = '1'; - $phone_number = '7275551212'; - $title = 'Mr.'; - $first_name = 'JOHN'; - $middle_initial = 'Q'; - $last_name = 'PUBLIC'; - $address1 = '1234 Main St.'; - $address2 = 'Apt. 3'; - $address3 = 'ADDRESS3'; - $city = 'CHICAGO'; - $state = 'IL'; - $province = 'PROVINCE'; - $postal_code = '33760'; - $country_code = 'USA'; - $gender = 'M'; - $date_of_birth = '1970-01-01'; - $alt_phone = '3125551212'; - $email = 'test@test.com'; - $security_phrase = 'SECUTIRY'; - $comments = 'COMMENTS FIELD'; - $RGfullname = 'JOE AGENT'; - $RGuser = '6666'; - -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; - -$script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); -$script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); -$script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); -$script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); -$script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); -$script_text = eregi_replace('--A--title--B--',"$title",$script_text); -$script_text = eregi_replace('--A--first_name--B--',"$first_name",$script_text); -$script_text = eregi_replace('--A--middle_initial--B--',"$middle_initial",$script_text); -$script_text = eregi_replace('--A--last_name--B--',"$last_name",$script_text); -$script_text = eregi_replace('--A--address1--B--',"$address1",$script_text); -$script_text = eregi_replace('--A--address2--B--',"$address2",$script_text); -$script_text = eregi_replace('--A--address3--B--',"$address3",$script_text); -$script_text = eregi_replace('--A--city--B--',"$city",$script_text); -$script_text = eregi_replace('--A--state--B--',"$state",$script_text); -$script_text = eregi_replace('--A--province--B--',"$province",$script_text); -$script_text = eregi_replace('--A--postal_code--B--',"$postal_code",$script_text); -$script_text = eregi_replace('--A--country_code--B--',"$country_code",$script_text); -$script_text = eregi_replace('--A--gender--B--',"$gender",$script_text); -$script_text = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$script_text); -$script_text = eregi_replace('--A--alt_phone--B--',"$alt_phone",$script_text); -$script_text = eregi_replace('--A--email--B--',"$email",$script_text); -$script_text = eregi_replace('--A--security_phrase--B--',"$security_phrase",$script_text); -$script_text = eregi_replace('--A--comments--B--',"$comments",$script_text); -$script_text = eregi_replace('--A--fullname--B--',"$RGfullname",$script_text); -$script_text = eregi_replace('--A--user--B--',"$RGuser",$script_text); -$script_text = eregi_replace("\n","
",$script_text); - - -echo ""; - -echo "Preview Script: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') {$users_hh='bgcolor ="#FFFF99"'; $users_fc='BLACK';} # yellow - else {$users_hh=''; $users_fc='WHITE';} -if ($hh=='campaigns') {$campaigns_hh='bgcolor ="#FFCC99"'; $campaigns_fc='BLACK';} # orange - else {$campaigns_hh=''; $campaigns_fc='WHITE';} -if ($hh=='lists') {$lists_hh='bgcolor ="#FFCCCC"'; $lists_fc='BLACK';} # red - else {$lists_hh=''; $lists_fc='WHITE';} -if ($hh=='ingroups') {$ingroups_hh='bgcolor ="#CC99FF"'; $ingroups_fc='BLACK';} # purple - else {$ingroups_hh=''; $ingroups_fc='WHITE';} -if ($hh=='remoteagent') {$remoteagent_hh='bgcolor ="#CCFFCC"'; $remoteagent_fc='BLACK';} # green - else {$remoteagent_hh=''; $remoteagent_fc='WHITE';} -if ($hh=='usergroups') {$usergroups_hh='bgcolor ="#CCFFFF"'; $usergroups_fc='BLACK';} # cyan - else {$usergroups_hh=''; $usergroups_fc='WHITE';} -if ($hh=='scripts') {$scripts_hh='bgcolor ="#99FFCC"'; $scripts_fc='BLACK';} # light teal - else {$scripts_hh=''; $scripts_fc='WHITE';} -if ($hh=='filters') {$filters_hh='bgcolor ="#CCCCCC"'; $filters_fc='BLACK';} # grey - else {$filters_hh=''; $filters_fc='WHITE';} -if ($hh=='times') {$times_hh='bgcolor ="#99FF33"'; $times_fc='BLACK';} # hard teal - else {$times_hh=''; $times_fc='WHITE';} - -?> - - - - -\n"; -?> -
- - - - - - - - - - - - - - - - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - - - - -
  VICIDIAL ADMIN - Logout  
> SIZE=1> USERS > SIZE=1> CAMPAIGNS > SIZE=1> LISTS > SIZE=1> SCRIPTS > SIZE=1> FILTERS > SIZE=1> IN-GROUPS > SIZE=1> CALL TIMES > SIZE=1> USER GROUPS > SIZE=1> REMOTE AGENTS > REPORTS
  LIST USERS     |     ADD A NEW USER     |     SEARCH FOR A USER
  ADD CAMPAIGN     |     LIST CAMPAIGNS
  SHOW LISTS     |     ADD NEW LIST     |     SEARCH FOR A LEAD |     ADD NUMBER TO DNC           |     LOAD NEW LEADS
  ADD SCRIPT     |     VIEW SCRIPTS
  ADD FILTER     |     VIEW FILTERS
  SHOW IN-GROUPS     |     ADD NEW IN-GROUP
  SHOW CALL TIMES     |     ADD NEW CALL TIME     |     SHOW STATE CALL TIMES     |     ADD NEW STATE CALL TIME  
  ADD USER GROUP     |     LIST USER GROUPS     |     GROUP HOURLY
  SHOW REMOTE AGENTS     |     ADD NEW REMOTE AGENTS
 
-
\n"; -echo ""; - -echo "
ADD A NEW USER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "$NWB#vicidial_users-user_group$NWE\n"; -echo "\n"; -echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group:
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN -###################### - -if ($ADD==11) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW CAMPAIGN\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $NWB#vicidial_campaigns-park_ext$NWE
Park Filename: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List ID: (digits only)$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
\n"; - -} - - -###################### -# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number -###################### - -if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) - { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NOT ADDED - This phone number is already in the Do Not Call List: $phone_number

\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC ADDED: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); - } - } - } - -echo "
ADD A NUMBER TO THE DNC LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Phone Number: (digits only)$NWB#vicidial_list-dnc$NWE
\n"; - -} - - -###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN -###################### - -if ($ADD==1111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW INBOUND GROUP\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN -###################### - -if ($ADD==11111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW REMOTE AGENTS\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dialplan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - -###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN -###################### - -if ($ADD==111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW USERS GROUP\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -} - - -###################### -# ADD=1111111 display the ADD NEW SCRIPT SCREEN -###################### - -if ($ADD==1111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW SCRIPT\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Script ID: (no spaces or punctuation)$NWB#vicidial_scripts-script_id$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text: $NWB#vicidial_scripts-script_text$NWE
\n"; - -} - - -###################### -# ADD=11111111 display the ADD NEW FILTER SCREEN -###################### - -if ($ADD==11111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW FILTER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Filter ID: (no spaces or punctuation)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; -} - - -###################### -# ADD=111111111 display the ADD NEW CALL TIME SCREEN -###################### - -if ($ADD==111111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW CALL TIME\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; -} - - -###################### -# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN -###################### - -if ($ADD==1111111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW STATE CALL TIME\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
State Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (no spaces or punctuation)$NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 2 series, validates form data and inserts the new record into the database -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=2 adds the new user to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USER NOT ADDED - there is already a user in the system with this user number\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
USER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
user id must be between 2 and 8 characters long\n"; - echo "
full name and password must be at least 2 characters long\n"; - } - else - { - echo "
USER ADDED: $user\n"; - - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); - } - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new campaign to the system -###################### - -if ($ADD==21) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) ) - { - echo "
CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n"; - echo "
campaign ID must be between 2 and 8 characters in length\n"; - echo "
campaign name must be between 6 and 40 characters in length\n"; - } - else - { - echo "
CAMPAIGN ADDED: $campaign_id\n"; - - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch) values('$campaign_id','$campaign_name','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - } - } -$ADD=31; -} - -###################### -# ADD=22 adds the new campaign status to the system -###################### - -if ($ADD==22) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a campaign-status in the system with this name\n";} - else - { - $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a global-status in the system with this name\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 8 characters in length\n"; - echo "
status name must be between 2 and 30 characters in length\n"; - } - else - { - echo "
CAMPAIGN STATUS ADDED: $campaign_id - $status\n"; - - $stmt="INSERT INTO vicidial_campaign_statuses values('$status','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN STATUS |$PHP_AUTH_USER|$ip|'$status','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } - } -$ADD=31; -} - - -###################### -# ADD=23 adds the new campaign hotkey to the system -###################### - -if ($ADD==23) -{ - $HKstatus_data = explode('-----',$HKstatus); - $status = $HKstatus_data[0]; - $status_name = $HKstatus_data[1]; - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN HOTKEY NOT ADDED - there is already a campaign-hotkey in the system with this hotkey\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
CAMPAIGN HOTKEY NOT ADDED - Please go back and look at the data you entered\n"; - echo "
hotkey must be a single character between 1 and 9 \n"; - echo "
status must be between 1 and 8 characters in length\n"; - } - else - { - echo "
CAMPAIGN HOTKEY ADDED: $campaign_id - $status - $hotkey\n"; - - $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN HOTKEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=25 adds the new campaign lead recycle entry to the system -###################### - -if ($ADD==25) -{ - $status = eregi_replace("-----.*",'',$status); - echo ""; - $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD RECYCLE ADDED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new list to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
LIST NOT ADDED - there is already a list in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or (strlen($list_id) < 2) or (strlen($list_id) > 8) ) - { - echo "
LIST NOT ADDED - Please go back and look at the data you entered\n"; - echo "
List ID must be between 2 and 8 characters in length\n"; - echo "
List name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST ADDED: $list_id\n"; - - $stmt="INSERT INTO vicidial_lists values('$list_id','$list_name','$campaign_id','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|'$list_id','$list_name','$campaign_id','$active'|\n"); - fclose($fp); - } - } - } -$ADD=311; -} - - - -###################### -# ADD=2111 adds the new inbound group to the system -###################### - -if ($ADD==2111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
GROUP NOT ADDED - there is already a group in the system with this ID\n";} - else - { - if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) ) - { - echo "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; - echo "
Group name and group color must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - echo "
GROUP ADDED: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000; -} - - -###################### -# ADD=21111 adds new remote agents to the system -###################### - -if ($ADD==21111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
REMOTE AGENTS NOT ADDED - there is already a remote agents entry starting with this userID\n";} - else - { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
User ID start and external extension must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTE AGENTS ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } - } - } -$ADD=10000; -} - -###################### -# ADD=211111 adds new user group to the system -###################### - -if ($ADD==211111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USER GROUP NOT ADDED - there is already a user group entry with this name\n";} - else - { - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_user_groups values('$user_group','$group_name');"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW USER GROUP ENTRY |$PHP_AUTH_USER|$ip|'$user_group','$group_name'|\n"); - fclose($fp); - } - } - } -$ADD=100000; -} - -###################### -# ADD=2111111 adds new script to the system -###################### - -if ($ADD==2111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SCRIPT NOT ADDED - there is already a script entry with this name\n";} - else - { - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
SCRIPT NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Script name, description and text must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; - $rslt=mysql_query($stmt, $link); - - echo "
SCRIPT ADDED: $script_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000000; -} - - -###################### -# ADD=21111111 adds new filter to the system -###################### - -if ($ADD==21111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
FILTER NOT ADDED - there is already a filter entry with this ID\n";} - else - { - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Filter ID, name and SQL must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='$lead_filter_sql';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER ADDED: $lead_filter_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=10000000; -} - - -###################### -# ADD=211111111 adds new call time definition to the system -###################### - -if ($ADD==211111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Call Time ID and name must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments';"; - $rslt=mysql_query($stmt, $link); - - echo "
CALL TIME ADDED: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - } -$ADD=311111111; -} - - -###################### -# ADD=2111111111 adds new state call time definition to the system -###################### - -if ($ADD==2111111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
STATE CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
STATE CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; - echo "
State Call Time ID, name and state must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_state_call_times SET state_call_time_id='$call_time_id',state_call_time_name='$call_time_name',state_call_time_comments='$call_time_comments',state_call_time_state='$state_call_time_state';"; - $rslt=mysql_query($stmt, $link); - - echo "
STATE CALL TIME ADDED: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=3111111111; -} - - - - -###################################################################################################### -###################################################################################################### -####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below -###################################################################################################### -###################################################################################################### - - - -###################### -# ADD=4A submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4A") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - -###################### -# ADD=4B submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4B") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - - -###################### -# ADD=4 submit user modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - -###################### -# ADD=41 submit campaign modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=42 delete campaign status in the system -###################### - -if ($ADD==42) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - } - else - { - echo "
CUSTOM CAMPAIGN STATUS DELETED: $campaign_id - $status\n"; - - $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=43 delete campaign hotkey in the system -###################### - -if ($ADD==43) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
CAMPAIGN HOTKEY NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - echo "
the campaign hotkey needs to be at least 1 characters in length\n"; - } - else - { - echo "
CUSTOM CAMPAIGN HOTKEY DELETED: $campaign_id - $status - $hotkey\n"; - - $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=44 submit campaign modifications to the system - Basic View -###################### - -if ($ADD==44) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=34; # go to campaign modification form below -} - -###################### -# ADD=45 modify campaign lead recycle in the system -###################### - -if ($ADD==45) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=411 submit list modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) - { - echo "
LIST NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
list name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST MODIFIED: $list_id\n"; - - $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') - { - echo "
RESETTING LIST-CALLED-STATUS\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } - } - if ($campaign_id != "$old_campaign_id") - { - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id'|\n"); - fclose($fp); - } - } - -$ADD=311; # go to list modification form below -} - - -###################### -# ADD=4111 modify in-group info in the system -###################### - -if ($ADD==4111) -{ - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) - { - echo "
GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
group name and group color must be at least 2 characters in length\n"; - } - else - { - echo "
GROUP MODIFIED: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_message='$drop_message',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111; # go to in-group modification form below -} - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
User ID Start and External Extension must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTE AGENTS MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - } - -$ADD=31111; # go to remote agents modification form below -} - - - -###################### -# ADD=411111 modify user group info in the system -###################### - -if ($ADD==411111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group'|\n"); - fclose($fp); - } - } - -$ADD=311111; # go to user group modification form below -} - -###################### -# ADD=4111111 modify script in the system -###################### - -if ($ADD==4111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
SCRIPT NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Script name, description and text must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
SCRIPT MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111; # go to script modification form below -} - - -###################### -# ADD=41111111 modify filter in the system -###################### - -if ($ADD==41111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Filter ID, name and SQL must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='$lead_filter_sql' where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31111111; # go to filter modification form below -} - - -###################### -# ADD=411111111 modify call time in the system -###################### - -if ($ADD==411111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Call Time ID and name must be at least 2 characters in length\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
CALL TIME MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - -$ADD=311111111; # go to call time modification form below -} - - -###################### -# ADD=4111111111 modify state call time in the system -###################### - -if ($ADD==4111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
STATE CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
State Call Time ID, name and state must be at least 2 characters in length\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
STATE CALL TIME MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111111; # go to state call time modification form below -} - - - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of user -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) - { - echo "
USER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - echo "
USER DELETION CONFIRMATION: $user\n"; - echo "

Click here to delete user $user


\n"; - } - -$ADD='3'; # go to user modification below -} - -###################### -# ADD=51 confirmation before deletion of campaign -###################### - -if ($ADD==51) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) ) - { - echo "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
CAMPAIGN DELETION CONFIRMATION: $campaign_id\n"; - echo "

Click here to delete campaign $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=52 confirmation before logging all agents out of campaign of campaign -###################### - -if ($ADD==52) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
AGENT LOGOUT CONFIRMATION: $campaign_id\n"; - echo "

Click here to log all agents out of $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=511 confirmation before deletion of list -###################### - -if ($ADD==511) -{ - echo ""; - - if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) ) - { - echo "
LIST NOT DELETED - Please go back and look at the data you entered\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - echo "
LIST DELETION CONFIRMATION: $list_id\n"; - echo "

Click here to delete list and all of its leads $list_id


\n"; - } - -$ADD='311'; # go to campaign modification below -} - -###################### -# ADD=5111 confirmation before deletion of in-group -###################### - -if ($ADD==5111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) ) - { - echo "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - echo "
IN-GROUP DELETION CONFIRMATION: $group_id\n"; - echo "

Click here to delete in-group $group_id


\n"; - } - -$ADD='3111'; # go to in-group modification below -} - -###################### -# ADD=51111 confirmation before deletion of remote agent record -###################### - -if ($ADD==51111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) ) - { - echo "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - echo "
REMOTE AGENT DELETION CONFIRMATION: $remote_agent_id\n"; - echo "

Click here to delete remote agent $remote_agent_id


\n"; - } - -$ADD='31111'; # go to remote agent modification below -} - -###################### -# ADD=511111 confirmation before deletion of user group record -###################### - -if ($ADD==511111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) - { - echo "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - echo "
USER GROUP DELETION CONFIRMATION: $user_group\n"; - echo "

Click here to delete user group $user_group


\n"; - } - -$ADD='311111'; # go to user group modification below -} - -###################### -# ADD=5111111 confirmation before deletion of script record -###################### - -if ($ADD==5111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) ) - { - echo "
SCRIPT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Script_id must be at least 2 characters in length\n"; - } - else - { - echo "
SCRIPT DELETION CONFIRMATION: $script_id\n"; - echo "

Click here to delete script $script_id


\n"; - } - -$ADD='3111111'; # go to script modification below -} - -###################### -# ADD=51111111 confirmation before deletion of filter record -###################### - -if ($ADD==51111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) ) - { - echo "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Filter ID must be at least 2 characters in length\n"; - } - else - { - echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; - echo "

Click here to delete filter $lead_filter_id


\n"; - } - -$ADD='31111111'; # go to filter modification below -} - -###################### -# ADD=511111111 confirmation before deletion of call time record -###################### - -if ($ADD==511111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - echo "
CALL TIME DELETION CONFIRMATION: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; - } - -$ADD='311111111'; # go to call time modification below -} - -###################### -# ADD=5111111111 confirmation before deletion of call time record -###################### - -if ($ADD==5111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - echo "
STATE CALL TIME DELETION CONFIRMATION: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; - } - -$ADD='3111111111'; # go to state call time modification below -} - - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete user record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) - { - echo "
USER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|user='$user'|\n"); - fclose($fp); - } - echo "
USER DELETION COMPLETED: $user\n"; - echo "

\n"; - } - -$ADD='0'; # go to user list -} - -###################### -# ADD=61 delete campaign record -###################### - -if ($ADD==61) -{ - echo ""; - - if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) - { - echo "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
CAMPAIGN DELETION COMPLETED: $campaign_id\n"; - echo "

\n"; - } - -$ADD='10'; # go to campaigns list -} - -###################### -# ADD=62 Logout all agents fro a campaign -###################### - -if ($ADD==62) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!AGENT LOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
AGENT LOGOUT COMPLETED: $campaign_id\n"; - echo "

\n"; - } - -$ADD='31'; # go to campaign modification below -} - - -###################### -# ADD=65 delete campaign lead recycle in the system -###################### - -if ($ADD==65) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD RECYCLE DELETED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=611 delete list record and all leads within it -###################### - -if ($ADD==611) -{ - echo ""; - - if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) - { - echo "
LIST NOT DELETED - Please go back and look at the data you entered\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST LEADS FROM VICIDIAL_LIST TABLE\n"; - $stmt="DELETE from vicidial_list where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } - echo "
LIST DELETION COMPLETED: $list_id\n"; - echo "

\n"; - } - -$ADD='100'; # go to lists list -} - -###################### -# ADD=6111 delete in-group record -###################### - -if ($ADD==6111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) - { - echo "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } - echo "
IN-GROUP DELETION COMPLETED: $group_id\n"; - echo "

\n"; - } - -$ADD='1000'; # go to in-group list -} - -###################### -# ADD=61111 delete remote agent record -###################### - -if ($ADD==61111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) - { - echo "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - echo "
REMOTE AGENT DELETION COMPLETED: $remote_agent_id\n"; - echo "

\n"; - } - -$ADD='10000'; # go to remote agents list -} - -###################### -# ADD=611111 delete user group record -###################### - -if ($ADD==611111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) - { - echo "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } - echo "
USER GROUP DELETION COMPLETED: $user_group\n"; - echo "

\n"; - } - -$ADD='100000'; # go to user group list -} - -###################### -# ADD=6111111 delete script record -###################### - -if ($ADD==6111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) - { - echo "
SCRIPT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Script_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } - echo "
SCRIPT DELETION COMPLETED: $script_id\n"; - echo "

\n"; - } - -$ADD='1000000'; # go to script list -} - - -###################### -# ADD=61111111 delete filter record -###################### - -if ($ADD==61111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) - { - echo "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Filter ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } - echo "
FILTER DELETION COMPLETED: $lead_filter_id\n"; - echo "

\n"; - } - -$ADD='10000000'; # go to filter list -} - - -###################### -# ADD=611111111 delete call times record -###################### - -if ($ADD==611111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
CALL TIME DELETION COMPLETED: $call_time_id\n"; - echo "

\n"; - } - -$ADD='100000000'; # go to call times list -} - - -###################### -# ADD=6111111111 delete call times record -###################### - -if ($ADD==6111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; - $rslt=mysql_query($stmt, $link); - $sct_to_print = mysql_num_rows($rslt); - $sct_list=''; - - $o=0; - while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_ids[$o] = "$rowx[0]"; - $sct_states[$o] = "$rowx[1]"; - $o++; - } - $o=0; - - while ($sct_to_print > $o) { - $sct_states[$o] = eregi_replace("\|$call_time_id\|",'|',$sct_states[$o]); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$sct_states[$o]' where call_time_id='$sct_ids[$o]';"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - echo "State Rule Removed: $sct_ids[$o]
\n"; - $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
STATE CALL TIME DELETION COMPLETED: $call_time_id\n"; - echo "

\n"; - } - -$ADD='1000000000'; # go to call times list -} - - - - - - -###################################################################################################### -###################################################################################################### -####### 3 series, record modification forms -###################################################################################################### -###################################################################################################### - - - - -###################### -# ADD=3 modify user info in the system -###################### - -if ($ADD==3) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_level = $row[4]; - $user_group = $row[5]; - $phone_login = $row[6]; - $phone_pass = $row[7]; - $delete_users = $row[8]; - $delete_user_groups = $row[9]; - $delete_lists = $row[10]; - $delete_campaigns = $row[11]; - $delete_ingroups = $row[12]; - $delete_remote_agents = $row[13]; - $load_leads = $row[14]; - $campaign_detail = $row[15]; - $ast_admin_access = $row[16]; - $ast_delete_phones = $row[17]; - $delete_scripts = $row[18]; - $modify_leads = $row[19]; - $hotkeys_active = $row[20]; - $change_agent_campaign =$row[21]; - $agent_choose_ingroups =$row[22]; - $scheduled_callbacks = $row[24]; - $agentonly_callbacks = $row[25]; - $agentcall_manual = $row[26]; - $vicidial_recording = $row[27]; - $vicidial_transfers = $row[28]; - $delete_filters = $row[29]; - $alter_agent_interface_options =$row[30]; - $closer_default_blended = $row[31]; - $delete_call_times = $row[32]; - $modify_call_times = $row[33]; - -if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) - { - echo "
You do not have permissions to modify this user: $row[1]\n"; - } -else - { - echo "
MODIFY A USERS RECORD: $row[1]\n"; - if ($LOGuser_level > 8) - {echo "\n";} - else - { - if ($LOGalter_agent_interface == "1") - {echo "\n";} - else - {echo "\n";} - } - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - if ($LOGuser_level > 8) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
User Number: $row[1]$NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group: $NWB#vicidial_users-user_group$NWE
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
AGENT INTERFACE OPTIONS:
Agent Choose Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
HotKeys Active: $NWB#vicidial_users-hotkeys_active$NWE
Scheduled Callbacks: $NWB#vicidial_users-scheduled_callbacks$NWE
Agent-Only Callbacks: $NWB#vicidial_users-agentonly_callbacks$NWE
Agent Call Manual: $NWB#vicidial_users-agentcall_manual$NWE
Vicidial Recording: $NWB#vicidial_users-vicidial_recording$NWE
Vicidial Transfers: $NWB#vicidial_users-vicidial_transfers$NWE
Closer Default Blended: $NWB#vicidial_users-closer_default_blended$NWE
Inbound Groups: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_users-closer_campaigns$NWE
ADMIN INTERFACE OPTIONS:
Alter Agent Interface Options: $NWB#vicidial_users-alter_agent_interface_options$NWE
Delete Users: $NWB#vicidial_users-delete_users$NWE
Delete User Groups: $NWB#vicidial_users-delete_user_groups$NWE
Delete Lists: $NWB#vicidial_users-delete_lists$NWE
Delete Campaigns: $NWB#vicidial_users-delete_campaigns$NWE
Delete In-Groups: $NWB#vicidial_users-delete_ingroups$NWE
Delete Remote Agents: $NWB#vicidial_users-delete_remote_agents$NWE
Delete Scripts: $NWB#vicidial_users-delete_scripts$NWE
Load Leads: $NWB#vicidial_users-load_leads$NWE
Campaign Detail: $NWB#vicidial_users-campaign_detail$NWE
AGC Admin Access: $NWB#vicidial_users-ast_admin_access$NWE
AGC Delete Phones: $NWB#vicidial_users-ast_delete_phones$NWE
Modify Leads: $NWB#vicidial_users-modify_leads$NWE
Change Agent Campaign: $NWB#vicidial_users-change_agent_campaign$NWE
Delete Filters: $NWB#vicidial_users-delete_filters$NWE
Delete Call Times: $NWB#vicidial_users-delete_call_times$NWE
Modify Call Times: $NWB#vicidial_users-modify_call_times$NWE
\n"; - - if ($LOGdelete_users > 0) - { - echo "

DELETE THIS USER\n"; - } - echo "

Click here for user time sheet\n"; - echo "

Click here for user status\n"; - echo "

Click here for user stats\n"; - echo "

Click here for user CallBack Holds\n"; - } - -} - - -###################### -# ADD=31 modify campaign info in the system - Detail view -###################### - -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed - -if ($ADD==31) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $campaign_rec_exten = $row[22]; - $campaign_recording = $row[23]; - $campaign_rec_filename = $row[24]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $am_message_exten = $row[27]; - $amd_send_to_vmx = $row[28]; - $xferconf_a_dtmf = $row[29]; - $xferconf_a_number = $row[30]; - $xferconf_b_dtmf = $row[31]; - $xferconf_b_number = $row[32]; - $alt_number_dialing = $row[33]; - $scheduled_callbacks = $row[34]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; - $safe_harbor_exten = $row[38]; - $display_dialable_count = $row[39]; - $wrapup_seconds = $row[40]; - $wrapup_message = $row[41]; -# $closer_campaigns = $row[42]; - $use_internal_dnc = $row[43]; - -echo "
MODIFY A CAMPAIGNS RECORD: $row[0] - Basic View"; -echo " | Detail View | "; -echo "Realtime Screen\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -if (eregi("CLOSER", $campaign_id)) - { - echo "\n"; - } - - - -echo "\n"; -echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Dial status 1: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE
List Order: $NWB#vicidial_campaigns-lead_order$NWE
Lead Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Dial Timeout: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Dial Prefix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Campaign CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Campaign VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Campaign Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Campaign Recording: $NWB#vicidial_campaigns-campaign_recording$NWE
Campaign Rec Filename: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
Answering Machine Message: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD Send to VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Alt Number Dialing: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Scheduled Callbacks: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Drop Call Seconds: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Use Safe Harbor Message: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Safe Harbor Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Wrapup Seconds: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Wrapup Message: $NWB#vicidial_campaigns-wrapup_message$NWE
Use Internal DNC List: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Allowed Inbound Groups:
"; - echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; - echo "$groups_list"; - echo "
\n"; - -echo "
\n"; -echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\n"; - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - HIDE

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - SHOW

"; - } - - - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "This campaign has $hopper_leads leads in the dial hopper

\n"; -echo "Click here to see what leads are in the hopper right now

\n"; -echo "Click here to see all CallBack Holds in this campaign

\n"; -echo "
\n"; - - - - -echo "
\n"; -echo "
CUSTOM STATUSES WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_statuses$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
STATUSDESCRIPTIONSELECTABLEDELETE
$rowx[0]$rowx[1]$rowx[2]DELETE
\n"; - -echo "
ADD NEW CUSTOM CAMPAIGN STATUS
\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Description:   \n"; -echo "Selectable:   \n"; -echo "
\n"; - -echo "

\n"; - - - -echo "
CUSTOM HOTKEYS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
HOTKEYSTATUSDESCRIPTIONDELETE
$rowx[1]$rowx[0]$rowx[2]DELETE
\n"; - -echo "
ADD NEW CUSTOM CAMPAIGN HOTKEY
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Hotkey:   \n"; -echo "Status:   \n"; -echo "
\n"; -echo "

\n"; - - - -echo "

LEAD RECYCLING WITHIN THIS CAMPAIGN:   $NWB#vicidial_lead_recycle$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $recycle_to_print = mysql_num_rows($rslt); - $o=0; - while ($recycle_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - -echo "
STATUSATTEMPT DELAYATTEMPT MAXIMUMACTIVE DELETE
$rowx[2]
\n"; - echo "\n"; - echo "\n"; - echo "
DELETE
\n"; - -echo "
ADD NEW CAMPAIGN LEAD RECYCLE
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Attempt Delay: \n"; -echo "Attempt Maximum: \n"; -echo "
\n"; - -echo "

\n"; - -echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; - -if ($LOGdelete_campaigns > 0) - { - echo "

DELETE THIS CAMPAIGN\n"; - } - -} - - -###################### -# ADD=34 modify campaign info in the system - Basic View -###################### - -if ($ADD==34) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $display_dialable_count = $row[39]; - -echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Basic View | "; -echo "Detail View | "; -echo "Realtime Screen\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; -echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Web Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Dial status 1: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE
List Order: $NWB#vicidial_campaigns-lead_order$NWE
Lead Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Script: $script_id
Get Call Launch: $get_call_launch
\n"; - -echo "
\n"; -echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\n"; - - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - HIDE

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - SHOW

"; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "This campaign has $hopper_leads leads in the dial hopper

\n"; -echo "Click here to see what leads are in the hopper right now

\n"; -echo "Click here to see all CallBack Holds in this campaign

\n"; -echo "
\n"; - -echo "
\n"; - -echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; - - -if ($LOGdelete_campaigns > 0) - { - echo "

DELETE THIS CAMPAIGN\n"; - } - - -} - - -###################### -# ADD=311 modify list info in the system -###################### - -if ($ADD==311) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $Cstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($Cstatuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - # end grab status names - - -echo "
MODIFY A LISTS RECORD: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List ID: $row[0]$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
Reset Lead-Called-Status for this list: $NWB#vicidial_lists-reset_list$NWE
\n"; - -echo "
\n"; -echo "
STATUSES WITHIN THIS LIST:
\n"; -echo "\n"; -echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $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($rslt); - - $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]] = ($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; - if ($lead_list['count'] > 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 ($dispo == 'CBHOLD') - { - $CLB=""; - $CLE=""; - } - else - { - $CLB=''; - $CLE=''; - } - - echo "\n"; - $o++; - } - } - -echo "\n"; -echo "\n"; - -echo "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; -unset($lead_list); - - - - - -echo "
\n"; -echo "
TIME ZONES WITHIN THIS LIST:
\n"; -echo "\n"; -echo "\n"; - - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - $plus='+'; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $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]] = ($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++; - } - - if ($lead_list['count'] > 0) - { - while (list($tzone,) = each($lead_list[$since_reset])) - { - $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - - if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} - else {$DISPtzone = "$tzone";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - } - } - -echo "\n"; -echo "\n"; - -echo "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; -unset($lead_list); - - - - - - - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; - $rslt=mysql_query($stmt, $link); - $status_called_to_print = mysql_num_rows($rslt); - - $o=0; - $sts=0; - $first_row=1; - $all_called_first=1000; - $all_called_last=0; - while ($status_called_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $leads_in_list = ($leads_in_list + $rowx[2]); - $count_statuses[$o] = "$rowx[0]"; - $count_called[$o] = "$rowx[1]"; - $count_count[$o] = "$rowx[2]"; - $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); - - if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) - { - if ($first_row) {$first_row=0;} - else {$sts++;} - $status[$sts] = "$rowx[0]"; - $status_called_first[$sts] = "$rowx[1]"; - if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} - } - $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); - $status_called_last[$sts] = "$rowx[1]"; - if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} - - $o++; - } - - - - -echo "
\n"; -echo "
CALLED COUNTS WITHIN THIS LIST:
\n"; -echo "\n"; -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - - $sts=0; - $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 ""; - - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $sts)) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - else - { - if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - - $called_printed=0; - $o=0; - while ($status_called_to_print > $o) - { - if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) - { - $called_printed++; - echo ""; - } - - - $o++; - } - if (!$called_printed) - {echo "";} - $first++; - } - echo "\n\n"; - - $sts++; - } - -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - -echo "
STATUSSTATUS NAME$firstSUBTOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; - - - - - -echo "
\n"; - -if ($LOGdelete_lists > 0) - { - echo "

DELETE THIS LIST\n"; - } - -} - - - -###################### -# ADD=3111 modify in-group info in the system -###################### - -if ($ADD==3111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $group_name = $row[1]; - $group_color = $row[2]; - $active = $row[3]; - $web_form_address = $row[4]; - $voicemail_ext = $row[5]; - $next_agent_call = $row[6]; - $fronter_display = $row[7]; - $script_id = $row[8]; - $get_call_launch = $row[9]; - $xferconf_a_dtmf = $row[10]; - $xferconf_a_number = $row[11]; - $xferconf_b_dtmf = $row[12]; - $xferconf_b_number = $row[13]; - $drop_call_seconds = $row[14]; - $drop_message = $row[15]; - $drop_exten = $row[16]; - -echo "
MODIFY A GROUPS RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -echo "\n"; -echo "
Group ID: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Drop Call Seconds: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Use Drop Message: $NWB#vicidial_inbound_groups-drop_message$NWE
Drop Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
\n"; - -echo "

\n"; - -echo "
\n"; - -if ($LOGdelete_ingroups > 0) - { - echo "

DELETE THIS IN-GROUP\n"; - } - -} - - - -###################### -# ADD=31111 modify remote agents info in the system -###################### - -if ($ADD==31111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dialplan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - - -if ($LOGdelete_remote_agents > 0) - { - echo "

DELETE THIS REMOTE AGENT\n"; - } - -} - - -###################### -# ADD=311111 modify user group info in the system -###################### - -if ($ADD==311111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; -echo ""; - -echo "
MODIFY A USERS GROUP ENTRY\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -if ($LOGdelete_user_groups > 0) - { - echo "

DELETE THIS USER GROUP\n"; - } - -} - - -###################### -# ADD=3111111 modify script info in the system -###################### - -if ($ADD==3111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $script_name = $row[1]; - $script_comments = $row[2]; - $script_text = $row[3]; - $active = $row[4]; -echo ""; - -echo "
MODIFY A SCRIPT\n"; -echo "\n"; -echo "\n"; -echo "
Script ID: $script_id$NWB#vicidial_scripts-script_name$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text:

Preview Script
$NWB#vicidial_scripts-script_text$NWE
\n"; - -if ($LOGdelete_scripts > 0) - { - echo "

DELETE THIS SCRIPT\n"; - } - -} - - -###################### -# ADD=31111111 modify filter info in the system -###################### - -if ($ADD==31111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $lead_filter_name = $row[1]; - $lead_filter_comments = $row[2]; - $lead_filter_sql = $row[3]; -echo ""; - -echo "
MODIFY A FILTER\n"; -echo "\n"; -echo "\n"; -echo "
Filter ID: $lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - -echo "

"; -echo "
TEST ON CAMPAIGN:
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -if ($LOGdelete_filters > 0) - { - echo "

DELETE THIS FILTER\n"; - } - -} - - -###################### -# ADD=321111111 modify call time definition info in the system -###################### - -if ($ADD==321111111) -{ -if ($LOGmodify_call_times==1) -{ - -if ( ($stage=="ADD") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - if (eregi("\|$",$ct_state_call_times)) - {$ct_state_call_times = "$ct_state_call_times$state_rule\|";} - else - {$ct_state_call_times = "$ct_state_call_times\|$state_rule\|";} - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "State Rule Added: $state_rule
\n"; - } -if ( ($stage=="REMOVE") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - $ct_state_call_times = eregi_replace("\|$state_rule\|",'|',$ct_state_call_times); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "State Rule Removed: $state_rule
\n"; - } - -$ADD=311111111; -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# ADD=311111111 modify call time definition info in the system -###################### - -if ($ADD==311111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -$ct_srs=1; -$b=0; -$srs_SQL =''; -if (strlen($ct_state_call_times)>2) - { - $state_rules = explode('|',$ct_state_call_times); - $ct_srs = ((count($state_rules)) - 1); - } -echo "\n"; -echo "\n"; -while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>0) - { - $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - echo "\n"; - $srs_SQL .= "'$state_rules[$b]',"; - $srs_state_SQL .= "'$row[0]',"; - } - $b++; - } -if (strlen($srs_SQL)>2) - { - $srs_SQL = "$srs_SQL''"; - $srs_state_SQL = "$srs_state_SQL''"; - $srs_SQL = "where state_call_time_id NOT IN($srs_SQL) and state_call_time_state NOT IN($srs_state_SQL)"; - } -else - {$srs_SQL='';} -$stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;"; -$rslt=mysql_query($stmt, $link); -$sct_to_print = mysql_num_rows($rslt); -$sct_list=''; - -$o=0; -while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_list .= "\n"; - $o++; -} -echo "\n"; -echo "\n"; - -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $call_time_name = $row[1]; - $call_time_comments = $row[2]; - $ct_default_start = $row[3]; - $ct_default_stop = $row[4]; - $ct_sunday_start = $row[5]; - $ct_sunday_stop = $row[6]; - $ct_monday_start = $row[7]; - $ct_monday_stop = $row[8]; - $ct_tuesday_start = $row[9]; - $ct_tuesday_stop = $row[10]; - $ct_wednesday_start = $row[11]; - $ct_wednesday_stop = $row[12]; - $ct_thursday_start = $row[13]; - $ct_thursday_stop = $row[14]; - $ct_friday_start = $row[15]; - $ct_friday_stop = $row[16]; - $ct_saturday_start = $row[17]; - $ct_saturday_stop = $row[18]; - $ct_state_call_times = $row[19]; - -echo ""; - -echo "
MODIFY A CALL TIME\n"; -echo "\n"; -echo "\n"; -echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Active State Call Time Definitions for this Record:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Add state call time rule:


\n"; -echo "CAMPAIGNS USING THIS CALL TIME:
\n"; -echo "\n"; - - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - $CT_camp_id = $row[1]; - $CT_camp_name = $row[2]; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

DELETE THIS CALL TIME DEFINITION\n"; - } -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# ADD=3111111111 modify state call time definition info in the system -###################### - -if ($ADD==3111111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $state_call_time_state =$row[1]; - $call_time_name = $row[2]; - $call_time_comments = $row[3]; - $ct_default_start = $row[4]; - $ct_default_stop = $row[5]; - $ct_sunday_start = $row[6]; - $ct_sunday_stop = $row[7]; - $ct_monday_start = $row[8]; - $ct_monday_stop = $row[9]; - $ct_tuesday_start = $row[10]; - $ct_tuesday_stop = $row[11]; - $ct_wednesday_start = $row[12]; - $ct_wednesday_stop = $row[13]; - $ct_thursday_start = $row[14]; - $ct_thursday_stop = $row[15]; - $ct_friday_start = $row[16]; - $ct_friday_stop = $row[17]; - $ct_saturday_start = $row[18]; - $ct_saturday_stop = $row[19]; - -echo ""; - -echo "
MODIFY A STATE CALL TIME
\n"; -echo "\n"; -echo "\n"; -echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; -echo "CALL TIMES USING THIS STATE CALL TIME:
\n"; -echo "\n"; - - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

DELETE THIS STATE CALL TIME DEFINITION\n"; - } - -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo "
\n"; -echo ""; - -echo "
SEARCH FOR A USER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
User Number:
Full Name:
User Level:
User Group:
\n"; - -} - -###################### -# ADD=66 user search results -###################### - -if ($ADD==66) -{ -echo "
\n"; - echo ""; - - $SQL = ''; - if ($user) {$SQL .= " user LIKE \"%$user%\" and";} - if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";} - if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";} - if ($user_group) {$SQL .= " user_group = '$user_group' and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SEARCH RESULTS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS | STATUS | TIME
\n"; - -} - - -###################################################################################################### -###################################################################################################### -####### 8 series, Callback lists -###################################################################################################### -###################################################################################################### - -###################### -# ADD=8 find all callbacks on hold by a User -###################### -if ($ADD==8) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user='$user' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
USER CALLBACK HOLD LISTINGS: $user\n"; -$ADD='82'; -} - -###################### -# ADD=81 find all callbacks on hold within a Campaign -###################### -if ($ADD==81) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and campaign_id='$campaign_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN CALLBACK HOLD LISTINGS: $campaign_id\n"; -$ADD='82'; -} - -###################### -# ADD=811 find all callbacks on hold within a List -###################### -if ($ADD==811) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and list_id='$list_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; -$ADD='82'; -} - -###################### -# ADD=82 display all callbacks on hold -###################### -if ($ADD==82) -{ -echo "
\n"; -echo "
\n"; -echo "\n"; - - $o=0; - while ($cb_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
LEADLISTCAMPAIGNENTRY DATECALLBACK DATEUSERRECIPIENTSTATUS
$row[1]$row[2]$row[3]$row[5]$row[6]$row[8]$row[9]$row[4]
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 0 series, displays and searches -###################################################################################################### -###################################################################################################### - -###################### -# ADD=0 display all active users -###################### -if ($ADD==0) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users order by full_name"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS | STATUS | TIME
\n"; -} - -###################### -# ADD=10 display all campaigns -###################### -if ($ADD==10) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  MODIFY
\n"; -} - - -###################### -# ADD=100 display all lists -###################### -if ($ADD==100) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists order by list_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
LIST LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]  MODIFY
\n"; -} - - - -###################### -# ADD=1000 display all inbound groups -###################### -if ($ADD==1000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
INBOUND GROUP LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[5]  MODIFY
\n"; -} - - -###################### -# ADD=10000 display all remote agents -###################### -if ($ADD==10000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
REMOTE AGENTS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFY
\n"; -} - - -###################### -# ADD=100000 display all user groups -###################### -if ($ADD==100000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER GROUPS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=1000000 display all scripts -###################### -if ($ADD==1000000) -{ -echo "\n";echo "\n";?> -
-
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SCRIPTS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=10000000 display all filters -###################### -if ($ADD==10000000) -{ -echo "\r\n"; - } -} - diff --git a/LANG_admin/vicidial/listloader_super.pl b/LANG_admin/vicidial/listloader_super.pl deleted file mode 100644 index a36765d0..00000000 --- a/LANG_admin/vicidial/listloader_super.pl +++ /dev/null @@ -1,691 +0,0 @@ -#!/usr/bin/perl - -### listloader_super.pl -### -### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 -### -# -# -# CHANGES -# 60616-1548 - Added listID override feature to force all leads into same list -# - Added gmt_offset_now lookup for each lead -# - -### begin parsing run-time options ### -if (length($ARGV[0])>1) -{ - $i=0; - while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } - - if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - } - else - { - if ($args =~ /--forcelistid=/i) - { - @data_in = split(/--forcelistid=/,$args); - $forcelistid = $data_in[1]; - print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; - } - else - {$forcelistid = '';} - } -} -### end parsing run-time options ### - -use Spreadsheet::ParseExcel; -use Time::Local; -use Net::MySQL; - -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file - -if (!$DB_port) {$DB_port='3306';} - -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; - - -$vars=$ARGV[0]; -@xls_fields=split(/\,/, $vars); - -$|=0; -$secX = time(); - -($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); -$year = ($year + 1900); -$mon++; -if ($hour < 10) {$hour = "0$hour";} -if ($min < 10) {$min = "0$min";} -if ($sec < 10) {$sec = "0$sec";} -if ($mon < 10) {$mon = "0$mon";} -if ($mday < 10) {$mday = "0$mday";} -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$pulldate="$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - - ### Grab Server values from the database - $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $DBSERVER_GMT = "$record->[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} - } - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -if ($isdst) {$LOCAL_GMT_OFF++;} -if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - - -$total=0; $good=0; $bad=0; -open(STMT_FILE, "> listloader_stmts.txt"); - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); -my($iR, $iC, $oWkS, $oWkC); - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { - - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[0]]; - if ($oWkC) {$vendor_lead_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[1]]; - if ($oWkC) {$source_code=$oWkC->Value; } - $source_id=$source_code; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[2]]; - if ($oWkC) {$list_id=$oWkC->Value; } - $gmt_offset = '0'; - $called_since_last_reset='N'; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[3]]; - if ($oWkC) {$phone_code=$oWkC->Value; } - $phone_code=~s/[^0-9]//g; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[4]]; - if ($oWkC) {$phone_number=$oWkC->Value; } - $phone_number=~s/[^0-9]//g; - $USarea = substr($phone_number, 0, 3); - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[5]]; - if ($oWkC) {$title=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[6]]; - if ($oWkC) {$first_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[7]]; - if ($oWkC) {$middle_initial=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[8]]; - if ($oWkC) {$last_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[9]]; - if ($oWkC) {$address1=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[10]]; - if ($oWkC) {$address2=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[11]]; - if ($oWkC) {$address3=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[12]]; - if ($oWkC) {$city=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[13]]; - if ($oWkC) {$state=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[14]]; - if ($oWkC) {$province=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[15]]; - if ($oWkC) {$postal_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[16]]; - if ($oWkC) {$country_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[17]]; - if ($oWkC) {$gender=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[18]]; - if ($oWkC) {$date_of_birth=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[19]]; - if ($oWkC) {$alt_phone=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[20]]; - if ($oWkC) {$email=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[21]]; - if ($oWkC) {$security_phrase=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[22]]; - if ($oWkC) {$comments=$oWkC->Value; } - $comments=~s/^\s*(.*?)\s*$/$1/; - - if (length($phone_number)>8) { - if (length($forcelistid) > 0) - { - $list_id = $forcelistid; # set list_id to override value - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### MEXICO ### - if ($phone_code =~ /^52$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### AUSTRALIA ### - if ($phone_code =~ /^61$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); - $year = ($year + 1900); - $mon++; - if ($mon < 10) {$mon = "0$mon";} - if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$hour = "0$hour";} - if ($min < 10) {$min = "0$min";} - if ($sec < 10) {$sec = "0$sec";} - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - &USA_dstcalc; - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - &GBR_dstcalc; - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - &AUS_dstcalc; - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - &AUST_dstcalc; - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - &NZL_dstcalc; - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $dbhA->query("$stmtZ"); - print STMT_FILE $stmtZ."\r\n"; - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - sleep(1); -# flush(); - } - } -} - -if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; - $dbhA->query("$stmtZ"); - print STMT_FILE $stmtZ."\r\n"; -} - -print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total"; - -exit; - - - - - - -sub USA_dstcalc { -#********************************************************************** -# FSA-LSO -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in April and last Sunday in October at 2 am. -# INPUTS: -# mm INTEGER Month. -# dd INTEGER Day of the month. -# ns INTEGER Seconds into the day. -# dow INTEGER Day of week (0=Sunday, to 6=Saturday) -# OPTIONAL INPUT: -# timezone INTEGER hour difference UTC - local standard time -# (DEFAULT is blank) -# make calculations based on UTC time, -# which means shift at 10:00 UTC in April -# and 9:00 UTC in October -# OUTPUT: -# INTEGER 1 = DST, 0 = not DST -#********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; return 0; - } elsif ($mm >= 5 && $mm <= 9) { - $USA_DST=1; return 1; - } elsif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $USA_DST=0; return 0; - } else { - $USA_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 7200) { - $USA_DST=0; return 0; - } else { - $USA_DST=1; return 1; - } - } - } else { - $USA_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $USA_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; return 1; - } else { - $USA_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; return 1; - } else { - $USA_DST=0; return 0; - } - } - } else { - $USA_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub GBR_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in March and last Sunday in October at 1 am. -#********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; return 0; - } elsif ($mm >= 4 && $mm <= 9) { - $GBR_DST=1; return 1; - } elsif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $GBR_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } - } else { - $GBR_DST=1; return 1; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $GBR_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } - } else { - $GBR_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub AUS_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUS_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUS_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } - } else { - $AUS_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $AUS_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } - } else { - $AUS_DST=1; return 1; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub AUST_dstcalc { -#********************************************************************** -# TASMANIA ONLY -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUST_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUST_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } - } else { - $AUST_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } - } else { - $AUST_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub NZL_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and third Sunday in March at 1 am. -#********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $NZL_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; return 1; - } elsif ($dd < ($dow+14)) { - $NZL_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } - } else { - $NZL_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } - } else { - $NZL_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc diff --git a/LANG_admin/vicidial/log_test.php b/LANG_admin/vicidial/log_test.php deleted file mode 100644 index cd7a86b7..00000000 --- a/LANG_admin/vicidial/log_test.php +++ /dev/null @@ -1,37 +0,0 @@ - LICENSE: GPLv2 -# - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$fp = fopen ("./closer_SQL_updates.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - fwrite ($fp, "CLOSER SQL UPDATE|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - - -exit; - - - -?> - - -Hello - - diff --git a/LANG_admin/vicidial/new_listloader_superL.php b/LANG_admin/vicidial/new_listloader_superL.php deleted file mode 100644 index 6c0ac713..00000000 --- a/LANG_admin/vicidial/new_listloader_superL.php +++ /dev/null @@ -1,1364 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60113-1603 - Fixed a few bugs in Excel import -# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1240 - added listID override -# 60616-1604 - added gmt lookup for each lead -# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. - -$version = '1.1.12-1'; -$build = '60619-1651'; - - -require("dbconnect.php"); - -### links used for testing -#$link=mysql_connect("10.10.10.15", "cron", "1234"); -#mysql_select_db("asterisk"); -#$WeBServeRRooT = '/home/www/htdocs'; - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} - elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} - elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} -if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} - elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} -if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} - elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} -if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} - elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} -if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} - elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} -if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} - elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} -if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} - elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} -if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} - elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} -if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} - elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} -if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} - elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} -if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} - elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} -if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} - elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} -if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} - elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} -if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} - elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} -if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} - elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} -if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} - elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} -if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} - elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} -if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} - elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} -if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} - elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} -if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} - elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} -if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} - elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} -if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} - elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} -if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} - elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} -if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} - elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} -if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} - elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} -if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} - elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} -if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} - elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); - -# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HELP\""; - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -function macfontfix($fontsize) { - - $browser = getenv("HTTP_USER_AGENT"); - $pctype = explode("(", $browser); - if (ereg("Mac",$pctype[1])) { - /* Browser is a Mac. If not Netscape 6, raise fonts */ - - $blownbrowser = explode('/', $browser); - $ver = explode(' ', $blownbrowser[1]); - $ver = $ver[0]; - if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); - - } else return $fontsize; /* Browser is not a Mac - don't touch fonts */ -} - -echo "\n"; - -?> - - - -VICIDIAL ADMIN: Super Lead Loader - - -
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - - -
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
LEAD FILTER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=100000000 display all call times -###################### -if ($ADD==100000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
CALL TIME LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[4] MODIFY
\n"; -} - -###################### -# ADD=1000000000 display all state call times -###################### -if ($ADD==1000000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
STATE CALL TIME LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFY
\n"; -} - - - - - -echo "
\n"; - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; -echo "             VERSION: $version"; -echo "             BUILD: $build
\n"; - - -?> - - -
- - - -1) - { - $g=0; - $p='13'; - $GMT_gmt[0] = ''; - $GMT_hour[0] = ''; - $GMT_day[0] = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $pmin=(gmdate("i", time() + $pzone)); - $phour=( (gmdate("G", time() + $pzone)) * 100); - $pday=gmdate("w", time() + $pzone); - $tz = sprintf("%.2f", $p); - $GMT_gmt[$g] = "$tz"; - $GMT_day[$g] = "$pday"; - $GMT_hour[$g] = ($phour + $pmin); - $p = ($p - 0.25); - $g++; - } - - $stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $Gct_default_start = "$rowx[3]"; - $Gct_default_stop = "$rowx[4]"; - $Gct_sunday_start = "$rowx[5]"; - $Gct_sunday_stop = "$rowx[6]"; - $Gct_monday_start = "$rowx[7]"; - $Gct_monday_stop = "$rowx[8]"; - $Gct_tuesday_start = "$rowx[9]"; - $Gct_tuesday_stop = "$rowx[10]"; - $Gct_wednesday_start = "$rowx[11]"; - $Gct_wednesday_stop = "$rowx[12]"; - $Gct_thursday_start = "$rowx[13]"; - $Gct_thursday_stop = "$rowx[14]"; - $Gct_friday_start = "$rowx[15]"; - $Gct_friday_stop = "$rowx[16]"; - $Gct_saturday_start = "$rowx[17]"; - $Gct_saturday_stop = "$rowx[18]"; - $Gct_state_call_times = "$rowx[19]"; - - $ct_states = ''; - $ct_state_gmt_SQL = ''; - $ct_srs=0; - $b=0; - if (strlen($Gct_state_call_times)>2) - { - $state_rules = explode('|',$Gct_state_call_times); - $ct_srs = ((count($state_rules)) - 2); - } - while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>1) - { - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Gstate_call_time_id = "$row[0]"; - $Gstate_call_time_state = "$row[1]"; - $Gsct_default_start = "$row[4]"; - $Gsct_default_stop = "$row[5]"; - $Gsct_sunday_start = "$row[6]"; - $Gsct_sunday_stop = "$row[7]"; - $Gsct_monday_start = "$row[8]"; - $Gsct_monday_stop = "$row[9]"; - $Gsct_tuesday_start = "$row[10]"; - $Gsct_tuesday_stop = "$row[11]"; - $Gsct_wednesday_start = "$row[12]"; - $Gsct_wednesday_stop = "$row[13]"; - $Gsct_thursday_start = "$row[14]"; - $Gsct_thursday_stop = "$row[15]"; - $Gsct_friday_start = "$row[16]"; - $Gsct_friday_stop = "$row[17]"; - $Gsct_saturday_start = "$row[18]"; - $Gsct_saturday_stop = "$row[19]"; - - $ct_states .="'$Gstate_call_time_state',"; - - $r=0; - $state_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday local time - { - if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday local time - { - if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday local time - { - if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday local time - { - if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday local time - { - if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday local time - { - if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday local time - { - if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - $state_gmt = "$state_gmt'99'"; - $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; - } - - $b++; - } - if (strlen($ct_states)>2) - { - $ct_states = eregi_replace(",$",'',$ct_states); - $ct_statesSQL = "and state NOT IN($ct_states)"; - } - else - { - $ct_statesSQL = ""; - } - - $r=0; - $default_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday local time - { - if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday local time - { - if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday local time - { - if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday local time - { - if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday local time - { - if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday local time - { - if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday local time - { - if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - - $default_gmt = "$default_gmt'99'"; - $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; - - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL"; - #$DB=1; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rslt_rows = mysql_num_rows($rslt); - if ($rslt_rows) - { - $rowx=mysql_fetch_row($rslt); - $active_leads = "$rowx[0]"; - } - else {$active_leads = '0';} - - echo "This campaign has $active_leads leads to be dialed in those lists\n"; - } - else - { - echo "no active lists selected for this campaign\n"; - } - } -else - { - echo "no active lists selected for this campaign\n"; - } -##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### -} -?> diff --git a/LANG_admin/vicidial/admin_modify_lead.php b/LANG_admin/vicidial/admin_modify_lead.php deleted file mode 100644 index 9dad4f62..00000000 --- a/LANG_admin/vicidial/admin_modify_lead.php +++ /dev/null @@ -1,476 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} - elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} -if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} - elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} -if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} - elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} - elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead - -# CHANGES -# -# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user -# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60609-1112 - Added DNC list addition if status changed to DNC -# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat -# - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Lead record modification - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "information modified

\n"; - echo "\n"; - - if ( ($dispo != $status) and ($dispo == 'CBHOLD') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - - if ( ($dispo != $status) and ($status == 'DNC') ) - { - ### add lead to the internal DNC list - $stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; - } - -} -else -{ - - if ($CBchangeUSERtoANY == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to ANYONE
\n"; - } - if ($CBchangeUSERtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record user changed to $CBuser
\n"; - } - if ($CBchangeANYtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; - } - - - - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Call information: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select * from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } - - - - - - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - -echo "

\n"; - -echo "
\n"; - -echo "CALLS TO THIS LEAD:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD
$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial/admin_search_lead.php b/LANG_admin/vicidial/admin_search_lead.php deleted file mode 100644 index a727e3a1..00000000 --- a/LANG_admin/vicidial/admin_search_lead.php +++ /dev/null @@ -1,224 +0,0 @@ - LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php -# -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead -# -# changes: -# 60620-1055 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - Changed results to multi-record -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Lead Search - -Lead Lookup - - - -
\n"; - echo "
\n"; - echo "\n"; - echo "Please enter a:
Vendor ID(vendor lead code): or \n"; - echo "
a Home Phone Number: or\n"; - echo "
a lead ID:

\n"; - echo "
\n"; - echo "\n
\n"; - echo "\n"; - exit; - } - -else - { - - if ($vendor_id) - { - $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000"; - } - else - { - if ($phone) - { - $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000"; - } - else - { - if ($lead_id) - { - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000"; - } - else - { - print "ERROR: you must search for something! Go back and search for something"; - exit; - } - } - } - if ($DB) - { - echo "\n\n$stmt\n\n"; - } - - $rslt=mysql_query($stmt, $link); - $results_to_print = mysql_num_rows($rslt); - if ($results_to_print < 1) - { - echo date("l F j, Y G:i:s A"); - echo "\n

\n"; - echo "The search variables you entered are not active in the system

\n"; - echo "Please go back and double check the information you entered and submit again\n"; - echo "
\n"; - echo "\n"; - exit; - } - else - { - echo "RESULTS: $results_to_print

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $o=0; - while ($results_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $o++; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "
#LEAD IDSTATUSVENDOR IDLAST AGENTLIST IDPHONENAMECITYSECURITYLAST CALL
$o$row[0]$row[3]$row[5]$row[4]$row[7]$row[11]$row[13] $row[15]$row[19]$row[28]$row[2]
\n"; - } - } - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\nNEW SEARCH"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; - - -?> - - - - - diff --git a/LANG_admin/vicidial/closer-fronter_popup.php b/LANG_admin/vicidial/closer-fronter_popup.php deleted file mode 100644 index 53a1a41d..00000000 --- a/LANG_admin/vicidial/closer-fronter_popup.php +++ /dev/null @@ -1,508 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - - -#$DB = '1'; # DEBUG override -$US = '_'; -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$REC_TIME = date("Ymd-His"); -$FILE_datetime = $STARTtime; -$parked_time = $STARTtime; - -# $ext_context = 'default'; defined in dbconnect file - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - if ( (strlen($customer_zap_channel)>2) and (eregi('zap',$customer_zap_channel)) ) - { - echo "\n\n"; - echo "\n\n"; - - } - else - { - echo "Bad channel: $customer_zap_channel\n"; - echo "Make sure the Zap channel is live and try again\n"; - exit; - } - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL FRONTER-CLOSER: Popup\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - -# $stmt="DELETE from parked_channels where server_ip='$server_ip' and parked_time='$parked_time' and channel='$channel' LIMIT 1"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RZ$FILE_datetime$user"; - - ### insert a NEW record to the vicidial_manager table to be processed - - $channel = $customer_zap_channel; - $channel = eregi_replace('Zap/', "", $channel); - $SIPexten = eregi_replace('SIP/', "", $SIPexten); - $filename = "$REC_TIME$US$SIPexten"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - # Local/78600098@demo-6617,2 - - $stmt = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$server_ip','','Originate','$DTqueryCID','Channel: $local_DEF$conf_silent_prefix$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $recording_exten','Priority: 1','Callerid: $filename','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('Zap/$channel','$server_ip','SIP/$SIPexten','$NOW_TIME','$STARTtime','$filename')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - - echo "Recording command sent for channel $channel - $filename - $recording_id       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='$user'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $user - $full_name\n

\n"; - - $url = "http://10.10.99.2/vicidial/closer_dispo.php?lead_id=$lead_id&channel=$channel&server_ip=$server_ip&extension=$SIPexten&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - -# $stmt="UPDATE park_log set grab_time='$NOW_TIME',status='TALKING',extension='$extension',user='$user' where parked_time='$parked_time' and server_ip='$server_ip' and channel='$channel'"; -# if ($DB) {echo "|$stmt|\n";} -# $fp = fopen ("./closer_SQL_updates.txt", "a"); -# fwrite ($fp, "$date|$user|$stmt|\n"); -# fclose($fp); -# $rslt=mysql_query($stmt, $link); - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### -if (eregi('CL_TEST',$channel_group)) - { - echo "GALLERIA TEST CLOSER GROUP: $channel_group\n"; - - $stmt="SELECT user,phone_number from vicidial_list where lead_id='$parked_by';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $fronter=$row[0]; - $search_phone=$row[1]; - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -- INTERNAL CALL GALLERIA FRONT --
\n"; - $group_color='#99FF99'; - } - if (eregi('CL_GALLER2',$channel_group)) - { - echo "
-- TouchAsia CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER3',$channel_group)) - { - echo "
-- DebitSupplies CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER4',$channel_group)) - { - echo "
-- Vishnu CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Record command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Please go back and try again\n

\n"; -# echo "
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial/closer-fronter_popup2.php b/LANG_admin/vicidial/closer-fronter_popup2.php deleted file mode 100644 index 2cbadf1a..00000000 --- a/LANG_admin/vicidial/closer-fronter_popup2.php +++ /dev/null @@ -1,423 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - - -#$DB = '1'; # DEBUG override -$US = '_'; -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$REC_TIME = date("Ymd-His"); -$FILE_datetime = $STARTtime; -$parked_time = $STARTtime; - -# $ext_context = 'default'; defined in dbconnect file -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if (!$auth) - { - if ( (strlen($PHP_AUTH_USER)>1) and ( (eregi("tsr",$PHP_AUTH_PW)) or (eregi("sales",$PHP_AUTH_PW)) ) ) - { - $auth=1; - $user = $PHP_AUTH_USER; - $pass = $PHP_AUTH_PW; - } - } - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER - $user - $PHP_AUTH_USER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - if ( (strlen($customer_zap_channel)>2) and ( (eregi('zap',$customer_zap_channel)) or (eregi('iax',$customer_zap_channel)) ) ) - { - echo "\n\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - } - else - { - echo "Bad channel: $customer_zap_channel\n"; - echo "Make sure the Zap channel is live and try again\n"; - exit; - } - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL FRONTER-CLOSER: Popup\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - -# $stmt="DELETE from parked_channels where server_ip='$server_ip' and parked_time='$parked_time' and channel='$channel' LIMIT 1"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RZ$FILE_datetime$user"; - - ### insert a NEW record to the vicidial_manager table to be processed - - $channel = $customer_zap_channel; -# $channel = eregi_replace('Zap/', "", $channel); - $SIPexten = eregi_replace('SIP/', "", $SIPexten); - $filename = "$REC_TIME$US$SIPexten"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - # Local/78600098@demo-6617,2 - - $stmt = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$server_ip','','Originate','$DTqueryCID','Channel: $local_DEF$conf_silent_prefix$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $recording_exten','Priority: 1','Callerid: $filename','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','SIP/$SIPexten','$NOW_TIME','$STARTtime','$filename')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - - echo "Recording command sent for channel $channel - $filename - $recording_id       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='$fronter'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $fronter - $full_name\n

\n"; - - $url = "http://10.10.10.196/vicidial/closer_dispo.php?lead_id=$lead_id&channel=$channel&server_ip=$server_ip&extension=$SIPexten&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - $stmt="SELECT group_name,group_color from vicidial_inbound_groups where group_id='$channel_group'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $group_name = $row[0]; - $group_color = $row[1]; - - echo "
\n"; - echo "
$channel_group - $group_name

\n\n"; - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### - -if (eregi('CL',$channel_group)) - { - if (strlen($phone) > 9) {$search_phone = $phone;} - if ( (strlen($search_phone) < 10) or (strlen($fronter) < 1) ) - { - echo "\n"; - $stmt="SELECT user,phone_number from vicidial_list where lead_id='$parked_by';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($fronter) < 1) {$fronter=$row[0];} - if (strlen($search_phone) < 10) {$search_phone=$row[1];} - } - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Record command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Please go back and try again\n

\n"; -# echo "
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial/closer.php b/LANG_admin/vicidial/closer.php deleted file mode 100644 index dbd9efe7..00000000 --- a/LANG_admin/vicidial/closer.php +++ /dev/null @@ -1,345 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["group_selected"])) {$group_selected=$_GET["group_selected"];} - elseif (isset($_POST["group_selected"])) {$group_selected=$_POST["group_selected"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["groupselect"])) {$groupselect=$_GET["groupselect"];} - elseif (isset($_POST["groupselect"])) {$groupselect=$_POST["groupselect"];} -if (isset($_GET["PHONE_LOGIN"])) {$PHONE_LOGIN=$_GET["PHONE_LOGIN"];} - elseif (isset($_POST["PHONE_LOGIN"])) {$PHONE_LOGIN=$_POST["PHONE_LOGIN"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["debugvars"])) {$debugvars=$_GET["debugvars"];} - elseif (isset($_POST["debugvars"])) {$debugvars=$_POST["debugvars"];} -if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} - elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './closer_popup.php'; - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - -$color_class[0] = 'green'; -$color_class[1] = 'red'; -$color_class[2] = 'blue'; -$color_class[3] = 'purple'; -$color_class[4] = 'orange'; -$color_class[5] = 'green'; -$color_class[6] = 'red'; -$color_class[7] = 'blue'; -$color_class[8] = 'purple'; -$color_class[9] = 'orange'; -?> - - - - - -VICIDIAL CLOSER: Main - - -
- - 0) - { - $stmt="SELECT dialplan_number,server_ip from phones where extension='$extension';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dialplan_number=$row[0]; - $server_ip=$row[1]; - - if (!$group_selected) - { - $stmt="select distinct channel_group from park_log;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $groups_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - echo "
Please select the groups you want to pick calls up from:
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Inbound Call Groups:
\n"; - $o=0; - while ($groups_to_print > $o) - { - $group_form_print = sprintf("%-20s", $groups[$o]); - echo "$group_form_print
\n"; - $o++; - } - echo "
\n"; - echo "\n"; - echo "


\n"; - } - else - { - $o=0; - while($o < $group_selected) - { - $form_groups = "$form_groups&groupselect[$o]=$groupselect[$o]"; - $o++; - } - - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGIN','CLOSER','$NOW_TIME','$STARTtime');"; - $rslt=mysql_query($stmt, $link); - - echo"\n"; - echo"\n"; - - echo "extension found, forwarding you to closer page, please wait 3 seconds...
\n"; - } - - } - else - { - echo "The extension you entered does not exist, please try again
\n"; - echo "
Please enter your phone_ID: \n"; - echo "\n"; - echo "phone station ID:   \n"; - echo "\n"; - echo "


\n"; - } - - } - else - { - echo "
Please enter your phone_ID: \n"; - echo "\n"; - echo "phone station ID:   \n"; - echo "\n"; - echo "


\n"; - } - -exit; - -} - -$o=0; -while($o < $group_selected) -{ - $listen_groups = "$listen_groups     $groupselect[$o]"; - $form_groups = "$form_groups&groupselect[$o]=$groupselect[$o]"; - $o++; -} - - -echo"\n"; -echo"\n"; - -#CHANNEL SERVER CHANNEL_GROUP EXTENSION PARKED_BY PARKED_TIME -#---------------------------------------------------------------------------------------------- -#Zap/73-1 10.10.11.11 IN_800_TPP_CS TPPpark 7275338730 2004-04-22 12:41:00 - - - -echo "$NOW_TIME           $PHP_AUTH_USER - $fullname - CALLS SENT TO: $dialplan_number

\n"; - -echo "Click on the channel below that you would like to have directed to your phone
\n"; - -echo "
\n";
-echo "CHANNEL    SERVER        CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME         \n";
-echo "---------------------------------------------------------------------------------------------- \n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='$server_ip'";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='$server_ip' and channel_group LIKE \"CL_%\" order by channel_group,parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$park_extension =	sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		$G='';   $EG='';
-		$o=0;
-		$with_color=0;
-		while($o < $group_selected)
-			{
-				if (eregi("$groupselect[$o]",$channel_group))
-					{
-					$G=""; $EG='';
-					$with_color++;
-					}
-				$o++;
-			}
-		if ($with_color)
-			{
-			if (eregi('CL_GAL',$row[2]))
-				{
-				echo "$G$channel$server$channel_group$park_extension                     $parked_time $EG\n";
-				}
-			else
-				{
-				echo "$G$channel$server$channel_group$park_extension$parked_by$parked_time $EG\n";
-				}
-			}
-#	
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "********************************************************************************************** \n";
-	echo "********************************************************************************************** \n";
-	echo "*************************************** NO PARKED CALLS ************************************** \n";
-	echo "********************************************************************************************** \n";
-	echo "********************************************************************************************** \n";
-	}
-
-echo "  \n\n";
-echo "looking for calls on these groups:\n";
-$o=0;
-while($o < $group_selected)
-{
-	$group_print =		sprintf("%-20s", $groupselect[$o]);
-	echo "             - $group_print\n";
-	$o++;
-}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial/closer_dispo.php b/LANG_admin/vicidial/closer_dispo.php deleted file mode 100644 index 54e61219..00000000 --- a/LANG_admin/vicidial/closer_dispo.php +++ /dev/null @@ -1,329 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer disposition screen of a call that has been grabbed. This allows the closer to modify customer information and disposition the call -# CHANGES -# -# 60619-1641 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -VICIDIAL CLOSER: Call Disposition -\n"; -?> - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from live_channels where server_ip='$server_ip' and channel='" . mysql_real_escape_string($channel) . "' and extension like \"%" . mysql_real_escape_string($extension) . "%\""; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $parked_count = $row[0]; - - if ($parked_count > 0) - { - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Hangup','$DTqueryCID','Channel: " . mysql_real_escape_string($channel) . "','','','','','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Hangup command sent for channel $channel       $NOW_TIME\n

\n"; - - echo "\n"; - } - else - { - echo "Hangup command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "
\n"; - } -} -else -{ - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Call information: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Campaign ID: $campaign_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial/closer_popup.php b/LANG_admin/vicidial/closer_popup.php deleted file mode 100644 index 6c1db90e..00000000 --- a/LANG_admin/vicidial/closer_popup.php +++ /dev/null @@ -1,445 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["group_selected"])) {$group_selected=$_GET["group_selected"];} - elseif (isset($_POST["group_selected"])) {$group_selected=$_POST["group_selected"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["groupselect"])) {$groupselect=$_GET["groupselect"];} - elseif (isset($_POST["groupselect"])) {$groupselect=$_POST["groupselect"];} -if (isset($_GET["PHONE_LOGIN"])) {$PHONE_LOGIN=$_GET["PHONE_LOGIN"];} - elseif (isset($_POST["PHONE_LOGIN"])) {$PHONE_LOGIN=$_POST["PHONE_LOGIN"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["debugvars"])) {$debugvars=$_GET["debugvars"];} - elseif (isset($_POST["debugvars"])) {$debugvars=$_POST["debugvars"];} -if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} - elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - - -#$DB=1; -$US = '_'; -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$REC_TIME = date("Ymd-His"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL CLOSER: Popup\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - $stmt="DELETE from parked_channels where server_ip='$server_ip' and parked_time='$parked_time' and channel='$channel' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - - #$monitor_channel = eregi_replace('Zap/', "", $channel); - $monitor_channel = eregi_replace('-1', "", $channel); - $SIPexten = $extension; - $filename = "$REC_TIME$US$SIPexten"; - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: $monitor_channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - -# $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$monitor_channel','$server_ip','SIP/$SIPexten','$NOW_TIME','$STARTtime','$filename')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - -# $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; -# $rslt=mysql_query($stmt, $link); -# if ($DB) {echo "$stmt\n";} -# $row=mysql_fetch_row($rslt); -# $recording_id = $row[0]; - -# echo "Recording command sent for channel $channel - $filename - $recording_id
\n"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: $channel','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for channel $channel       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='$parked_by'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $parked_by - $full_name\n

\n"; - - $url = "http://10.10.10.196/vicidial/closer_dispo.php?lead_id=$parked_by&channel=$channel&server_ip=$server_ip&extension=$extension&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - - $stmt="UPDATE park_log set grab_time='$NOW_TIME',status='TALKING',extension='$extension',user='$PHP_AUTH_USER' where parked_time='$parked_time' and server_ip='$server_ip' and channel='$channel'"; - if ($DB) {echo "|$stmt|\n";} - $fp = fopen ("./closer_SQL_updates.txt", "a"); - fwrite ($fp, "$date|$PHP_AUTH_USER|$stmt|\n"); - fclose($fp); - - - $rslt=mysql_query($stmt, $link); - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### -if (eregi('CL_TEST',$channel_group)) - { - echo "GALLERIA TEST CLOSER GROUP: $channel_group\n"; - - $stmt="SELECT user,phone_number from vicidial_list where lead_id='$parked_by';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $fronter=$row[0]; - $search_phone=$row[1]; - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -- INTERNAL CALL GALLERIA FRONT --
\n"; - $group_color='#99FF99'; - } - if (eregi('CL_GALLER2',$channel_group)) - { - echo "
-- TouchAsia CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER3',$channel_group)) - { - echo "
-- DebitSupplies CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER4',$channel_group)) - { - echo "
-- Vishnu CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Redirect command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial/count.htm b/LANG_admin/vicidial/count.htm deleted file mode 100644 index 51f8a361..00000000 --- a/LANG_admin/vicidial/count.htm +++ /dev/null @@ -1 +0,0 @@ - diff --git a/LANG_admin/vicidial/dbconnect.php b/LANG_admin/vicidial/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_admin/vicidial/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_admin/vicidial/group_hourly_stats.php b/LANG_admin/vicidial/group_hourly_stats.php deleted file mode 100644 index b7eb1b31..00000000 --- a/LANG_admin/vicidial/group_hourly_stats.php +++ /dev/null @@ -1,252 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1014 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];} - elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$date_with_hour_default = date("Y-m-d H"); -$date_no_hour_default = $TODAY; - -if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} - $date_no_hour = $date_with_hour; - $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - -# $stmt="SELECT full_name from vicidial_users where user='$user';"; -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: Group Hourly Stats -\n"; -?> - - -
- - - - - -= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDtotal[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDday[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDcount[$o] = "$row[0]"; - $o++; - } - -echo "
  VICIDIAL ADMIN: Group Hourly Stats  
\n"; - -echo "
\n"; - -echo "TSR HOUR COUNTS: $group | $status | $date_with_hour | $date_no_hour\n"; - -echo "
\n"; -echo "\n"; - - $day_calls=0; - $hour_calls=0; - $total_calls=0; - $o=0; - while($o < $tsrs_to_print) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $VDtotal[$o]); - $hour_calls = ($hour_calls + $VDcount[$o]); - $day_calls = ($day_calls + $VDday[$o]); - - $o++; - } - -echo "\n"; - - -} - -echo "
TSR ID   $status   TOTAL CALLS   $status DAY    
$VDuser[$o] $VDname[$o] $VDcount[$o] $VDtotal[$o] $VDday[$o]MODIFY | STATS
TOTAL $status $hour_calls $total_calls $day_calls
\n"; -echo "

\n"; - - - echo "
Please enter the group you want to get hourly stats for:
\n"; - echo "\n"; - echo "group:
\n"; - echo "status:   (example: XFER)
\n"; - echo "date with hour:   (example: 2004-06-25 14)
\n"; - echo "\n"; - echo "


\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial/help.gif b/LANG_admin/vicidial/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/vicidial/help.gif and /dev/null differ diff --git a/LANG_admin/vicidial/listloader.php b/LANG_admin/vicidial/listloader.php deleted file mode 100644 index 920505a8..00000000 --- a/LANG_admin/vicidial/listloader.php +++ /dev/null @@ -1,698 +0,0 @@ - LICENSE: GPLv2 -# -# AST Web GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1006 - added listID override and gmt_offset lookup while loading -# 60619-1652 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -# - -$version = '1.1.12'; -$build = '60619-1652'; - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];} -$list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - - -#$DB=1; -#$DBX=1; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('listloader.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HELP\""; - - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -?> - - - - - - method=post enctype="multipart/form-data"> -
- - - - - - - - - - - - - -
Load leads from this file:
List ID Override: (numbers only or leave blank for values in the file)
CLICK HERE TO GO TO THE SUPER LEAD LOADER (BETA VERSION)     BACK TO ADMIN
- -document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - $pulldate=date("Y-m-d H:i:s"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("./vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city = $row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) - { - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $gmt_offset = '0'; - $called_since_last_reset='N'; - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =='1') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### MEXICO ### - if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### AUSTRALIA ### - if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - print ""; -} else if (filesize($leadfile)>8388608) { - print "
ERROR: File exceeds the 8MB limit.
"; -} -?> - - diff --git a/LANG_admin/vicidial/listloader.pl b/LANG_admin/vicidial/listloader.pl deleted file mode 100644 index 753c31f7..00000000 --- a/LANG_admin/vicidial/listloader.pl +++ /dev/null @@ -1,690 +0,0 @@ -#!/usr/bin/perl - -### listloader.pl -### -### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 -### -# -# -# CHANGES -# 60616-1548 - Added listID override feature to force all leads into same list -# - Added gmt_offset_now lookup for each lead -# - -### begin parsing run-time options ### -if (length($ARGV[0])>1) -{ - $i=0; - while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } - - if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - } - else - { - if ($args =~ /--forcelistid=/i) - { - @data_in = split(/--forcelistid=/,$args); - $forcelistid = $data_in[1]; - print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; - } - else - {$forcelistid = '';} - } -} -### end parsing run-time options ### - - -use Spreadsheet::ParseExcel; -use Time::Local; -use Net::MySQL; - -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file - -if (!$DB_port) {$DB_port='3306';} - -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; - - -$|=0; -$secX = time(); - -($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); -$year = ($year + 1900); -$mon++; -if ($hour < 10) {$hour = "0$hour";} -if ($min < 10) {$min = "0$min";} -if ($sec < 10) {$sec = "0$sec";} -if ($mon < 10) {$mon = "0$mon";} -if ($mday < 10) {$mday = "0$mday";} -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$pulldate="$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - - ### Grab Server values from the database - $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $DBSERVER_GMT = "$record->[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} - } - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -if ($isdst) {$LOCAL_GMT_OFF++;} -if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - - -$total=0; $good=0; $bad=0; -print "
Processing Excel file...\n"; -open(STMT_FILE, "> listloader_stmts.txt"); - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); -my($iR, $iC, $oWkS, $oWkC); - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { - - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $oWkC = $oWkS->{Cells}[$iR][0]; - if ($oWkC) {$vendor_lead_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][1]; - if ($oWkC) {$source_code=$oWkC->Value; } - $source_id=$source_code; - $oWkC = $oWkS->{Cells}[$iR][2]; - if ($oWkC) {$list_id=$oWkC->Value; } - $gmt_offset = '0'; - $called_since_last_reset='N'; - $oWkC = $oWkS->{Cells}[$iR][3]; - if ($oWkC) {$phone_code=$oWkC->Value; } - $phone_code=~s/[^0-9]//g; - $oWkC = $oWkS->{Cells}[$iR][4]; - if ($oWkC) {$phone_number=$oWkC->Value; } - $phone_number=~s/[^0-9]//g; - $USarea = substr($phone_number, 0, 3); - $oWkC = $oWkS->{Cells}[$iR][5]; - if ($oWkC) {$title=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][6]; - if ($oWkC) {$first_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][7]; - if ($oWkC) {$middle_initial=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][8]; - if ($oWkC) {$last_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][9]; - if ($oWkC) {$address1=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][10]; - if ($oWkC) {$address2=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][11]; - if ($oWkC) {$address3=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][12]; - if ($oWkC) {$city=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][13]; - if ($oWkC) {$state=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][14]; - if ($oWkC) {$province=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][15]; - if ($oWkC) {$postal_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][16]; - if ($oWkC) {$country=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][17]; - if ($oWkC) {$gender=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][18]; - if ($oWkC) {$date_of_birth=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][19]; - if ($oWkC) {$alt_phone=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][20]; - if ($oWkC) {$email=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][21]; - if ($oWkC) {$security_phrase=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][22]; - if ($oWkC) {$comments=$oWkC->Value; } - $comments=~s/^\s*(.*?)\s*$/$1/; - - if (length($phone_number)>8) { - if (length($forcelistid) > 0) - { - $list_id = $forcelistid; # set list_id to override value - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### MEXICO ### - if ($phone_code =~ /^52$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### AUSTRALIA ### - if ($phone_code =~ /^61$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); - $year = ($year + 1900); - $mon++; - if ($mon < 10) {$mon = "0$mon";} - if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$hour = "0$hour";} - if ($min < 10) {$min = "0$min";} - if ($sec < 10) {$sec = "0$sec";} - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - &USA_dstcalc; - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - &GBR_dstcalc; - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - &AUS_dstcalc; - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - &AUST_dstcalc; - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - &NZL_dstcalc; - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $dbhA->query("$stmtZ"); - print STMT_FILE $stmtZ."\r\n"; - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - sleep(1); -# flush(); - } - } -} - -if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; - $dbhA->query("$stmtZ"); - print STMT_FILE $stmtZ."\r\n"; -} - -print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - -exit; - - - - - - -sub USA_dstcalc { -#********************************************************************** -# FSA-LSO -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in April and last Sunday in October at 2 am. -# INPUTS: -# mm INTEGER Month. -# dd INTEGER Day of the month. -# ns INTEGER Seconds into the day. -# dow INTEGER Day of week (0=Sunday, to 6=Saturday) -# OPTIONAL INPUT: -# timezone INTEGER hour difference UTC - local standard time -# (DEFAULT is blank) -# make calculations based on UTC time, -# which means shift at 10:00 UTC in April -# and 9:00 UTC in October -# OUTPUT: -# INTEGER 1 = DST, 0 = not DST -#********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; return 0; - } elsif ($mm >= 5 && $mm <= 9) { - $USA_DST=1; return 1; - } elsif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $USA_DST=0; return 0; - } else { - $USA_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 7200) { - $USA_DST=0; return 0; - } else { - $USA_DST=1; return 1; - } - } - } else { - $USA_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $USA_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; return 1; - } else { - $USA_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; return 1; - } else { - $USA_DST=0; return 0; - } - } - } else { - $USA_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub GBR_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in March and last Sunday in October at 1 am. -#********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; return 0; - } elsif ($mm >= 4 && $mm <= 9) { - $GBR_DST=1; return 1; - } elsif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $GBR_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } - } else { - $GBR_DST=1; return 1; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $GBR_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } - } else { - $GBR_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub AUS_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUS_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUS_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } - } else { - $AUS_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $AUS_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } - } else { - $AUS_DST=1; return 1; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub AUST_dstcalc { -#********************************************************************** -# TASMANIA ONLY -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUST_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUST_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } - } else { - $AUST_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } - } else { - $AUST_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub NZL_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and third Sunday in March at 1 am. -#********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $NZL_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; return 1; - } elsif ($dd < ($dow+14)) { - $NZL_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } - } else { - $NZL_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } - } else { - $NZL_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc diff --git a/LANG_admin/vicidial/listloaderMAIN.php b/LANG_admin/vicidial/listloaderMAIN.php deleted file mode 100644 index 67ee25bc..00000000 --- a/LANG_admin/vicidial/listloaderMAIN.php +++ /dev/null @@ -1,79 +0,0 @@ - LICENSE: GPLv2 -# -# this is the main frame page for the lead loading section. This is where you -# would upload a file and have it inserted into vicidial_list -# -# changes: -# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - -VICIDIAL: Lead Loader Module - - - - - \ No newline at end of file diff --git a/LANG_admin/vicidial/listloader_rowdisplay.pl b/LANG_admin/vicidial/listloader_rowdisplay.pl deleted file mode 100644 index ca0da8c5..00000000 --- a/LANG_admin/vicidial/listloader_rowdisplay.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl -use Spreadsheet::ParseExcel; -use Time::Local; -use Net::MySQL; - -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file - -if (!$DB_port) {$DB_port='3306';} - -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; - - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); -my($iR, $iC, $oWkS, $oWkC); -$var_str=""; - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) { - $oWkC = $oWkS->{Cells}[0][$iC]; - if ($oWkC) { - $var_str.=$oWkC->Value."|"; - } else { - $var_str.="|"; - } - } -} - -@xls_row=split(/\|/, $var_str); - - -$dbhA->query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1"); - -if ($dbhA->has_selected_record) { - $rslt = $dbhA->create_record_iterator(); - my @row = $rslt->get_field_names(); - for ($i=0; $i\r\n"; - print "
".$field_name.": \r\n"; - print " \r\n"; - print "
- - - - - - - - - - - - - - - - - -
Load leads from this file:
List ID Override: (numbers only or leave blank for values in the file)
File layout to use:Standard VICIDIAL    Custom layout
        
CLICK HERE TO GO TO THE BASIC LEAD LOADER         BACK TO ADMIN
SUPER LIST LOADER-     VERSION:     BUILD:
- - -document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - $total=0; $good=0; $bad=0; - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Processing $delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - print "
Processing Excel file... \n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

\n"; - } - # print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override"); - } else { - # copy($leadfile, "./vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - } - print ""; - } - -if ($leadfile && filesize($LF_path)<=8388608) { - $total=0; $good=0; $bad=0; - if ($file_layout=="standard") { - - print ""; - flush(); - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } - print ""; - - } else { - print "
"; - flush(); - print "\r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Processing $delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - $total=0; $good=0; $bad=0; - $row=fgetcsv($file, 1000, ","); - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print "
VICIDIAL ColumnFile data
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
        
\r\n"; - # } - print ""; - } -} else if (filesize($leadfile)>8388608) { - print "
ERROR: File exceeds the 8MB limit.
"; -} -?> - - - - - - - - - 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### MEXICO ### -if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### AUSTRALIA ### -if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### ALL OTHER COUNTRY CODES ### -if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - -### Find out if DST to raise the gmt offset ### -$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); -$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - -$AC_processed=0; -if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } -if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - -return $gmt_offset; -} \ No newline at end of file diff --git a/LANG_admin/vicidial/record_conf_1_hour.php b/LANG_admin/vicidial/record_conf_1_hour.php deleted file mode 100644 index 59ae1f09..00000000 --- a/LANG_admin/vicidial/record_conf_1_hour.php +++ /dev/null @@ -1,156 +0,0 @@ - LICENSE: GPLv2 -### -# grab: $server_ip $station $session_id -# -# CHANGES -# -# 60620-1011 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["station"])) {$station=$_GET["station"];} - elseif (isset($_POST["station"])) {$station=$_POST["station"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["NEW_RECORDING"])) {$NEW_RECORDING=$_GET["NEW_RECORDING"];} - elseif (isset($_POST["NEW_RECORDING"])) {$NEW_RECORDING=$_POST["NEW_RECORDING"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$MYSQL_datetime = date("Y-m-d H:i:s"); -$FILE_datetime = date("Ymd-His_"); -$secX = $STARTtime; - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL RECORD CONFERENCE: 1 hour -\n"; -?> - - -
- - 8) && (strlen($session_id) > 3) && (strlen($station) > 3) ) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $conf_silent_prefix = '7'; - $ext_context = 'demo'; - - $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Originate','RB$FILE_datetime" . mysql_real_escape_string($station) . "','Channel: $local_DEF$conf_silent_prefix" . mysql_real_escape_string($session_id) . "$local_AMP$ext_context','Context: $ext_context','Exten: 8309','Priority: 1','Callerid: $FILE_datetime" . mysql_real_escape_string($station) . "','','','','','')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('" . mysql_real_escape_string($session_id) . "','" . mysql_real_escape_string($server_ip) . "','" . mysql_real_escape_string($station) . "','$MYSQL_datetime','$secX','$FILE_datetime" . mysql_real_escape_string($station) . "')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - echo "Recording started\n

\n"; - echo "Back to main recording screen\n

\n"; - } - else - { - echo "ERROR!!!! Not all info entered properly\n

\n"; - echo "|$server_ip| |$session_id| |$station|\n

\n"; - echo "Back to main recording screen\n

\n"; - } -} -else -{ -echo "
Start recording a conference for 1 hour:
\n"; -echo "\n"; -echo "server_ip: | \n"; -echo "session_id: | \n"; -echo "station: | \n"; -echo "\n"; -echo "


\n"; - - - -} -?> - - \ No newline at end of file diff --git a/LANG_admin/vicidial/remote_dispo.php b/LANG_admin/vicidial/remote_dispo.php deleted file mode 100644 index da249fba..00000000 --- a/LANG_admin/vicidial/remote_dispo.php +++ /dev/null @@ -1,327 +0,0 @@ - LICENSE: GPLv2 -### -# this is the remote agent disposition screen for calls sent to remote agents. This allows the remote agent to modify customer information and disposition the call - -# CHANGES -# -# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat -# - - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -VICIDIAL REMOTE: Call Disposition -\n"; -?> - - -
- -"; - -if ($end_call > 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Call has been dispositioned       $NOW_TIME\n

\n"; - - echo "\n"; - -} -else -{ - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Call information: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Campaign ID: $campaign_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial/server_stats.php b/LANG_admin/vicidial/server_stats.php deleted file mode 100644 index a427f5c0..00000000 --- a/LANG_admin/vicidial/server_stats.php +++ /dev/null @@ -1,96 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: Server Stats and Reports -VICIDIAL: Server Stats and Reports                           -BACK TO ADMIN

- - -

-
- $o)
-	{
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	$o++;
-	}
-
-?>
-
SERVERDESCRIPTIONIP ADDRESSACTIVEVDAD timeVDcall timePARK timeCLOSER/INBOUND time
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
- - \ No newline at end of file diff --git a/LANG_admin/vicidial/test.txt b/LANG_admin/vicidial/test.txt deleted file mode 100644 index 70c379b6..00000000 --- a/LANG_admin/vicidial/test.txt +++ /dev/null @@ -1 +0,0 @@ -Hello world \ No newline at end of file diff --git a/LANG_admin/vicidial/user_stats.php b/LANG_admin/vicidial/user_stats.php deleted file mode 100644 index bdada227..00000000 --- a/LANG_admin/vicidial/user_stats.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: User Stats -\n"; -?> - - -
- - - - - -\n"; -echo "
  VICIDIAL ADMIN: User Stats for  
  \n"; - -echo "
\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - -echo "
\n"; - -echo "TALK TIME AND STATUS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - -echo "\n"; -echo "
STATUSCOUNTHOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LOGIN/LOGOUT TIME:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); - $event_minutes = ($event_hours - $event_hours_int); - $event_minutes = ($event_minutes * 60); - $event_minutes_int = round($event_minutes, 0); - if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - } - - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - -$total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); -$total_login_minutes = ($total_login_hours - $total_login_hours_int); -$total_login_minutes = ($total_login_minutes * 60); -$total_login_minutes_int = round($total_login_minutes, 0); -if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} - -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "
EVENT DATE CAMPAIGNHOURS:MINUTES
$row[0] $row[2] $row[3]
$row[0] $row[2] $row[3] $event_hours_int:$event_minutes_int
$row[0] $row[2] $row[3]
TOTAL $total_login_hours_int:$total_login_minutes_int
\n"; - - -echo "

\n"; - -echo "
\n"; - -echo "LAST 50 CALLS:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS PHONE CAMPAIGN LIST LEAD
$row[4] $row[7] $row[8] $row[10] $row[3] $row[2] $row[1]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial/user_status.php b/LANG_admin/vicidial/user_status.php deleted file mode 100644 index 8efe670f..00000000 --- a/LANG_admin/vicidial/user_status.php +++ /dev/null @@ -1,238 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $change_agent_campaign=$row[1]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - $stmt="SELECT * from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $agents_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $agents_to_print) - { - $row=mysql_fetch_row($rslt); - $Aserver_ip = $row[2]; - $Asession_id = $row[3]; - $Aextension = $row[4]; - $Astatus = $row[5]; - $Acampaign = $row[7]; - $Alast_call = $row[14]; - $Acl_campaigns = $row[15]; - $i++; - } - - } - -$stmt="select * from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - - - -?> - - -VICIDIAL ADMIN: User Status -\n"; -?> - - -
-
- - - - -\n"; -echo "
  VICIDIAL ADMIN: User Status for  
  \n"; - -if ($stage == "live_campaign_change") -{ - $stmt="UPDATE vicidial_live_agents set campaign_id='" . mysql_real_escape_string($group) . "' where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name changed to $group campaign
\n"; - - exit; -} - -if ($stage == "log_agent_out") -{ - $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser
\n"; - - exit; -} - -if ($agents_to_print > 0) -{ - echo "
";
-	echo "Agent Logged in at server:  $Aserver_ip\n";
-	echo "               in session:  $Asession_id\n";
-	echo "               from phone:  $Aextension\n";
-	echo "Agent is in campaign:       $Acampaign\n";
-	echo "              status:       $Astatus\n";
-	echo " hungup last call at:       $Alast_call\n";
-	echo "       Closer groups:       $Acl_campaigns\n\n";
-
-	echo "
"; - - - if ($change_agent_campaign > 0) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "Current Campaign: \n"; - echo "
\n"; - - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - } -} - -else -{ - echo "Agent is not logged in\n
"; - -} - - -echo "           $user - $full_name - \n"; - -echo "VICIDIAL Time Sheet\n"; - -echo "
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - -echo "|$stage|$group|"; - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial/vdremote.php b/LANG_admin/vicidial/vdremote.php deleted file mode 100644 index dfe11fa3..00000000 --- a/LANG_admin/vicidial/vdremote.php +++ /dev/null @@ -1,602 +0,0 @@ - LICENSE: GPLv2 -# -# Changes -# 50307-1721 - First version -# 51123-1502 - removed requirement of PHP Globals=on -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time - -$version = '1.1.12'; -$build = '60619-1603'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($force_logout)) {$force_logout = 0;} - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$popup_page = './closer_popup.php'; -$STARTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - $stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $authx=$row[0]; - - if($authx>0) - { - $stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id=$row[0]; - $server_ip=$row[1]; - if (!$number_of_lines) {$number_of_lines=$row[2];} - - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; - exit; - } - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -if ($ADD==61111) - { - echo"\n"; - } -echo "\n"; -?> - -VICIDIAL REMOTE AGENTS: $LOGfullname - $PHP_AUTH_USER "; - -if (!$ADD) {$ADD="31111";} -if ($ADD==31111) {echo "Modify Remote Agents";} -if ($ADD==41111) {echo "Modify Remote Agents";} -if ($ADD==61111) {echo "Remote Agent Status";} -if ($ADD==71111) {echo "Remote Agent Closer Stats";} - - -if (strlen($ADD)>4) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "2) {$groups_value .= " -";} - } - -?> - - - -
-
- - - -
  VICIDIAL REMOTE AGENTS:   Logout  
  MODIFY | ">STATUS | ">INBOUND STATS
-"; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: $user_start
Number of Lines: (numbers only)
Server IP: $row[3]
External Extension: (number dialed to reach agents [i.e. 913125551212])
Status:
Campaign: $campaign_id
Inbound Groups: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) - {echo "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - $stmt="UPDATE vicidial_remote_agents set number_of_lines='" . mysql_real_escape_string($number_of_lines) . "', conf_exten='" . mysql_real_escape_string($conf_exten) . "', status='" . mysql_real_escape_string($status) . "', closer_campaigns='" . mysql_real_escape_string($groups_value) . "' where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - -# echo "$stmt\n"; - echo "
REMOTE AGENTS MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - - } - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: $user_start
Number of Lines: (numbers only)
Server IP: $row[3]
External Extension: (number dialed to reach agents [i.e. 913125551212])
Status:
Campaign: $campaign_id
Inbound Groups: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - - - -###################### -# ADD=61111 status of remote agent in the system and active calls and queue -###################### - -if ($ADD==61111) -{ - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'" . mysql_real_escape_string($nextuser) . "',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - echo "VICIDIAL: Remote Agent Time On Calls $NOW_TIME\n\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $leadlink=0; - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[3]=''; - $row[5]=' - WAITING - '; - $row[6]=$row[7]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $leadid = sprintf("%-12s", $row[2]); - if ($row[2] > 0) - { - $leadidLINK=$row[2]; - $leadlink++; - if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;} - $leadid = "$leadid"; - } - $channel = sprintf("%-10s", $row[3]); - $cc=0; - while ( (strlen($channel) > 10) and ($cc < 100) ) - { - $channel = eregi_replace(".$","",$channel); - $cc++; - if (strlen($channel) <= 10) {$cc=101;} - } - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = ($STARTtime - $row[6]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} - if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo " $i agents logged in on server $server_ip\n\n"; - - echo " - 5 minutes or more on call\n"; - echo " - Over 10 minutes on call\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "********************************* NO AGENTS ON CALLS *********************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - -###################### -# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log) -###################### - -if ($ADD==71111) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'$nextuser',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $in_calls = $row[0]; - $in_time = $row[1]; - $in_time_M = ($in_time / 60); - $in_time_M = round($in_time_M, 2); - $in_time_M_int = intval("$in_time_M"); - $in_time_SEC = ($in_time_M - $in_time_M_int); - $in_time_SEC = ($in_time_SEC * 60); - $in_time_SEC = round($in_time_SEC, 0); - if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";} - $in_time_MS = "$in_time_M_int:$in_time_SEC"; - $in_time_MS = sprintf("%7s", $in_time_MS); - - echo "VICIDIAL: Remote Agent inbound stats $NOW_TIME\n\n"; - echo "\n"; - echo "Total calls taken $query_date: $in_calls\n"; - echo "Total talk time on $query_date: $in_time_MS (minutes:seconds)\n"; - echo "\n"; - echo "\n"; - echo "Call list for $query_date:\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - $user = sprintf("%-8s", $row[0]); - $leadid = sprintf("%-10s", $row[1]); - $group = sprintf("%-14s", $row[2]); - $phone = sprintf("%-10s", $row[3]); - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = $row[6]; - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - # if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - # echo " $i agents logged in on server $server_ip\n\n"; - - # echo " - 5 minutes or more on call\n"; - # echo " - Over 10 minutes on call\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "********************************* NO CALLS ON THIS DAY *******************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_de/AST_CLOSERstats.php b/LANG_admin/vicidial_de/AST_CLOSERstats.php deleted file mode 100644 index e96e2319..00000000 --- a/LANG_admin/vicidial_de/AST_CLOSERstats.php +++ /dev/null @@ -1,396 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select group_id from vicidial_inbound_groups;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Genauerer Notfall\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "WÄHLEN Sie BITTE Eine KAMPAGNE Vor UND DATUM OBEN UND KLICKEN REICHTEin\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Automobil-Vorwahlknopf Genauerer Notfall                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Gesamtanrufe gesetzt von dieser Kampagne:                       $TOTALcalls\n";
-echo "Durchschnittliche Anruf-Länge für alle benennt in den Sekunden: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Gesamt-TROPFEN Anrufe:                                          $DROPcalls  $DROPpercent%\n";
-echo "Durchschnittliche Länge für TROPFEN Anrufe in den Sekunden:     $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| BENUTZER | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN DER GESAMTANRUFE GESETZTVON DIESER KAMPAGNE\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/AST_VDADstats.php b/LANG_admin/vicidial_de/AST_VDADstats.php deleted file mode 100644 index 67764a49..00000000 --- a/LANG_admin/vicidial_de/AST_VDADstats.php +++ /dev/null @@ -1,417 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "WÄHLEN Sie BITTE Eine KAMPAGNE Vor UND DATUM OBEN UND KLICKEN REICHTEin\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Gesamtanrufe gesetzt von dieser Kampagne:                       $TOTALcalls\n";
-echo "Durchschnittliche Anruf-Länge für alle benennt in den Sekunden: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Gesamt-TROPFEN Anrufe:                                          $DROPcalls  $DROPpercent%\n";
-echo "Durchschnittliche Länge für TROPFEN Anrufe in den Sekunden:     $average_hold_seconds\n";
-
-echo "\n";
-echo "----------AUTO-DIAL KEINE ANTWORTEN\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='NA' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$NAcalls =	sprintf("%10s", $row[0]);
-$NApercent = (($NAcalls / $TOTALcalls) * 100);
-$NApercent = round($NApercent, 0);
-
-$average_na_seconds = ($row[1] / $row[0]);
-$average_na_seconds = round($average_na_seconds, 0);
-$average_na_seconds =	sprintf("%10s", $average_na_seconds);
-
-echo "Gesamt-Na benennt - beschäftigt, Trennung, BTvoicemail:         $NAcalls  $NApercent%\n";
-echo "Durchschnittliche Anruf-Länge für Na benennt in den Sekunden:   $average_na_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| BENUTZER | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "DIAGRAMM IN 15 MINUZIÖSEN STUFENSPRÜNGEN DER GESAMTANRUFE GESETZTVON DIESER KAMPAGNE\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/AST_VICIDIAL_hopperlist.php b/LANG_admin/vicidial_de/AST_VICIDIAL_hopperlist.php deleted file mode 100644 index f6b51205..00000000 --- a/LANG_admin/vicidial_de/AST_VICIDIAL_hopperlist.php +++ /dev/null @@ -1,161 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.10.15';} - -$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $campaign_id[$i] =$row[0]; - $campaign_name[$i] =$row[1]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Zufuhrbehälter-Liste\n"; -echo "
\n"; -#echo "\n"; -#echo "\n"; -echo "\n"; -echo "\n"; -echo "           ÄNDERN Sie \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "WÄHLEN Sie BITTE Eine KAMPAGNE OBEN Vor UND KLICKEN REICHT Ein\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Gegenwärtige Zufuhrbehälter-Lebhaftliste                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-
-echo "Gesamtleitungen im Zufuhrbehälter im Augenblick:       $TOTALcalls\n";
-
-
-##############################
-#########  LEAD STATS
-
-echo "\n";
-echo "---------- LEADS IN HOPPER\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-echo "|      | LEAD_ID   | PHONE NUM  | STATE | STATUS | COUNT | GMT    |\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$FMT_i =		sprintf("%-4s", $i);
-	$lead_id =		sprintf("%-9s", $row[0]);
-	$phone_number =	sprintf("%-10s", $row[1]);
-	$state =		sprintf("%-5s", $row[2]);
-	$status =		sprintf("%-6s", $row[3]);
-	$count =		sprintf("%-5s", $row[4]);
-	$gmt =			sprintf("%-6s", $row[5]);
-
-	echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt |\n";
-
-	$i++;
-	}
-
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/AST_admin_log_display.php b/LANG_admin/vicidial_de/AST_admin_log_display.php deleted file mode 100644 index c9fad01a..00000000 --- a/LANG_admin/vicidial_de/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
-
-#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
-passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/AST_agent_performance.php b/LANG_admin/vicidial_de/AST_agent_performance.php deleted file mode 100644 index 7947c17f..00000000 --- a/LANG_admin/vicidial_de/AST_agent_performance.php +++ /dev/null @@ -1,232 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Agent Performance\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A BEDIENERAND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:33:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:33:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:33:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:33:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_de/AST_agent_performance_detail.php b/LANG_admin/vicidial_de/AST_agent_performance_detail.php
deleted file mode 100644
index 02a7c24a..00000000
--- a/LANG_admin/vicidial_de/AST_agent_performance_detail.php
+++ /dev/null
@@ -1,406 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($group)) {$group = '';}
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-$stmt="select campaign_id from vicidial_campaigns;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$campaigns_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $campaigns_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 03:45:00";   
-	$query_date_END = "$query_date 15:15:00";
-	$time_BEGIN = "03:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:15:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$TOTtotWAIT=($TOTtotWAIT + $row[7]);
-	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
-	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-	$USERtotPAUSE =	$row[5];
-	$USERavgPAUSE =	$row[6];
-	$USERtotWAIT =	$row[7];
-	$USERavgWAIT =	$row[8];
-	$USERtotDISPO =	$row[9];
-	$USERavgDISPO =	$row[10];
-
-	$USERtime_M = ($USERtime / 60);
-	$USERtime_M = round($USERtime_M, 2);
-	$USERtime_M_int = intval("$USERtime_M");
-	$USERtime_S = ($USERtime_M - $USERtime_M_int);
-	$USERtime_S = ($USERtime_S * 60);
-	$USERtime_S = round($USERtime_S, 0);
-	if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
-	$USERtime_MS = "$USERtime_M_int:$USERtime_S";
-	$pfUSERtime_MS[$i] =		sprintf("%7s", $USERtime_MS);
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-
-	$USERtotPAUSE_M = ($USERtotPAUSE / 60);
-	$USERtotPAUSE_M = round($USERtotPAUSE_M, 2);
-	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M");
-	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
-	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
-	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
-	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
-	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
-	$pfUSERtotPAUSE_MS[$i] =		sprintf("%6s", $USERtotPAUSE_MS);
-
-	$USERavgPAUSE_M = ($USERavgPAUSE / 60);
-	$USERavgPAUSE_M = round($USERavgPAUSE_M, 2);
-	$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M");
-	$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
-	$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
-	$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
-	if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
-	$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
-	$pfUSERavgPAUSE_MS[$i] =		sprintf("%6s", $USERavgPAUSE_MS);
-
-	$USERtotWAIT_M = ($USERtotWAIT / 60);
-	$USERtotWAIT_M = round($USERtotWAIT_M, 2);
-	$USERtotWAIT_M_int = intval("$USERtotWAIT_M");
-	$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
-	$USERtotWAIT_S = ($USERtotWAIT_S * 60);
-	$USERtotWAIT_S = round($USERtotWAIT_S, 0);
-	if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
-	$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
-	$pfUSERtotWAIT_MS[$i] =		sprintf("%6s", $USERtotWAIT_MS);
-
-	$USERavgWAIT_M = ($USERavgWAIT / 60);
-	$USERavgWAIT_M = round($USERavgWAIT_M, 2);
-	$USERavgWAIT_M_int = intval("$USERavgWAIT_M");
-	$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
-	$USERavgWAIT_S = ($USERavgWAIT_S * 60);
-	$USERavgWAIT_S = round($USERavgWAIT_S, 0);
-	if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
-	$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
-	$pfUSERavgWAIT_MS[$i] =		sprintf("%6s", $USERavgWAIT_MS);
-	
-	$USERtotDISPO_M = ($USERtotDISPO / 60);
-	$USERtotDISPO_M = round($USERtotDISPO_M, 2);
-	$USERtotDISPO_M_int = intval("$USERtotDISPO_M");
-	$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
-	$USERtotDISPO_S = ($USERtotDISPO_S * 60);
-	$USERtotDISPO_S = round($USERtotDISPO_S, 0);
-	if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
-	$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
-	$pfUSERtotDISPO_MS[$i] =		sprintf("%6s", $USERtotDISPO_MS);
-
-	$USERavgDISPO_M = ($USERavgDISPO / 60);
-	$USERavgDISPO_M = round($USERavgDISPO_M, 2);
-	$USERavgDISPO_M_int = intval("$USERavgDISPO_M");
-	$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
-	$USERavgDISPO_S = ($USERavgDISPO_S * 60);
-	$USERavgDISPO_S = round($USERavgDISPO_S, 0);
-	if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
-	$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
-	$pfUSERavgDISPO_MS[$i] =		sprintf("%6s", $USERavgDISPO_MS);
-
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]);	$TOT_CB = ($TOT_CB + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtime_M = ($TOTtime / 60);
-	$TOTtime_M = round($TOTtime_M, 2);
-	$TOTtime_M_int = intval("$TOTtime_M");
-	$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
-	$TOTtime_S = ($TOTtime_S * 60);
-	$TOTtime_S = round($TOTtime_S, 0);
-	if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
-	$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
-	$TOTtime_MS =		sprintf("%7s", $TOTtime_MS);
-		while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOTtotDISPO_M = ($TOTtotDISPO / 60);
-	$TOTtotDISPO_M = round($TOTtotDISPO_M, 2);
-	$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M");
-	$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
-	$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
-	$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
-	if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
-	$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
-	$TOTtotDISPO_MS =		sprintf("%7s", $TOTtotDISPO_MS);
-		while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
-
-	$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
-	$TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2);
-	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M");
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
-	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
-	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
-	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
-	$TOTtotPAUSE_MS =		sprintf("%7s", $TOTtotPAUSE_MS);
-		while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
-
-	$TOTtotWAIT_M = ($TOTtotWAIT / 60);
-	$TOTtotWAIT_M = round($TOTtotWAIT_M, 2);
-	$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M");
-	$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
-	$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
-	$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
-	if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
-	$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
-	$TOTtotWAIT_MS =		sprintf("%7s", $TOTtotWAIT_MS);
-		while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
-
-
-	$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);
-	$TOTavgTALK_M = round($TOTavgTALK_M, 2);
-	$TOTavgTALK_M_int = intval("$TOTavgTALK_M");
-	$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
-	$TOTavgTALK_S = ($TOTavgTALK_S * 60);
-	$TOTavgTALK_S = round($TOTavgTALK_S, 0);
-	if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
-	$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
-	$TOTavgTALK_MS =		sprintf("%6s", $TOTavgTALK_MS);
-		while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
-
-	$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);
-	$TOTavgDISPO_M = round($TOTavgDISPO_M, 2);
-	$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M");
-	$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
-	$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
-	$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
-	if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
-	$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
-	$TOTavgDISPO_MS =		sprintf("%6s", $TOTavgDISPO_MS);
-		while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
-
-	$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);
-	$TOTavgPAUSE_M = round($TOTavgPAUSE_M, 2);
-	$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M");
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
-	$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
-	if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
-	$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
-	$TOTavgPAUSE_MS =		sprintf("%6s", $TOTavgPAUSE_MS);
-		while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
-
-	$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);
-	$TOTavgWAIT_M = round($TOTavgWAIT_M, 2);
-	$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M");
-	$TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int);
-	$TOTavgWAIT_S = ($TOTavgWAIT_S * 60);
-	$TOTavgWAIT_S = round($TOTavgWAIT_S, 0);
-	if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";}
-	$TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S";
-	$TOTavgWAIT_MS =		sprintf("%6s", $TOTavgWAIT_MS);
-		while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
-
-	
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_CB = sprintf("%-5s", $TOT_CB);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_de/AST_agent_time_sheet.php b/LANG_admin/vicidial_de/AST_agent_time_sheet.php
deleted file mode 100644
index ccc62e80..00000000
--- a/LANG_admin/vicidial_de/AST_agent_time_sheet.php
+++ /dev/null
@@ -1,281 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
-	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["calls_summary"]))				{$calls_summary=$_GET["calls_summary"];}
-	elseif (isset($_POST["calls_summary"]))		{$calls_summary=$_POST["calls_summary"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN MITTELID AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from available agent log data\n";
-}
-
-else
-{
-$query_date_BEGIN = "$query_date 00:00:00";   
-$query_date_END = "$query_date 23:59:59";
-$time_BEGIN = "00:00:00";   
-$time_END = "23:59:59";
-
-$stmt="select full_name from vicidial_users where user='$agent';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$full_name = $row[0];
-
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- MITTELTIME SHEET: $agent - $full_name -------------\n\n";
-
-if ($calls_summary)
-	{
-	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
-
-		$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "GESAMTANRUFETAKEN: $row[0]\n";
-	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
-	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
-	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
-	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
-	echo "----------------------------------------------------------------\n";
-	echo "TOTAL ACTIVE MITTELTIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_de/AST_server_performance.php b/LANG_admin/vicidial_de/AST_server_performance.php
deleted file mode 100644
index 6331a75a..00000000
--- a/LANG_admin/vicidial_de/AST_server_performance.php
+++ /dev/null
@@ -1,310 +0,0 @@
-    LICENSE: GPLv2
-#
-# CHANGES
-#
-# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))	{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-# path from root to where ploticus files will be stored
-$DOCroot = "$WeBServeRRooT/vicidial/ploticus/";
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-if (!isset($group)) {$group = '';}
-
-$stmt="select server_ip from servers;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$servers_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $servers_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Server Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "             REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A BEDIENERAND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:32:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:32:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- TOTALS, PEAKS and AVERAGES\n";
-
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGload =	sprintf("%10s", $row[0]);
-$AVGchannels =	sprintf("%10s", $row[1]);
-
-$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGcpuUSER =	sprintf("%10s", $row[0]);
-$AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
-$AVGcpuIDLE =	sprintf("%10s", $row[2]);
-
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-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','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
-
-
-echo "Total Calls in/out on this server:        $TOTALcalls\n";
-echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
-echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
-echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
-echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
-
-echo "\n";
-echo "---------- LINE GRAPH:\n";
-
-
-
-##############################
-#########  Graph stats
-
-$DAT = '.dat';
-$HTM = '.htm';
-$PNG = '.png';
-$filedate = date("Y-m-d_His");
-$DATfile = "$group$query_date$shift$filedate$DAT";
-$HTMfile = "$group$query_date$shift$filedate$HTM";
-$PNGfile = "$group$query_date$shift$filedate$PNG";
-
-$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
-$DATfp = fopen ("$DOCroot/$DATfile", "a");
-
-$stmt="select DATE_FORMAT(start_time,'%H:%i:%s') as timex,sysload,processes,channels_total,live_recordings,cpu_user_percent,cpu_system_percent from server_performance where server_ip='" . mysql_real_escape_string($group) . "' and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' order by timex;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$row[5] = intval(($row[5] + $row[6]) * $HIGHmulti);
-	$row[6] = intval($row[6] * $HIGHmulti);
-	fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
-	$i++;
-	}
-fclose($DATfp);
-
-$rows_to_max = ($rows_to_print + 100);
-
-
-
-$HTMcontent  = '';
-$HTMcontent .= "#proc page\n";
-$HTMcontent .= "#if @DEVICE in png,gif\n";
-$HTMcontent .= "   scale: 0.6\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#endif\n";
-$HTMcontent .= "#proc getdata\n";
-$HTMcontent .= "file: $DOCroot/$DATfile\n";
-$HTMcontent .= "fieldnames: userproc sysproc time load processes channels\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc areadef\n";
-$HTMcontent .= "title: Server $group   $query_date_BEGIN to $query_date_END\n";
-$HTMcontent .= "titledetails: size=14  align=C\n";
-$HTMcontent .= "rectangle: 1 1 14 7\n";
-$HTMcontent .= "xscaletype: time hh:mm:ss\n";
-$HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
-$HTMcontent .= "stubformat: hh:mm:ssa\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc yaxis\n";
-$HTMcontent .= "stubs: inc 50\n";
-$HTMcontent .= "grid: color=yellow\n";
-$HTMcontent .= "gridskip: min\n";
-$HTMcontent .= "ticincrement: 100 1000\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: userproc\n";
-$HTMcontent .= "linedetails: color=purple width=.5\n";
-$HTMcontent .= "fill: lavender\n";
-$HTMcontent .= "legendlabel: user proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: sysproc\n";
-$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
-$HTMcontent .= "fill: dullyellow\n";
-$HTMcontent .= "legendlabel: system proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: load\n";
-$HTMcontent .= "linedetails: color=blue width=.5\n";
-$HTMcontent .= "legendlabel: load\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: processes\n";
-$HTMcontent .= "linedetails: color=red width=.5\n";
-$HTMcontent .= "legendlabel: processes\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: channels\n";
-$HTMcontent .= "linedetails: color=green width=.5\n";
-$HTMcontent .= "legendlabel: channels\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc legend\n";
-$HTMcontent .= "location: max-2 max\n";
-$HTMcontent .= "seglen: 0.2\n";
-$HTMcontent .= "\n";
-
-fwrite ($HTMfp, "$HTMcontent");
-fclose($HTMfp);
-
-
-passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
-
-sleep(1);
-
-echo "
\n"; -echo "\n"; -echo "\n"; - - -echo ""; - -} - - - -?> - - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/AST_timeonVDAD.php b/LANG_admin/vicidial_de/AST_timeonVDAD.php deleted file mode 100644 index cc3fb242..00000000 --- a/LANG_admin/vicidial_de/AST_timeonVDAD.php +++ /dev/null @@ -1,255 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 60620-1040 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Mittel Setzen Bei den Anrufen Zeit fest        $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL    | STATUS | START TIME          | MINUTES |\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	$agentcount=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- WARTEND -';
-			$row[6]=$row[7];
-			}
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$sessionid =		sprintf("%-9s", $row[2]);
-		$channel =			sprintf("%-10s", $row[3]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[4]);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 5) {$G=''; $EG='';}
-		if ($call_time_M_int >= 10) {$G=''; $EG='';}
-		if (eregi("PAUSED",$row[4])) 
-			{
-			if ($call_time_M_int >= 1) 
-				{$i++; continue;} 
-			else
-				{$G=''; $EG='';}
-			}
-
-		$agentcount++;
-		echo "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-		echo "  $agentcount Mittel geloggt innen auf Bediener $server_ip\n\n";
-
-		echo "             - Pausierte Mittel\n";
-		echo "             - 5 Minuten oder mehr beim Anruf\n";
-		echo "             - Über 10 Minuten beim Anruf\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "*********************************KEINE MITTEL BEI DEN ANRUFEN*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-echo "| CHANNEL    | STATUS | CAMPAIGN | PHONE NUMBER       | START TIME          | MINUTES |\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-8s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-		echo "  $i Anrufe, die auf Bediener gesetzt werden $server_ip\n\n";
-
-		echo "             - PHASENCANKLOPFEN\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "*******************************KEIN PHASENCANKLOPFEN*********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - diff --git a/LANG_admin/vicidial_de/AST_timeonVDAD_closer.php b/LANG_admin/vicidial_de/AST_timeonVDAD_closer.php deleted file mode 100644 index b7e87d02..00000000 --- a/LANG_admin/vicidial_de/AST_timeonVDAD_closer.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# CHANGES -# -# 60620-1037 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - -\n"; -echo " - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Mittel Setzen Bei den Anrufen Zeit fest        $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
-			}
-		$extension[$i] =		sprintf("%-10s", $row[0]);
-		$user[$i] =				sprintf("%-6s", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
-			$cc[$i]=0;
-		while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
-			{
-			$channel[$i] = eregi_replace(".$","",$channel[$i]);   
-			$cc[$i]++;
-			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
-			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
-			$cd[$i]=0;
-		while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
-			{
-			$start_time[$i] = eregi_replace("^.","",$start_time[$i]);   
-			$cd[$i]++;
-			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
-			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
-
-		$call_time_M[$i] = ($call_time_S[$i] / 60);
-		$call_time_M[$i] = round($call_time_M[$i], 2);
-		$call_time_M_int[$i] = intval("$call_time_M[$i]");
-		$call_time_SEC[$i] = ($call_time_M[$i] - $call_time_M_int[$i]);
-		$call_time_SEC[$i] = ($call_time_SEC[$i] * 60);
-		$call_time_SEC[$i] = round($call_time_SEC[$i], 0);
-		if ($call_time_SEC[$i] < 10) {$call_time_SEC[$i] = "0$call_time_SEC[$i]";}
-		$call_time_MS[$i] = "$call_time_M_int[$i]:$call_time_SEC[$i]";
-		$call_time_MS[$i] =		sprintf("%7s", $call_time_MS[$i]);
-		$i++;
-		}
-		$ext_count = $i;
-		$i=0;
-	while ($i < $ext_count)
-		{
-
-		$stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$camp_to_print = mysql_num_rows($rslt);
-		if ($camp_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$campaign = sprintf("%-12s", $row[0]);
-			$camp_color = $row[0];
-			}
-		else
-			{$campaign = 'DEAD        ';   	$camp_color = 'DEAD';}
-		if (eregi("READY|PAUSED|CLOSER",$status[$i]))
-			{$campaign = '            ';   	$camp_color = '';}
-
-		$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$xfer_to_print = mysql_num_rows($rslt);
-		if ($xfer_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$fronter = sprintf("%-6s", $row[0]);
-			}
-		else
-			{$fronter = '      ';}
-
-		$G = '';		$EG = '';
-		$G=""; $EG='';
-	#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
-	#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-
-		echo "| $G$extension[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-		echo "  $i Mittel geloggt innen auf Bediener $server_ip\n\n";
-
-	#	echo "             - 5 Minuten oder mehr beim Anruf\n";
-	#	echo "             - Über 10 Minuten beim Anruf\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "*********************************KEINE MITTEL BEI DEN ANRUFEN*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-#echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-echo "| CHANNEL             | STATUS | CAMPAIGN     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-19s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 19) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 19) {$cc=101;}
-			}
-		$start_time =		sprintf("%-8s", $row[5]);
-			$cd=0;
-		while ( (strlen($start_time) > 8) and ($cd < 100) )
-			{
-			$start_time = eregi_replace("^.","",$start_time);   
-			$cd++;
-			if (strlen($start_time) <= 8) {$cd=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-12s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-		echo "  $i Anrufe, die auf Bediener gesetzt werden $server_ip\n\n";
-
-		echo "             - PHASENCANKLOPFEN\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "*******************************KEIN PHASENCANKLOPFEN*********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/AST_timeonVDADall.php b/LANG_admin/vicidial_de/AST_timeonVDADall.php deleted file mode 100644 index 4ad6fb65..00000000 --- a/LANG_admin/vicidial_de/AST_timeonVDADall.php +++ /dev/null @@ -1,349 +0,0 @@ - LICENSE: GPLv2 -# -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60511-1343 - Added leads and drop info at the top of the screen -# 60608-1539 - Fixed CLOSER tallies for active calls -# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($group)) {$group='';} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -$rslt=mysql_query($stmt, $link); -if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!isset($RR)) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if (!isset($reset_counter)) {$reset_counter=0;} -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Kampagne: $group\n"; -echo "
\n"; -echo "VICIDIAL: Realtime Kampagne: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         ÄNDERN Sie | REPORTS \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$HOPlev = $row[8]; - -echo "
"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$VDhop = $row[0]; - -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
DIAL LEVEL:  $row[0]    STATUSES:  $row[1], $row[2], $row[3], $row[4], $row[5]     ORDER:  $row[6]     FILTER:  $row[7]    
HOPPER LEVEL:  $HOPlev     LEADS IN HOPPER:  $VDhop     DIALABLE LEADS:  $DAleads       TIME:
CALLS TODAY:  $callsTODAY     CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
"; - - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; - } -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo "KEIN PHASENCANKLOPFEN\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Kampagne: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | BEDIENERIP | CALL BEDIENERIP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; - - $Aecho .= " - Pausierte Mittel\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo "KEINE MITTEL BEI DEN ANRUFEN\n";
-	}
-
-?>
-
- - diff --git a/LANG_admin/vicidial_de/AST_timeonVDADall_SIPmonitor.php b/LANG_admin/vicidial_de/AST_timeonVDADall_SIPmonitor.php deleted file mode 100644 index dff474ef..00000000 --- a/LANG_admin/vicidial_de/AST_timeonVDADall_SIPmonitor.php +++ /dev/null @@ -1,301 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Kampagne: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Kampagne: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         ÄNDERN Sie | REPORTS \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo "KEIN PHASENCANKLOPFEN\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Kampagne: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | BEDIENERIP | CALL BEDIENERIP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTERN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Pausierte Mittel\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo "KEINE MITTEL BEI DEN ANRUFEN\n";
-	}
-
-?>
-
- - - - - - - diff --git a/LANG_admin/vicidial_de/AST_timeoncall.php b/LANG_admin/vicidial_de/AST_timeoncall.php deleted file mode 100644 index 4227f836..00000000 --- a/LANG_admin/vicidial_de/AST_timeoncall.php +++ /dev/null @@ -1,180 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Call\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Call                                          $NOW_TIME\n\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-echo "| STATION    | SESSIONID | CHANNEL   | NUMBER DIALED    | START TIME          | MINUTES |\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-
-$stmt="SELECT count(*) from live_sip_channels where server_ip='$server_ip';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="select extension from live_channels where server_ip='$server_ip';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$ext_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_zap_counter=0;
-	$sessions = '';
-	while ($i < $ext_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if (preg_match("/^8600/i",$row[0]))
-			{
-			$sessions .= "$row[0]|";
-			}
-		$i++;
-		}
-	$sessions = preg_replace("/\|$/",'',$sessions);
-
-	if ($DB) {echo "SESSIONS: -$sessions-\n";}
-
-	$stmt="select * from live_sip_channels where server_ip='$server_ip' order by channel;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_calls_counter=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ( (preg_match("/Zap\/|internal|ring/i",$row[3])) or (preg_match("/Local\//i",$row[0])) )
-			{
-			if ($DB) {echo "NOT STATION |$row[0]|$row[3]|\n";}
-			$session_id = '';
-			}
-		else 
-			{
-			if (preg_match("/$row[3]/i",$sessions))
-				{
-				if ($DB) {echo "LIVE STATION|$row[0]|$row[3]|\n";}
-				$session_id = $row[3];
-				$station = preg_replace("/SIP\//",'',$row[0]);
-				$station = preg_replace("/-.*/",'',$station);
-			
-				$LIVE_sessions[$live_calls_counter] =			"$session_id";
-				$LIVE_sessions_FORMAT[$live_calls_counter] =	sprintf("%-9s", $session_id);
-				$LIVE_stations[$live_calls_counter] =			"$station";
-				$LIVE_stations_FORMAT[$live_calls_counter] =	sprintf("%-10s", $station);
-
-		#		echo "| $station | $session_id | \n";
-
-				$live_calls_counter++;
-				}
-			else
-				{
-				if ($DB) {echo "NOT STATIONZ|$row[0]|$row[3]|\n";}
-				$session_id = '';
-				}
-			}
-
-		$i++;
-		}
-
-		if ($live_calls_counter > 0)
-		{
-		$i=0;
-		$LC_counter = $live_calls_counter;
-
-		while ($i < $live_calls_counter)
-			{
-			$stmt="select channel,extension,number_dialed,start_time,start_epoch from call_log where extension='$LIVE_stations[$i]' and server_ip='$server_ip' order by uniqueid desc LIMIT 1;";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$parked_to_print = mysql_num_rows($rslt);
-			$row=mysql_fetch_row($rslt);
-
-			$channel =			sprintf("%-9s", $row[0]);
-			$number_dialed =	sprintf("%-16s", $row[2]);
-			$start_time =		sprintf("%-19s", $row[3]);
-			$call_time_S = ($STARTtime - $row[4]);
-
-			$call_time_M = ($call_time_S / 60);
-			$call_time_M = round($call_time_M, 2);
-			$call_time_M_int = intval("$call_time_M");
-			$call_time_SEC = ($call_time_M - $call_time_M_int);
-			$call_time_SEC = ($call_time_SEC * 60);
-			$call_time_SEC = round($call_time_SEC, 0);
-			if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-			$call_time_MS = "$call_time_M_int:$call_time_SEC";
-			$call_time_MS =		sprintf("%7s", $call_time_MS);
-			$G = '';		$EG = '';
-			if ($call_time_M_int >= 12) {$G=''; $EG='';}
-			if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-			echo "| $G$LIVE_stations_FORMAT[$i]$EG | $G$LIVE_sessions_FORMAT[$i]$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-			$i++;
-			}
-
-		echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-		echo "  $i stations on live calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on live call\n";
-		echo "             - Over 30 minutes on live call\n";
-
-		}
-		else
-		{
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*************************************** NO LIVE STATIONS ********************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		}
-
-	}
-	else
-	{
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*************************************** NO LIVE STATIONS ********************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	}
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/AST_timeonpark.php b/LANG_admin/vicidial_de/AST_timeonpark.php deleted file mode 100644 index 46aee71b..00000000 --- a/LANG_admin/vicidial_de/AST_timeonpark.php +++ /dev/null @@ -1,197 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$timeONEhoursAGO = ($STARTtime - 3600); -$epochHALFhoursAGO = ($STARTtime - 1860); -$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO); -$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - $stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Park\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Park                       $NOW_TIME\n\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 1) {$G=''; $EG='';}
-		if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+-----------------+---------------------+---------+\n";
-		echo "  $i callers waiting on server $server_ip\n\n";
-
-		echo "             - 1 minute or more on hold\n";
-		echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	echo "********************KEIN PHASENCANKLOPFEN*********************\n";
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	}
-
-###################################################################################
-###### TIME ON INBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Agents Time On Inbound Calls                             $NOW_TIME\n\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-echo "| STATION    | USER   | CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 12) {$G=''; $EG='';}
-		if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-		echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-		echo "  $i agents on calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on call\n";
-		echo "             - Over 30 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "*********************************KEINE MITTEL BEI DEN ANRUFEN*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/admin.php b/LANG_admin/vicidial_de/admin.php deleted file mode 100644 index 67d396e3..00000000 --- a/LANG_admin/vicidial_de/admin.php +++ /dev/null @@ -1,6514 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["user_level"])) {$user_level=$_GET["user_level"];} - elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];} -if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} - elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["campaign_name"])) {$campaign_name=$_GET["campaign_name"];} - elseif (isset($_POST["campaign_name"])) {$campaign_name=$_POST["campaign_name"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["park_ext"])) {$park_ext=$_GET["park_ext"];} - elseif (isset($_POST["park_ext"])) {$park_ext=$_POST["park_ext"];} -if (isset($_GET["park_file_name"])) {$park_file_name=$_GET["park_file_name"];} - elseif (isset($_POST["park_file_name"])) {$park_file_name=$_POST["park_file_name"];} -if (isset($_GET["web_form_address"])) {$web_form_address=$_GET["web_form_address"];} - elseif (isset($_POST["web_form_address"])) {$web_form_address=$_POST["web_form_address"];} -if (isset($_GET["allow_closers"])) {$allow_closers=$_GET["allow_closers"];} - elseif (isset($_POST["allow_closers"])) {$allow_closers=$_POST["allow_closers"];} -if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} - elseif (isset($_POST["hopper_level"])) {$hopper_level=$_POST["hopper_level"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["next_agent_call"])) {$next_agent_call=$_GET["next_agent_call"];} - elseif (isset($_POST["next_agent_call"])) {$next_agent_call=$_POST["next_agent_call"];} -if (isset($_GET["local_call_time"])) {$local_call_time=$_GET["local_call_time"];} - elseif (isset($_POST["local_call_time"])) {$local_call_time=$_POST["local_call_time"];} -if (isset($_GET["voicemail_ext"])) {$voicemail_ext=$_GET["voicemail_ext"];} - elseif (isset($_POST["voicemail_ext"])) {$voicemail_ext=$_POST["voicemail_ext"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} - elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} -if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} - elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["group_color"])) {$group_color=$_GET["group_color"];} - elseif (isset($_POST["group_color"])) {$group_color=$_POST["group_color"];} -if (isset($_GET["fronter_display"])) {$fronter_display=$_GET["fronter_display"];} - elseif (isset($_POST["fronter_display"])) {$fronter_display=$_POST["fronter_display"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["dial_status_a"])) {$dial_status_a=$_GET["dial_status_a"];} - elseif (isset($_POST["dial_status_a"])) {$dial_status_a=$_POST["dial_status_a"];} -if (isset($_GET["dial_status_b"])) {$dial_status_b=$_GET["dial_status_b"];} - elseif (isset($_POST["dial_status_b"])) {$dial_status_b=$_POST["dial_status_b"];} -if (isset($_GET["dial_status_c"])) {$dial_status_c=$_GET["dial_status_c"];} - elseif (isset($_POST["dial_status_c"])) {$dial_status_c=$_POST["dial_status_c"];} -if (isset($_GET["dial_status_d"])) {$dial_status_d=$_GET["dial_status_d"];} - elseif (isset($_POST["dial_status_d"])) {$dial_status_d=$_POST["dial_status_d"];} -if (isset($_GET["dial_status_e"])) {$dial_status_e=$_GET["dial_status_e"];} - elseif (isset($_POST["dial_status_e"])) {$dial_status_e=$_POST["dial_status_e"];} -if (isset($_GET["lead_order"])) {$lead_order=$_GET["lead_order"];} - elseif (isset($_POST["lead_order"])) {$lead_order=$_POST["lead_order"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["campaign_vdad_exten"])) {$campaign_vdad_exten=$_GET["campaign_vdad_exten"];} - elseif (isset($_POST["campaign_vdad_exten"])) {$campaign_vdad_exten=$_POST["campaign_vdad_exten"];} -if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec_exten"];} - elseif (isset($_POST["campaign_rec_exten"])) {$campaign_rec_exten=$_POST["campaign_rec_exten"];} -if (isset($_GET["campaign_recording"])) {$campaign_recording=$_GET["campaign_recording"];} - elseif (isset($_POST["campaign_recording"])) {$campaign_recording=$_POST["campaign_recording"];} -if (isset($_GET["campaign_rec_filename"])) {$campaign_rec_filename=$_GET["campaign_rec_filename"];} - elseif (isset($_POST["campaign_rec_filename"])) {$campaign_rec_filename=$_POST["campaign_rec_filename"];} -if (isset($_GET["hotkey"])) {$hotkey=$_GET["hotkey"];} - elseif (isset($_POST["hotkey"])) {$hotkey=$_POST["hotkey"];} -if (isset($_GET["reset_list"])) {$reset_list=$_GET["reset_list"];} - elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} -if (isset($_GET["old_campaign_id"])) {$old_campaign_id=$_GET["old_campaign_id"];} - elseif (isset($_POST["old_campaign_id"])) {$old_campaign_id=$_POST["old_campaign_id"];} -if (isset($_GET["OLDuser_group"])) {$OLDuser_group=$_GET["OLDuser_group"];} - elseif (isset($_POST["OLDuser_group"])) {$OLDuser_group=$_POST["OLDuser_group"];} -if (isset($_GET["status_name"])) {$status_name=$_GET["status_name"];} - elseif (isset($_POST["status_name"])) {$status_name=$_POST["status_name"];} -if (isset($_GET["selectable"])) {$selectable=$_GET["selectable"];} - elseif (isset($_POST["selectable"])) {$selectable=$_POST["selectable"];} -if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} - elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["delete_users"])) {$delete_users=$_GET["delete_users"];} - elseif (isset($_POST["delete_users"])) {$delete_users=$_POST["delete_users"];} -if (isset($_GET["delete_user_groups"])) {$delete_user_groups=$_GET["delete_user_groups"];} - elseif (isset($_POST["delete_user_groups"])) {$delete_user_groups=$_POST["delete_user_groups"];} -if (isset($_GET["delete_lists"])) {$delete_lists=$_GET["delete_lists"];} - elseif (isset($_POST["delete_lists"])) {$delete_lists=$_POST["delete_lists"];} -if (isset($_GET["delete_campaigns"])) {$delete_campaigns=$_GET["delete_campaigns"];} - elseif (isset($_POST["delete_campaigns"])) {$delete_campaigns=$_POST["delete_campaigns"];} -if (isset($_GET["delete_ingroups"])) {$delete_ingroups=$_GET["delete_ingroups"];} - elseif (isset($_POST["delete_ingroups"])) {$delete_ingroups=$_POST["delete_ingroups"];} -if (isset($_GET["delete_remote_agents"])) {$delete_remote_agents=$_GET["delete_remote_agents"];} - elseif (isset($_POST["delete_remote_agents"])) {$delete_remote_agents=$_POST["delete_remote_agents"];} -if (isset($_GET["load_leads"])) {$load_leads=$_GET["load_leads"];} - elseif (isset($_POST["load_leads"])) {$load_leads=$_POST["load_leads"];} -if (isset($_GET["campaign_detail"])) {$campaign_detail=$_GET["campaign_detail"];} - elseif (isset($_POST["campaign_detail"])) {$campaign_detail=$_POST["campaign_detail"];} -if (isset($_GET["ast_admin_access"])) {$ast_admin_access=$_GET["ast_admin_access"];} - elseif (isset($_POST["ast_admin_access"])) {$ast_admin_access=$_POST["ast_admin_access"];} -if (isset($_GET["ast_delete_phones"])) {$ast_delete_phones=$_GET["ast_delete_phones"];} - elseif (isset($_POST["ast_delete_phones"])) {$ast_delete_phones=$_POST["ast_delete_phones"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} -if (isset($_GET["delete_scripts"])) {$delete_scripts=$_GET["delete_scripts"];} - elseif (isset($_POST["delete_scripts"])) {$delete_scripts=$_POST["delete_scripts"];} -if (isset($_GET["script_id"])) {$script_id=$_GET["script_id"];} - elseif (isset($_POST["script_id"])) {$script_id=$_POST["script_id"];} -if (isset($_GET["script_name"])) {$script_name=$_GET["script_name"];} - elseif (isset($_POST["script_name"])) {$script_name=$_POST["script_name"];} -if (isset($_GET["script_comments"])) {$script_comments=$_GET["script_comments"];} - elseif (isset($_POST["script_comments"])) {$script_comments=$_POST["script_comments"];} -if (isset($_GET["script_text"])) {$script_text=$_GET["script_text"];} - elseif (isset($_POST["script_text"])) {$script_text=$_POST["script_text"];} -if (isset($_GET["reset_hopper"])) {$reset_hopper=$_GET["reset_hopper"];} - elseif (isset($_POST["reset_hopper"])) {$reset_hopper=$_POST["reset_hopper"];} -if (isset($_GET["get_call_launch"])) {$get_call_launch=$_GET["get_call_launch"];} - elseif (isset($_POST["get_call_launch"])) {$get_call_launch=$_POST["get_call_launch"];} -if (isset($_GET["am_message_exten"])) {$am_message_exten=$_GET["am_message_exten"];} - elseif (isset($_POST["am_message_exten"])) {$am_message_exten=$_POST["am_message_exten"];} -if (isset($_GET["amd_send_to_vmx"])) {$amd_send_to_vmx=$_GET["amd_send_to_vmx"];} - elseif (isset($_POST["amd_send_to_vmx"])) {$amd_send_to_vmx=$_POST["amd_send_to_vmx"];} -if (isset($_GET["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_GET["xferconf_a_dtmf"];} - elseif (isset($_POST["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_POST["xferconf_a_dtmf"];} -if (isset($_GET["xferconf_a_number"])) {$xferconf_a_number=$_GET["xferconf_a_number"];} - elseif (isset($_POST["xferconf_a_number"])) {$xferconf_a_number=$_POST["xferconf_a_number"];} -if (isset($_GET["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_GET["xferconf_b_dtmf"];} - elseif (isset($_POST["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_POST["xferconf_b_dtmf"];} -if (isset($_GET["xferconf_b_number"])) {$xferconf_b_number=$_GET["xferconf_b_number"];} - elseif (isset($_POST["xferconf_b_number"])) {$xferconf_b_number=$_POST["xferconf_b_number"];} -if (isset($_GET["modify_leads"])) {$modify_leads=$_GET["modify_leads"];} - elseif (isset($_POST["modify_leads"])) {$modify_leads=$_POST["modify_leads"];} -if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} - elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} -if (isset($_GET["change_agent_campaign"])) {$change_agent_campaign=$_GET["change_agent_campaign"];} - elseif (isset($_POST["change_agent_campaign"])) {$change_agent_campaign=$_POST["change_agent_campaign"];} -if (isset($_GET["agent_choose_ingroups"])) {$agent_choose_ingroups=$_GET["agent_choose_ingroups"];} - elseif (isset($_POST["agent_choose_ingroups"])) {$agent_choose_ingroups=$_POST["agent_choose_ingroups"];} -if (isset($_GET["alt_number_dialing"])) {$alt_number_dialing=$_GET["alt_number_dialing"];} - elseif (isset($_POST["alt_number_dialing"])) {$alt_number_dialing=$_POST["alt_number_dialing"];} -if (isset($_GET["scheduled_callbacks"])) {$scheduled_callbacks=$_GET["scheduled_callbacks"];} - elseif (isset($_POST["scheduled_callbacks"])) {$scheduled_callbacks=$_POST["scheduled_callbacks"];} -if (isset($_GET["lead_filter_id"])) {$lead_filter_id=$_GET["lead_filter_id"];} - elseif (isset($_POST["lead_filter_id"])) {$lead_filter_id=$_POST["lead_filter_id"];} -if (isset($_GET["lead_filter_name"])) {$lead_filter_name=$_GET["lead_filter_name"];} - elseif (isset($_POST["lead_filter_name"])) {$lead_filter_name=$_POST["lead_filter_name"];} -if (isset($_GET["lead_filter_comments"])) {$lead_filter_comments=$_GET["lead_filter_comments"];} - elseif (isset($_POST["lead_filter_comments"])) {$lead_filter_comments=$_POST["lead_filter_comments"];} -if (isset($_GET["lead_filter_sql"])) {$lead_filter_sql=$_GET["lead_filter_sql"];} - elseif (isset($_POST["lead_filter_sql"])) {$lead_filter_sql=$_POST["lead_filter_sql"];} -if (isset($_GET["agentonly_callbacks"])) {$agentonly_callbacks=$_GET["agentonly_callbacks"];} - elseif (isset($_POST["agentonly_callbacks"])) {$agentonly_callbacks=$_POST["agentonly_callbacks"];} -if (isset($_GET["agentcall_manual"])) {$agentcall_manual=$_GET["agentcall_manual"];} - elseif (isset($_POST["agentcall_manual"])) {$agentcall_manual=$_POST["agentcall_manual"];} -if (isset($_GET["vicidial_recording"])) {$vicidial_recording=$_GET["vicidial_recording"];} - elseif (isset($_POST["vicidial_recording"])) {$vicidial_recording=$_POST["vicidial_recording"];} -if (isset($_GET["vicidial_transfers"])) {$vicidial_transfers=$_GET["vicidial_transfers"];} - elseif (isset($_POST["vicidial_transfers"])) {$vicidial_transfers=$_POST["vicidial_transfers"];} -if (isset($_GET["delete_filters"])) {$delete_filters=$_GET["delete_filters"];} - elseif (isset($_POST["delete_filters"])) {$delete_filters=$_POST["delete_filters"];} -if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_options=$_GET["alter_agent_interface_options"];} - elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];} -if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];} - elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];} -if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];} - elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];} -if (isset($_GET["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} -if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];} - elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];} -if (isset($_GET["drop_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} -if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];} - elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];} -if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];} - elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];} -if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];} - elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];} -if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];} - elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];} -if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];} - elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];} -if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];} - elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];} -if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];} - elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];} -if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];} - elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];} -if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];} - elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];} -if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];} - elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];} -if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];} - elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];} -if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];} - elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];} -if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];} - elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];} -if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];} - elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];} -if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];} - elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];} -if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];} - elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];} -if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];} - elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];} -if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];} - elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];} -if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];} - elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];} -if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];} - elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];} -if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];} - elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];} -if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];} - elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];} -if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];} - elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];} -if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];} - elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];} -if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];} - elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} -if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} - elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} -if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} - elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} -if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} - elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} - - if (isset($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS ONLY ### -$user_level = ereg_replace("[^0-9]","",$user_level); -$wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); -$drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); -$am_message_exten = ereg_replace("[^0-9]","",$am_message_exten); -$campaign_rec_exten = ereg_replace("[^0-9]","",$campaign_rec_exten); -$campaign_vdad_exten = ereg_replace("[^0-9]","",$campaign_vdad_exten); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); -$dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); -$park_ext = ereg_replace("[^0-9]","",$park_ext); -$hopper_level = ereg_replace("[^0-9]","",$hopper_level); -$agent_choose_ingroups = ereg_replace("[^0-9]","",$agent_choose_ingroups); -$hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); -$agentonly_callbacks = ereg_replace("[^0-9]","",$agentonly_callbacks); -$agentcall_manual = ereg_replace("[^0-9]","",$agentcall_manual); -$vicidial_recording = ereg_replace("[^0-9]","",$vicidial_recording); -$vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); -$closer_default_blended = ereg_replace("[^0-9]","",$closer_default_blended); -$alter_agent_interface_options = ereg_replace("[^0-9]","",$alter_agent_interface_options); -$delete_users = ereg_replace("[^0-9]","",$delete_users); -$delete_user_groups = ereg_replace("[^0-9]","",$delete_user_groups); -$delete_scripts = ereg_replace("[^0-9]","",$delete_scripts); -$delete_remote_agents = ereg_replace("[^0-9]","",$delete_remote_agents); -$delete_lists = ereg_replace("[^0-9]","",$delete_lists); -$delete_ingroups = ereg_replace("[^0-9]","",$delete_ingroups); -$delete_filters = ereg_replace("[^0-9]","",$delete_filters); -$delete_campaigns = ereg_replace("[^0-9]","",$delete_campaigns); -$delete_call_times = ereg_replace("[^0-9]","",$delete_call_times); -$load_leads = ereg_replace("[^0-9]","",$delete_call_times); -$campaign_detail = ereg_replace("[^0-9]","",$campaign_detail); -$ast_delete_phones = ereg_replace("[^0-9]","",$ast_delete_phones); -$ast_admin_access = ereg_replace("[^0-9]","",$ast_admin_access); -$modify_leads = ereg_replace("[^0-9]","",$modify_leads); -$change_agent_campaign = ereg_replace("[^0-9]","",$change_agent_campaign); -$modify_call_times = ereg_replace("[^0-9]","",$modify_call_times); -$ct_wednesday_stop = ereg_replace("[^0-9]","",$ct_wednesday_stop); -$ct_wednesday_start = ereg_replace("[^0-9]","",$ct_wednesday_start); -$ct_tuesday_stop = ereg_replace("[^0-9]","",$ct_tuesday_stop); -$ct_tuesday_start = ereg_replace("[^0-9]","",$ct_tuesday_start); -$ct_thursday_stop = ereg_replace("[^0-9]","",$ct_thursday_stop); -$ct_thursday_start = ereg_replace("[^0-9]","",$ct_thursday_start); -$ct_sunday_stop = ereg_replace("[^0-9]","",$ct_sunday_stop); -$ct_sunday_start = ereg_replace("[^0-9]","",$ct_sunday_start); -$ct_saturday_stop = ereg_replace("[^0-9]","",$ct_saturday_stop); -$ct_saturday_start = ereg_replace("[^0-9]","",$ct_saturday_start); -$ct_monday_stop = ereg_replace("[^0-9]","",$ct_monday_stop); -$ct_monday_start = ereg_replace("[^0-9]","",$ct_monday_start); -$ct_friday_stop = ereg_replace("[^0-9]","",$ct_friday_stop); -$ct_friday_start = ereg_replace("[^0-9]","",$ct_friday_start); -$ct_default_stop = ereg_replace("[^0-9]","",$ct_default_stop); -$ct_default_start = ereg_replace("[^0-9]","",$ct_default_start); -$number_of_lines = ereg_replace("[^0-9]","",$number_of_lines); -$user_start = ereg_replace("[^0-9]","",$user_start); -$phone_number = ereg_replace("[^0-9]","",$phone_number); -$remote_agent_id = ereg_replace("[^0-9]","",$remote_agent_id); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); -$attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); -$hotkey = ereg_replace("[^0-9]","",$hotkey); -$list_id = ereg_replace("[^0-9]","",$list_id); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); -$allow_closers = ereg_replace("[^NY]","",$allow_closers); -$reset_hopper = ereg_replace("[^NY]","",$reset_hopper); -$amd_send_to_vmx = ereg_replace("[^NY]","",$amd_send_to_vmx); -$alt_number_dialing = ereg_replace("[^NY]","",$alt_number_dialing); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); -$selectable = ereg_replace("[^NY]","",$selectable); -$reset_list = ereg_replace("[^NY]","",$reset_list); -$fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); -$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); - -### ALPHA-NUMERIC ONLY ### -$user = ereg_replace("[^0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^0-9a-zA-Z]","",$pass); -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); -$submit = ereg_replace("[^0-9a-zA-Z]","",$submit); -$CoNfIrM = ereg_replace("[^0-9a-zA-Z]","",$CoNfIrM); -$campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid); -$get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch); -$campaign_recording = ereg_replace("[^0-9a-zA-Z]","",$campaign_recording); -$ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD); -$dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix); -$state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state); -$scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); - -### DIGITS and Dots -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); - -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); - -### ALPHA-NUMERIC and underscore and dash -$dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); -$dial_status_d = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_d); -$dial_status_c = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_c); -$dial_status_b = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_b); -$dial_status_a = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_a); -$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage); -$lead_filter_id = ereg_replace("[^-\_0-9a-zA-Z]","",$lead_filter_id); -$campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id); -$old_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_campaign_id); -$park_file_name = ereg_replace("[^-\_0-9a-zA-Z]","",$park_file_name); -$next_agent_call = ereg_replace("[^-\_0-9a-zA-Z]","",$next_agent_call); -$local_call_time = ereg_replace("[^-\_0-9a-zA-Z]","",$local_call_time); -$call_time_id = ereg_replace("[^-\_0-9a-zA-Z]","",$call_time_id); -$phone_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_pass); -$phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); -$group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); -$user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); -$OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); -$state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); - -### ALPHA-NUMERIC and spaces -$lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); -### ALPHA-NUMERIC and hash -$group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); -$campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); -$status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); -$HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); -$status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); -$script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); -$script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); -$list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); -$lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); -$lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); -$campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); -$call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); -$call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - -### remove semi-colons ### -$lead_filter_sql = ereg_replace(";","",$lead_filter_sql); - -### VARIABLES TO BE mysql_real_escape_string ### -# $web_form_address -# $script_text - -##### END VARIABLE FILTERING FOR SECURITY ##### - - -# AST GUI database administration -# admin.php -# -# CHANGES -# 50315-1110 - Added Custom Campaign Statuses -# 50317-1438 - Added Fronter Display var to inbound groups -# 50322-1355 - Added custom callerID per campaign -# 50517-1356 - Added user_groups sections and user_group to vicidial_users -# 50517-1440 - Added ability to logout (must click OK with empty user/pass) -# 50602-1622 - Added lead loader pages to load new files into vicidial_list -# 50620-1351 - Added custom vdad transfer AGI extension per campaign -# 50810-1414 - modified in groups to kick out spaces and dashes -# 50908-2136 - Added Custom Campaign HotKeys -# 50914-0950 - Fixed user search by user_group -# 50926-1358 - Modified to allow for language translation -# 50926-1615 - Added WeBRooTWritablE write controls -# 51020-1008 - Added editable web address and park ext - NEW dial campaigns -# 51020-1056 - Added fields and help for campaign recording control -# 51123-1335 - Altered code to function in php globals=off -# 51208-1038 - Added user_level changes, function controls and default user phones -# 51208-1556 - Added deletion of users/lists/campaigns/in groups/remote agents -# 51213-1706 - Added add/delete/modify vicidial scripts -# 51214-1737 - Added preview of vicidial script in popup window -# 51219-1225 - Added campaign and ingroups script selector and get_call_launch field -# 51222-1055 - Added am_message_exten to campaigns to allow for AM Message button -# 51222-1125 - Fixed new vicidial_campaigns default values not being assigned bug -# 51222-1156 - Added LOG OUT ALL AGENTS ON THIS CAMPAIGN button to campaign screen -# 60204-0659 - Fixed hopper reset bug -# 60207-1413 - Added AMD send to voicemail extension and xfer-conf dtmf presets -# 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 -# 60417-1416 - Added vicidial_lead_filters sections -# - Changed the header links to color-coded sectional with sublinks below -# - Added filter name and script name to campaign and in-group modify sections -# - Added callback and alt dial options to campaigns section -# - Added callback, alt dial and other options to users section -# 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered -# 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60425-2355 - Added agent options to vicidial_users, reformatted user page -# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen -# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen -# 60505-1117 - Added initial framework for new local_call_times tables and definitions -# 60506-1033 - More revisions to the local_call_time section -# 60508-1354 - Finished call_times and state_call_times sections -# - Added modify/delete options for call_times -# 60509-1311 - Functionalize campaign dialable leads calculation -# - Change state_call_times selection from call_times to only allow one per state -# - Added dialable leads count popup to campaign screen if auto-calc is disabled -# - Added test dialable leads count popup to filter screen -# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen -# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen -# 60609-1051 - Added add-to-dnc in LISTS section -# 60613-1415 - Added lead recycling options to campaign detail screen -# 60619-1523 - Added variable filtering to eliminate SQL injection attack threat -# 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug -# - -# 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.12-3'; -$build = '60623-1159'; - -$STARTtime = date("U"); - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Sie haben jetzt heraus geloggt. Danke\n"; - exit; -} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGuser_level =$row[4]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN: "; - -if (!isset($ADD)) {$ADD=0;} - -if ($ADD==1) {$hh='users'; echo "Addieren Sie Neuen Benutzer";} -if ($ADD==11) {$hh='campaigns'; echo "Addieren Sie Neue Kampagne";} -if ($ADD==111) {$hh='lists'; echo "Addieren Sie Neue Liste";} -if ($ADD==121) {$hh='lists'; echo "Addieren Sie Neues DNC";} -if ($ADD==1111) {$hh='ingroups'; echo "Addieren Sie Neue In-Gruppe";} -if ($ADD==11111) {$hh='remoteagent'; echo "Addieren Sie Neue Remotemittel";} -if ($ADD==111111) {$hh='usergroups'; echo "Addieren Sie Neue Benutzer-Gruppe";} -if ($ADD==1111111) {$hh='scripts'; echo "Addieren Sie Neuen Index";} -if ($ADD==11111111) {$hh='filters'; echo "Addieren Sie Neuen Filter";} -if ($ADD==111111111) {$hh='times'; echo "Füge neue Anrufzeit hinzu";} -if ($ADD==1111111111) {$hh='times'; echo "Füge neue landesspezifische Anrufzeit hinzu";} -if ($ADD==2) {$hh='users'; echo "Neue Benutzer-Hinzufügung";} -if ($ADD==21) {$hh='campaigns'; echo "Neue Kampagne Hinzufügung";} -if ($ADD==22) {$hh='campaigns'; echo "Neue Kampagne Status-Hinzufügung";} -if ($ADD==23) {$hh='campaigns'; echo "Neue Kampagne HotKey Hinzufügung";} -if ($ADD==25) {$hh='campaigns'; echo "Neue Kampagne Leitung Bereiten Hinzufügung Auf";} -if ($ADD==211) {$hh='lists'; echo "Neue Liste Hinzufügung";} -if ($ADD==2111) {$hh='ingroups'; echo "Neue In-Gruppe Hinzufügung";} -if ($ADD==21111) {$hh='remoteagent'; echo "Neue Remotemittel-Hinzufügung";} -if ($ADD==211111) {$hh='usergroups'; echo "Neue Benutzer-Gruppe Hinzufügung";} -if ($ADD==2111111) {$hh='scripts'; echo "Neue Index-Hinzufügung";} -if ($ADD==21111111) {$hh='filters'; echo "Neue Filter-Hinzufügung";} -if ($ADD==211111111) {$hh='times'; echo "Neue Anrufzeit hinzufügen";} -if ($ADD==2111111111) {$hh='times'; echo "Neue landesspezifische Anrufzeit hinzufügen";} -if ($ADD==3) {$hh='users'; echo "Ändern Sie Benutzer";} -if ($ADD==31) {$hh='campaigns'; echo "Ändern Sie Kampagne";} -if ($ADD==34) {$hh='campaigns'; echo "Ändern Sie Kampagne - Grundlegende Ansicht";} -if ($ADD==311) {$hh='lists'; echo "Ändern Sie Liste";} -if ($ADD==3111) {$hh='ingroups'; echo "Ändern Sie In-Gruppe";} -if ($ADD==31111) {$hh='remoteagent'; echo "Ändern Sie Remotemittel";} -if ($ADD==311111) {$hh='usergroups'; echo "Ändern Sie Benutzer-Gruppen";} -if ($ADD==3111111) {$hh='scripts'; echo "Ändern Sie Index";} -if ($ADD==31111111) {$hh='filters'; echo "Ändern Sie Filter";} -if ($ADD==311111111) {$hh='times'; echo "Bearbeite Anrufzeit";} -if ($ADD==321111111) {$hh='times'; echo "Bearbeite Anrufzeit Landdefinitions-Liste";} -if ($ADD==3111111111) {$hh='times'; echo "Bearbeite landesspezifische Anrufzeit";} -if ($ADD=="4A") {$hh='users'; echo "Ändern Sie Benutzer - Admin";} -if ($ADD=="4B") {$hh='users'; echo "Ändern Sie Benutzer - Admin";} -if ($ADD==4) {$hh='users'; echo "Ändern Sie Benutzer";} -if ($ADD==41) {$hh='campaigns'; echo "Ändern Sie Kampagne";} -if ($ADD==42) {$hh='campaigns'; echo "Ändern Sie Kampagne Status";} -if ($ADD==43) {$hh='campaigns'; echo "Ändern Sie Kampagne HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Ändern Sie Kampagne - Grundlegende Ansicht";} -if ($ADD==45) {$hh='campaigns'; echo "Ändern Sie Kampagne Leitung Aufbereiten";} -if ($ADD==411) {$hh='lists'; echo "Ändern Sie Liste";} -if ($ADD==4111) {$hh='ingroups'; echo "Ändern Sie In-Gruppe";} -if ($ADD==41111) {$hh='remoteagent'; echo "Ändern Sie Remotemittel";} -if ($ADD==411111) {$hh='usergroups'; echo "Ändern Sie Benutzer-Gruppen";} -if ($ADD==4111111) {$hh='scripts'; echo "Ändern Sie Index";} -if ($ADD==41111111) {$hh='filters'; echo "Ändern Sie Filter";} -if ($ADD==411111111) {$hh='times'; echo "Bearbeite Anrufzeit";} -if ($ADD==4111111111) {$hh='times'; echo "Bearbeite landesspezifische Anrufzeit";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Kampagne";} -if ($ADD==52) {$hh='campaigns'; echo "Logout-Mittel";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==51111) {$hh='remoteagent'; echo "Löschung-Direktübertragung Mittel";} -if ($ADD==511111) {$hh='usergroups'; echo "Löschung-Benutzer Group";} -if ($ADD==5111111) {$hh='scripts'; echo "Löschung-Index";} -if ($ADD==51111111) {$hh='filters'; echo "Löschung-Filter";} -if ($ADD==511111111) {$hh='times'; echo "Lösche Anrufzeit";} -if ($ADD==5111111111) {$hh='times'; echo "Lösche landesspezifische Anrufzeit";} -if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Kampagne";} -if ($ADD==62) {$hh='campaigns'; echo "Logout-Mittel";} -if ($ADD==65) {$hh='campaigns'; echo "Löschung-Leitung Bereiten Auf";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==61111) {$hh='remoteagent'; echo "Löschung-Direktübertragung Mittel";} -if ($ADD==611111) {$hh='usergroups'; echo "Löschung-Benutzer Group";} -if ($ADD==6111111) {$hh='scripts'; echo "Löschung-Index";} -if ($ADD==61111111) {$hh='filters'; echo "Löschung-Filter";} -if ($ADD==611111111) {$hh='times'; echo "Lösche Anrufzeit";} -if ($ADD==6111111111) {$hh='times'; echo "Lösche landesspezifische Anrufzeit";} -if ($ADD==73) {$hh='campaigns'; echo "Anzahl anrufbarer Anschlüsse";} -if ($ADD==7111111) {$hh='scripts'; echo "Vorbetrachtung-Index";} -if ($ADD==0) {$hh='users'; echo "Benutzer-Liste";} -if ($ADD==8) {$hh='users'; echo "Wiederholungsbesuche Innerhalb Des Mittels";} -if ($ADD==81) {$hh='campaigns'; echo "Wiederholungsbesuche Innerhalb Der Kampagne";} -if ($ADD==811) {$hh='campaigns'; echo "Wiederholungsbesuche Innerhalb Der Liste";} -if ($ADD==10) {$hh='campaigns'; echo "Kampagnen";} -if ($ADD==100) {$hh='lists'; echo "Listen";} -if ($ADD==1000) {$hh='ingroups'; echo "In-Gruppen";} -if ($ADD==10000) {$hh='remoteagent'; echo "Remotemittel";} -if ($ADD==100000) {$hh='usergroups'; echo "Benutzer-Gruppen";} -if ($ADD==1000000) {$hh='scripts'; echo "Indexe";} -if ($ADD==10000000) {$hh='filters'; echo "Filter";} -if ($ADD==100000000) {$hh='times'; echo "Anrufzeiten";} -if ($ADD==1000000000) {$hh='times'; echo "Landesspezische Anrufzeiten";} -if ($ADD==55) {$hh='users'; echo "Suchform";} -if ($ADD==66) {$hh='users'; echo "Suchresultate";} -if ($ADD==99999) {$hh='users'; echo "HILFE";} - -if ( ($ADD>9) && ($ADD < 99998) ) - { - ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $scripts_to_print = mysql_num_rows($rslt); - $scripts_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($scripts_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $scriptname_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - $filters_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($filters_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $filtername_list["$rowx[0]"] = "$rowx[1]"; - $filtersql_list["$rowx[0]"] = "$rowx[2]"; - $o++; - } - - ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $times_to_print = mysql_num_rows($rslt); - - $o=0; - while ($times_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $call_timename_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - } - -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD==31) or ($ADD==41) or ($ADD=="4A") or ($ADD=="4B") ) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ($ADD==31) - { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ($ADD==3) - { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) - { - if ($group_id_value == $groups[$p]) - { - $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; - } - $p++; - } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; - $o++; - } - if (strlen($groups_value)>2) {$groups_value .= " -";} - } - - - - - -$NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"HILFE\" ALIGN=TOP></A>"; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
VICIDIAL ADMIN: HILFE


\n"; - -?> -VICIDIAL_BENUTZERTABELLE

- -
-Benutzernummer - Dieses fangen ist, wohin Sie dieVICIDIAL Benutzernummer Zahl setzen, kann bis 8 Stellen in der Längesein, muß mindestens 2 Buchstaben lang sein auf. - -
-
-
-Kennwort - Dieses fangen ist auf, wohin Sie das VICIDIALBenutzerkennwort setzen. Sein mindestens müssen 2 Buchstaben lang. - -
-
-
-Voller Name - Dieses fangen ist auf, wohin Sie den vollenNamen der VICIDIAL Benutzer setzen. Sein mindestens müssen 2Buchstaben lang. - -
-
-
-Benutzer-Niveau - Dieses Menü ist, wo Sie das VICIDIALBenutzer-Benutzerniveau vorwählen. Sein muß ein Niveau von inVICIDIAL zu loggen 1,, muß waagerecht ausgerichtet grösser sein, alsals genaueres innen zu loggen 2, Benutzerniveau 8 oder grösser seinmüssen, in admin Netzabschnitt zu erhalten. - -
-
-
-Benutzer-Gruppe - Dieses Menü ist, wo Sie die VICIDIALBenutzergruppe vorwählen, daß dieser Benutzer gehört. Dieses hatkeine Beschränkungen diesmal, ist dieses gerecht, Benutzer zuunterteilen und die zukünftigen Eigenschaften zuzulassen, die nachihm gegründet werden. - -
-
-
-Telefon-LOGON - Für hier ist, wo Sie einen RückstellungTelefon-LOGON-Wert wenn die Benutzermaschinenbordbücher invicidial.php einstellen können. Dieser Wert bevölkert dasphone_login automatisch wenn die Benutzermaschinenbordbücher innenmit ihrer Benutzer-überschreiten-Kampagne auf dem vicidial.phpLOGON-Schirm. - -
-
-
-Telefon-Durchlauf - Für hier ist, wo Sie einen RückstellungTelefon-Durchlaufwert wenn die Benutzermaschinenbordbücher invicidial.php einstellen können. Dieser Wert bevölkert die phone_passautomatisch wenn die Benutzermaschinenbordbücher innen mit ihrerBenutzer-überschreiten-Kampagne auf dem vicidial.php LOGON-Schirm. - -
-
-
-HotKeys aktiv - Diese Wahl, wenn Satz bis 1 dem Benutzer erlaubt,die HotKeys schnelle-dispositioning Funktion innen zu verwenden vicidial.php. - -
-
-
-Mittel wählen Ingroups - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, die ingroups zu wählen, denen sie Anrufe von wenn sie LOGONzu einer GENAUEREN oder INBOUND Kampagne empfangen. Andernfalls mußder Manager dieses auf ihrem Benutzersonderkommandoschirm der adminSeite einstellen. - -
-
-
-Inbound Gruppen - Ist hier, wo Sie die inbound Gruppen vorwählen,die Sie Anrufe von empfangen möchten, wenn Sie die GENAUERE Kampagnevorgewählt haben. - -
-
-
-Zeitlich geplante Wiederholungsbesuche - Diese Wahl erlaubt einemMittel zur Einteilung einen Anruf als CALLBK und wählt die Daten unddie Zeit, an denen die Leitung reaktiviert wird. - -
-
-
-Mittel-Nur Wiederholungsbesuche - Diese Wahl erlaubt einemVertreter, einen Wiederholungsbesuch einzustellen, damit sie daseinzige Mittel sind, das die Kunde Rückseite benennen kann. Dieseserlaubt auch dem Vertreter, ihre Wiederholungsbesuch Auflistungen zusehen und sie zurück zu benennen, immer wenn sie zu wünschen. - -
-
-
-Vertreter-Anruf-Handbuch - Diese Wahl erlaubt einem Vertreter,eine neue Leitung in das System manuell einzutragen und sie zubenennen. Dieses auch erlaubt das Benennen jeder möglicherTelefonnummer von ihrem vicidial Schirm und setzt diesen Anruf inihren Lernabschnitt. Verwenden Sie diese Wahl mit Vorsicht. - -
-
-
-Vicidial Aufnahme - Diese Wahl kann verhindern, daß ein Mittelalle mögliche Aufnahmen tut, nachdem sie innen in vicidialprotokollieren. Diese Wahl muß eingeschaltet sein, damit vicidial demKampagne Aufnahmelernabschnitt folgt. - -
-
-
-Vicidial Übertragungen - Diese Wahl kann verhindern, daß einMittel die Übertragung - Konferenzlernabschnitt von vicidial öffnet.Wenn dieses untauglich ist, kann das Mittel nicht dritterParteianruf, oder blinde Übertragung irgendeine benennt. - -
-
-
-Genauere Rückstellung gemischt - Diese Wahl fällt einfach dasgemischte checkbox auf einem GENAUEREN LOGON-Schirm zurück. - -
-
-
-Ändern Sie Mittel-Schnittstelle Wahlen - diese Wahl, wenn Satzbis 1 dem administrativen Benutzer erlaubt, die MittelschnittstelleWahlen in admin.php zu ändern. - -
-
-
-Löschung-Benutzer - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, andere Benutzer des Gleichgestellten oder wenigenBenutzerniveaus aus dem System zu löschen. - -
-
-
-Löschung-Benutzer-Gruppen - Diese Wahl, wenn Satz bis 1 demBenutzer erlaubt, Benutzergruppen aus dem System zu löschen. - -
-
-
-Löschung verzeichnet - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, vicidial Listen aus dem System zu löschen. - -
-
-
-Löschung wirbt - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, vicidial Kampagnen aus dem System zu löschen. - -
-
-
-Löschung In-Gruppen - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, vicidial In-Gruppen aus dem System zu löschen. - -
-
-
-Löschung-Remotemittel - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, vicidial Remotemittel aus dem System zu löschen. - -
-
-
-Last führt - Diese Wahl, wenn Satz bis 1 dem Benutzer erlaubt,vicidial Leitungen in die vicidial_list Tabelle über die Netzgegründete Leitung Ladevorrichtung zu laden. - -
-
-
-Kampagne Detail - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, die Kampagne Detail-Schirmelemente anzusehen und zu ändern. - -
-
-
-AGC Admin Zugang - Diese Wahl, wenn Satz bis 1 den Benutzer zumLOGON zu den astGUIclient admin Seiten erlaubt. - -
-
-
-AGC Löschung-Telefone - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, Telefoneintragungen in den astGUIclient admin Seiten zulöschen. - -
-
-
-Löschung-Indexe - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, Kampagne Indexe auf dem Indexänderung Schirm zu löschen. - -
-
-
-Ändern Sie Leitungen - Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, Leitungen in der admin Abschnittleitung Suchresultate Seitezu ändern. - -
-
-
-Ändern Sie Vertreter-Kampagne - Diese Wahl, wenn Satz bis 1 demBenutzer erlaubt, die Kampagne zu ändern, daß ein Mittel in geloggtwird, während sie in es geloggt werden. - -
-
-
-Löschung filtert - Diese Wahl erlaubt dem Benutzer, in der LagezuSEIN, vicidial Leitung Filter aus dem System zu löschen. - -
-
-
-Löschen Anrufzeiten - Diese Option erlaubt dem Nutzer die Vicidial Anrufzeiten Aufzeichnungen und Vicidial Status Anrufzeiten Aufzeichnungen vom System zu löschen. - -
-
-
-Ändere Anrufzeiten - Diese Option erlaubt dem Nutzer das Ansehen und Ändern der Anrufzeiten und Status Anrufzeiten Aufzeichnungen. Ein Nutzer braucht diese Option nicht aktiviert, wenn er nur die Anrufzeit Option auf der Kampagnen-Sicht ändern können muss. - - - - -



- -VICIDIAL_KAMPAGNENTABELLE

-
-
-Kampagne Identifikation - Dieses ist der kurze Name der Kampagne,es ist nicht editable nach Ausgangsunterordnung, kann nicht Räumeenthalten und muß zwischen 2 und 8 Buchstaben im lengt seinh. - -
-
-
-Kampagne Name - Dieses ist die Beschreibung der Kampagne, muß eszwischen 6 und 40 Buchstaben lang sein. - -
-
-
-Aktiv - Dieses ist, wohin Sie die Kampagne auf aktives oderunaktiviertes einstellen. Wenn unaktiviert, kann noone in es loggen. - -
-
-
-Park-Verlängerung - Dieses ist, wo Sie besonders anfertigenkönnen auf-halten Musik für VICIDIAL. Stellen Sie sicher, daß dieVerlängerung im Platz im extensions.conf ist und das, das es auf denDateinamen unten zeigt. - -
-
-
-Park-Dateiname - Dieses ist, wo Sie besonders anfertigen könnenauf-halten Musik für VICIDIAL. Stellen Sie sicher, daß der Dateiname10 Buchstaben lang oder kleiner ist und daß die Akte im Platz im/var/lib/asterisk/sounds Verzeichnis ist. - -
-
-
-Netz-Form - Dieses ist, wo Sie die kundenspezifische Webseiteeinstellen können, die geöffnet ist, wenn der Benutzer an dieNETZ-FORM-Taste klickt. - -
-
-
-Erlauben Sie Closers - Dieses ist, wo Sie einstellen können, obdie Benutzer dieser Kampagne die Wahl haben, zum des Anrufs zu einemgenauerem zu schicken. - -
-
-
-Vorwahlknopf-Status - Dieses ist, wohin Sie die Status einstellen,die Sie an innerhalb der Listen wählen wünschen, die für dieKampagne unten aktiv sind - -
-
-
-Liste Auftrag - Dieses Menü ist, wo Sie vorwählen, wie dieLeitungen, die die Status zusammenbringen, die oben vorgewähltwerden, in den Leitung Zufuhrbehälter eingesetzt werden: -
  - DOWN: wählen Sie die ersten Leitungen vor, die in die vicidial_list Tabellegeladen werden -
  - UP: wählen Sie die letzten Leitungen vor, die in die vicidial_listTabelle geladen werden -
  - UP PHONE: wählen Sie die höchste Telefonnummer und die Arbeiten seine Weiseunten vor -
  - DOWN PHONE: wählen Sie die niedrigste Telefonnummer und die Arbeiten seine Weiseoben vor -
  - UP LAST NAME: Anfänge mit letzten Namen beginnend mit Z und Arbeiten seine Weiseunten -
  - DOWN LAST NAME: Anfänge mit letzten Namen beginnend mit A und Arbeiten seine Weiseoben -
  - UP COUNT: Anfänge mit benannten Leitungen und Arbeiten seine Weise unten -
  - DOWN COUNT: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weiseoben -
  - DOWN COUNT 2nd NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jeder anderen Leitung einsetzt - dürfenNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus -
  - DOWN COUNT 3nd NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jeder dritten Leitung einsetzt - dürfenNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus -
  - DOWN COUNT 4th NEW: Anfänge mit wenigen benannten Leitungen und Arbeiten seine Weise, dieoben eine NEUE Leitung in jedem einsetzt weiter, führen Sie - darfNICHT NEUES haben vorgewählt in den Vorwahlknopfstatus - -
-
-
-Zufuhrbehälter waagerecht ausgerichtet - Dieses ist, wieviele dieVDhopper Indexversuche führt, um in der vicidial_hopper Tabelle fürdiese Kampagne zu halten. Wenn Sie VDhopper Index jede Minute laufenlassen, bilden Sie dieses etwas grösser als die Zahl Leitungen, dieSie in eine Minute durchmachen. - -
-
-
-Leitung Filter - Dieses ist eine Methode der Entstörung IhrerLeitungen mit einem Fragment einer SQL Frage. Benutzen Sie dieseFunktion mit Vorsicht, es ist einfach mit, der geringfügigstenÄnderung zur SQL Aussage versehentlich zu wählen zu stoppen.Rückstellung ist KEINE. - -
-
-
-Kraft-Zurückstellen des Zufuhrbehälters - erlaubt dieses Ihnen,aus dem Zufuhrbehälterinhalt nach Formunterordnung abzuwischen. Essollte wieder gefüllt werden, wenn der VDhopper Index läuft. - -
-
-
-Selbstvorwahlknopf-Niveau - Dieses ist, wohin Sie einstellen,wieviele VICIDIAL sollte pro Mittel 0 verwenden des aktiven Mittelsnull zeichnet, Automobil, daswählen aus ist und die Mittel klicken,um jede Nummer zu wählen. Andernfalls hält VICIDIALWählverbindungen gleich den aktiven Mitteln, die mit demVorwahlknopfniveau multipliziert werden, um zu, wievielen Linien zukommen diese Kampagne auf jedem Bediener erlauben sollte. - -
-
-
-Folgender Vertreter-Anruf - Dieses stellt fest, welches Mittel denfolgenden Anruf empfängt, der vorhanden ist: -
  - random: Aufträge durch den gelegentlichen Updatewert in dervicidial_live_agents Tabelle -
  - oldest_call_start: Aufträge bis zum dem letzten Mal ein Mittel wurden einem Anrufgeschickt. Resultate in den Mitteln, die insgesamt ungefähr gleicheZahl von Anrufen empfangen. -
  - oldest_call_finish: Aufträge bis zum dem letzten Mal ein Mittel beendeten einen Anruf.Das AKA Mittel, das am längsten wartet, empfängt ersten Anruf. -
  - overall_user_level: Aufträge durch das user_level des Mittels, wie inden vicidial_users definiert legen ein höheres user_level empfangenmehr Anrufe ver. - -
-
-
-Ortsgespräch-Zeit - Dieses ist, wohin Sie während welcherStunden Sie wählen möchten, wie bis zum der lokalen Zeit infestgestellt sind einstellten in, welchem Sie benennen. Dieses wirddurch Ortsnetzkennzahl gesteuert und wird auf Tageslicht-SparungenZeit eingestellt, wenn anwendbar. Allgemeine Richtlinien in den USAfür Geschäft zum Geschäft ist 9am bis 5pm und Geschäft zu denVerbraucheranrufen ist 9am bis 9pm. - -
-
-
-Vorwahlknopf-Abschaltung - Wenn Sie, Anrufe, die normalerweiseHängezustand wurden, nachdem die Abschaltung, die in extensions.confanstatt Abschaltung an dieser Menge Sekunden definiert wurde wurde,wenn sie kleiner ist, als die extensions.conf Abschaltung definiertwerden. Dieses läßt schnell ändernde Vorwahlknopfabschaltungen vomBediener zum Bediener und zum Begrenzen der Effekte zu einer einzelnenKampagne zu. Wenn Sie eine Menge antwortende Maschine oder VoicemailAnrufe haben, können Sie diesen Wert, bis zwischen 21-26 zu ändernversuchen und sehen wünschen, wenn Resultate verbessern. - -
-
-
-Vorwahlknopf-Präfix - Dieses fangen zuläßt einen Wegdes Wählens leicht ändern auf, zum durch eine andere Methode zuerlöschen, ohne ein Umladen im Sternchen zu tun. Rückstellung ist 9gegründet nach einem 91NXXNXXXXXX im dialplan - extensions.conf. - -
-
-
-Kampagne CallerID - This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID. - -
-
-
-Kampagne VDAD Verlängerung - Dieses fangen zuläßt eineGewohnheit VDAD Übergangsverlängerung auf. Dieses erlaubt Ihnen,unterschiedliche VDADtransfer... agi Indexe zu benutzen, abhängendnach Ihrer Kampagne. Die Rückstellung Übertragung AGI - exten 8365agi-VDADtransfer.agi - gerade sendet sofort ersucht zu den Mitteln,sobald sie aufgehoben werden. Eine zusätzliches BeispielpolitischeÜbersicht AGI ist auch jetzt eingeschlossenes - 8366agi-VDADtransferSURVEY.agi - dieses Spiele eine Anzeige zurangerufenen Person und läßt sie eine Wahl treffen, indem sie Tastenbetätigt - effektiv Vorsiebung die Leitung -. Merken Sie bitte dasaußer Übersichten, politische Anrufe und Nächstenliebe diese Formdes Benennens ist in den Vereinigten Staaten ungültig. - -
-
-
-Kampagne Rec Verlängerung - Dieses fangen darf auf,damit eine kundenspezifische Aufnahmeverlängerung mit VICIDIALverwendet werden kann. Dieses erlaubt Ihnen, unterschiedlicheVerlängerungen zu verwenden, abhängend nach, wie lang Sie einemaximale Aufnahme erlauben möchten und welcher Art von Codec Sieinnen notieren möchten. Die Rückstellung exten ist 8309, die, wennSie folgen die SCRATCH_INSTALL Beispiele im WAV Format bis zu einerStunde lang notieren. Eine andere Wahl, die in den Beispieleneingeschlossen ist, ist 8310, die im G/M Format bis zu einer Stundelang notieren. - -
-
-
-Kampagne Aufnahme - Dieses Menü erlaubt Ihnen, zu wählen,welches Niveau der Aufnahme auf dieser Kampagne erlaubt wird. NIEsperrt Aufnahme auf dem Klienten. ONDEMAND ist die Rückstellung underlaubt dem Vertreter zu notieren zu beginnen und, zu stoppen, wiegebraucht. ALLCALLS beginnt Aufnahme auf dem Klienten, wann immer einAnruf zu einem Mittel geschickt wird. - -
-
-
-Kampagne Rec Dateiname - Dieses fangen erlaubt Ihnen, denNamen der Aufnahme besonders anzufertigen auf, wenn Kampagne AufnahmeONDEMAND oder ALLCALLS ist. Die erlaubten Variablen sind KAMPAGNECUSTPHONE FULLDATE TINYDATE EPOCHE-MITTEL. Die Rückstellung istFULLDATE_MITTELund würde wie dieses 20051020-103108_6666 aussehen.Ein anderes Beispiel ist CAMPAIGN_TINYDATE_CUSTPHONE, das wie diesesTESTCAMP_51020103108_3125551212 aussehen würde. 50 char max. - -
-
-
-Kampagne Index - Dieses Menü erlaubt Ihnen, den Index zu wählen,der auf dem Mittelschirm für diese Kampagne erscheint. Wählen SieKEINE vor, keinen Index für diese Kampagne zu zeigen. - -
-
-
-Erhalten Sie Anruf-Produkteinführung - Dieses Menü erlaubt Ihnenzu wählen, ob Sie Automobil-ausstoßen die Netz-Form Seite in einemunterschiedlichen Fenster, Auto-switch zum INDEX-Vorsprung oder tunnichts wünschen, wenn ein Anruf zum Mittel für diese Kampagnegeschickt wird. - -
-
-
-Antwortende Maschine Anzeige - Dieses fangen ist für dasHereinkommen auf, in eine Verlängerung, zum von von Übergangsanrufenzu blind zu machen, wenn das Mittel eine antwortende Maschine erhältund an die antwortende Maschine Anzeige Taste imÜbergangskonferenzrahmen klickt. Sie müssen dieses einstellen extenoben im dialplan - extensions.conf - und sicherstellen, daß esspielt, eine Audioakte dann oben hängt. - -
-
-
-AMD senden zu VM exten - erlaubt dieses Menü Ihnen zu definieren,ob eine Anzeige auf einer antwortenden Maschine gelassen wird, wennihr der Anruf wird sofort nachgeschickt zur Antworten-Maschine-AnzeigeVerlängerung ermittelt wird, wenn AMD aktiv ist und es festgestelltwird, daß der Anruf eine antwortende Maschine ist. - -
-
-
-Xfer-Conf DTMF - Diese vier fängt dürfen auf, damit Siezwei Sätze Übergangskonferenz und DTMF Voreinstellungen haben. Wennder Anruf oder die Kampagne geladen wird, stellt der vicidial.phpIndex dar, daß zwei Tasten auf dem Bringenkonferenz Rahmen und denZahl-zu-Vorwahlknopf und senden-dtmf Automobil-zu bevölkernauffängt, wenn sie betätigt werden. - -
-
-
-Numerisches Wählen des Mittel-Alt - erlaubt diese Wahl einemVertreter, die wechselnde Telefonnummer manuell zu wählen, oderaddress3 fangen auf, nachdem die Hauptzahl benannt wordenist. - -
-
-
-Zeitlich geplante Wiederholungsbesuche - Diese Wahl erlaubt einemMittel zur Einteilung einen Anruf als CALLBK und wählt die Daten unddie Zeit, an denen die Leitung reaktiviert wird. - -
-
-
-Sekunden zur Verbindung - Anzahl der Sekunden vom Abnehmen des Kunden bis zur Erkennung als Verbindung, betrifft nur abgehende Verbindungen. - -
-
-
-Voicemail - Wenn sie definiert werden, würden Anrufe, dienormalerweise FALLEN würden, anstatt auf diesen voicemail Kastenverwiesen, um eine Anzeige zu hören und zu lassen. - -
-
-
-Sicherheitsnachricht - Wenn auf Y gesetzt wird dem Kunden nach Ablauf der Sekunden zur Verbindung, ohne zu einem Agenten verbunden worden zu sein, eine Nachricht abgespielt. Diese Einstellung setzt die Option Senden zu einer Voicemail Kasten ausser Kraft, wenn diese auf Y steht. - -
-
-
-Sicherheitsnebenstelle - Dies ist die Wählplan Nebenstelle, wo sich die gewünschte Sicherheits-Audiodatei auf Ihrem Server befindet. - -
-
-
-Sekunden Nachbereitung - Anzahl der Sekunden, die ein Agent bis zum nächsten erhaltenen Anruf oder Wählen eines anderen Anrufs warten muss. Die Zeit beginnt, sobald ein Agent bei seinem Kunden aufgelegt hat - oder im Fall der alternativen Nummernwahl, wenn ein Agent das Telefonat beendet - Standard ist 0 Sekunden. Wenn die Zeit abgelaufen ist bevor der Agent den Anruf eingeordnet hat, wird der Agent dennoch nicht zum nächsten Anruf kommen, bevor er eine Einteilung gewählt hat. - -
-
-
-Nachbereitungsnachricht - Dies ist eine Kampagnen-spezifische Nachricht, die bei gesetzten Sekunden Nachbereitung auf dem Nachbereitungsbildschirm angezeigt wird. - -
-
-
-Nachbereitungsnachricht - Dies ist eine Kampagnen-spezifische Nachricht, die bei gesetzten Sekunden Nachbereitung auf dem Nachbereitungsbildschirm angezeigt wird. - -
-
-
-Interne DNC Liste des Gebrauch-- definiert dieses, ob dieseKampagne Leitungen gegen die interne DNC Liste filtern soll. Wenn esauf Y eingestellt wird, sucht der Zufuhrbehälter nach jederTelefonnummer in der DNC Liste, bevor er sie in den Zufuhrbehälterlegt. Wenn er in der DNC Liste ist, dann, das sie dieses führt Statuszu DNCL also ändert, kann sie nicht gewählt werden. Rückstellungist N. - -
-
-
-Gewährte Inbound Gruppen - For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. - - - -



- -VICIDIAL_LISTENTABELLE

-
-
-Liste Identifikation - Dieses ist der numerische Name der Liste,es ist nicht editable nach Ausgangsunterordnung, muß nur Zahlenenthalten und muß zwischen 2 und 8 Buchstaben lang sein. - -
-
-
-Liste Name - This is the description of the list, it must be between 2 and 20 characters in length. - -
-
-
-Kampagne - This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time. - -
-
-
-Aktiv - Dieses definiert, ob die Liste an oder nicht gewähltwerden soll. - -
-
-
-Stellen Sie Führen-Benennen-Status für diese Liste - zurückstellt dieses alle Leitungen in dieser Liste zu N für das benannte\"not da letztes Zurückstellen \" zurück und bedeutet, daß jedemögliche Leitung jetzt benannt werden kann, wenn es der rechte Statusist, wie auf dem Kampagne Schirm definiert. - -
-
-
-VICIDIAL DNC Liste - Dieses benennen nicht Liste enthält jedeLeitung, die auf einen Status von DNC im System eingestellt wordenist. Durch die LISTEN - FÜGEN Sie ZAHL DNC Seite hinzu, die Sie inder LageSIND, eine Zahl dieser Liste manuell hinzuzufügen, damit sienicht durch Kampagnen benannt wird, die die interne DNC Listebenutzen. - - - -



- -VICIDIAL_INBOUND_GROUPSTABELLE

-
-
-Gruppe Identifikation - Dieses ist der kurze Name der inboundGruppe, es ist nicht editable nach Ausgangsunterordnung, darf keineRäume enthalten und muß zwischen 2 und 20 Buchstaben lang sein. - -
-
-
-Gruppe Name - Dieses ist die Beschreibung der Gruppe, muß eszwischen 2 und 30 Buchstaben lang sein. Kann nicht Schläge, plussesoder Räume einschließen . - -
-
-
-Gruppe Farbe - Dieses ist die Farbe, die in der VICIDIAL KlientAPP anzeigt, wenn ein Anruf auf diese Gruppe hereinkommt. Es mußzwischen 2 und 7 Buchstaben lang sein. Wenn dieses eine HexagonfarbeDefinition ist, müssen Sie sich erinnern, sich a # am Anfang derZeichenkette zu setzen, oder VICIDIAL arbeitet nicht richtig. - -
-
-
-Aktiv - Dieses stellt fest, ob diese Gruppe oben imVorwählerkasten wenn Maschinenbordbücher eines VICIDIAL Mittelsinnen zeigen. - -
-
-
-Netz-Form - Dieses ist die kundenspezifische Adresse, die dasKlicken auf der NETZ-FORM-Taste in VICIDIAL Ihnen für zu den Anrufennimmt, die auf diese Gruppe hereinkommen. - -
-
-
-Folgender Vertreter-Anruf - Dieses stellt fest, welches Mittel denfolgenden Anruf empfängt, der vorhanden ist: -
  - random: Aufträge durch den gelegentlichen Updatewert in dervicidial_live_agents Tabelle -
  - oldest_call_start: Aufträge bis zum dem letzten Mal ein Mittel wurden einem Anrufgeschickt. Resultate in den Mitteln, die insgesamt ungefähr gleicheZahl von Anrufen empfangen. -
  - oldest_call_finish: Aufträge bis zum dem letzten Mal ein Mittel beendeten einen Anruf.Das AKA Mittel, das am längsten wartet, empfängt ersten Anruf. -
  - overall_user_level: Aufträge durch das user_level des Mittels, wie inden vicidial_users definiert legen ein höheres user_level empfangenmehr Anrufe ver. - -
-
-
-Fronter Anzeige - Dieses fangen feststellt auf, ob dasinbound VICIDIAL Mittel den fronter Namen - wenn es einen gibt -angezeigt im Status auffangen haben würde, wann der Anrufzum Mittel kommt. - -
-
-
-Kampagne Index - Dieses Menü erlaubt Ihnen, den Index zu wählen,der auf dem Mittelschirm für diese Kampagne erscheint. Wählen SieKEINE vor, keinen Index für diese Kampagne zu zeigen. - -
-
-
-Erhalten Sie Anruf-Produkteinführung - Dieses Menü erlaubt Ihnenzu wählen, ob Sie Automobil-ausstoßen die Netz-Form Seite in einemunterschiedlichen Fenster, Auto-switch zum INDEX-Vorsprung oder tunnichts wünschen, wenn ein Anruf zum Mittel für diese Kampagnegeschickt wird. - -
-
-
-Xfer-Conf DTMF - Diese vier fängt dürfen auf, damit Siezwei Sätze Übergangskonferenz und DTMF Voreinstellungen haben. Wennder Anruf oder die Kampagne geladen wird, stellt der vicidial.phpIndex dar, daß zwei Tasten auf dem Bringenkonferenz Rahmen und denZahl-zu-Vorwahlknopf und senden-dtmf Automobil-zu bevölkernauffängt, wenn sie betätigt werden. - -
-
-
-Sekunden zur Verbindung - Anzahl der Sekunden vom Abnehmen des Kunden bis zur Erkennung als Verbindung, betrifft nur abgehende Verbindungen. - -
-
-
-Voicemail - Wenn sie definiert werden, würden Anrufe, dienormalerweise FALLEN würden, anstatt auf diesen voicemail Kastenverwiesen, um eine Anzeige zu hören und zu lassen. - -
-
-
-Verbindungs-Nachricht- Wenn auf Y gesetzt wird dem Kunden nach Ablauf der Sekunden zur Verbindung, ohne zu einem Agenten verbunden worden zu sein, eine Nachricht abgespielt. Diese Einstellung setzt die Option Senden zu einer Voicemail Kasten ausser Kraft, wenn diese auf Y steht. - -
-
-
-Verbindungs-Nebenstelle - Dies ist die Wählplan-Nebenstelle, wo sich die gewünschte Audiodatei für die aufgebaute Verbindung auf Ihrem Server befindet. - - - -



- -VICIDIAL_REMOTE_AGENTSTABELLE

-
-
-Benutzernummer Anfang - Dieses ist die beginnende Benutzernummer,die verwendet wird, wenn die Remotemitteleintragungen in das Systemeingesetzt werden. Wenn die Zeilenzahl in hohem Grade als 1eingestellt wird, wird diese Zahl durch eine erhöht, bis jede Linieeine Eintragung hat. Stellen Sie, ein neues VICIDIAL Benutzerkonto miteinem Benutzerniveau von 4 zu verursachen oder groß sicher, wenn Siesie in der LageSEIN wünschen, die vdremote.php Seite fürRemotenetzzugang dieses Kontos zu benutzen. - -
-
-
-Zeilenzahl - Dieses definiert, wievieles Remotemittel Eintragungendas System verursacht, und stellt fest, wieviele Linien es denkt, daßes zur Zahl unter sicher senden kann. - -
-
-
-Bediener IP - Eine Remotemitteleintragung ist für einenspezifischen Bediener, ist hier nur gut, wo Sie vorwählen, dasBediener Sie wünschen. - -
-
-
-Externe Verlängerung - Dieses ist die Zahl, daß Sie die Anrufewünschen, die zu nachgeschickt werden. Überprüfen Sie, ob es einevolle dialplan Zahl ist und daß, wenn Sie 9 am Anfang benötigen, Sieihn innen hier setzen. Prüfen Sie, indem Sie diese Nummer von einemTelefon auf dem System wählen. - -
-
-
-Status - Ist hier, wo Sie das Remotemittel an und abstellen.Sobald das Mittel aktiv ist, nimmt das System an, daß es Anrufe zuihm schicken kann. Es kann bis 30 Sekunden dauern, sobald Sie denStatus zu unaktiviertem ändern, um Anrufe, zu empfangen zu stoppen. - -
-
-
-Kampagne - Ist hier, wo Sie die Kampagne vorwählen, daß dieseRemotemittel in geloggt werden. Inbound Notwendigkeiten, die GENAUEREKampagne zu verwenden und die inbound Kampagnen unter dervorzuwählen, die Sie Anrufe von empfangen möchten. - -
-
-
-Inbound Gruppen - Ist hier, wo Sie die inbound Gruppen vorwählen,die Sie Anrufe von empfangen möchten, wenn Sie die GENAUERE Kampagnevorgewählt haben. - - -



- -VICIDIAL_CAMPAIGN_LISTEN

-
-
-Die Listen innerhalb dieser Kampagne werden hier verzeichnet, ob siewerden bezeichnet durch das Y aktiv sind, oder N und Sie zum ListeSchirm gehen können, indem sie auf der Liste Identifikation in derersten Spalte klicken. - - -



- -VICIDIAL_CAMPAIGN_STATUSESTABELLE

-
-
-Durch den Gebrauch von kundenspezifischen Kampagne Status, können SieStatus haben, die nur für eine spezifische Kampagne bestehen. DerStatus muß 1-8 Buchstaben lang sein, muß die Beschreibung 2-30Buchstaben lang sein und auswählbar definiert, ob es oben in VICIDIALals Einteilung zeigt. - - - -



- -VICIDIAL_CAMPAIGN_HOTKEYSTABELLE

-
-
-Durch den Gebrauch von kundenspezifischen Kampagne hotkeys, benenntVertreter, die verwenden, der vicidial Netz-Klient Dose Hängezustandund Einteilung, gerade indem sie einen einzelnen Schlüssel auf ihrerTastatur betätigen. - - - - -



- -VICIDIAL_LEAD_RECYCLETABELLE

-
-
-Durch den Gebrauch von Leitung aufbereitend, können Sie spezifischeStatus der Leitungen in einem spezifizierten Abstand wieder benennen,ohne die gesamte Liste zurückzustellen. Die Leitung Wiederverwertungist Kampagne-spezifisch und muß nicht ein vorgewählter dialableStatus in Ihrer Kampagne sein. Der Versuch verzögertauffangen ist die Zahl Sekunden, bis die Leitung in denZufuhrbehälter zurück gelegt sein kann, diese Zahl muß mindestens120 Sekunden sein. Das Versuch Maximum fangen ist dieHöchstzahl der Zeiten auf, die eine Leitung dieses Status versuchtwerden kann, bevor die Liste zurückgestellt werden muß, diese Zahlkann von 1 bis 10 sein. Sie können aktivieren und eine Leitung zuentaktivieren bereiten Sie Eintragung mit den zur Verfügunggestellten Verbindungen auf. Diese Eigenschaft arbeitet nur imAutomobil-Vorwahlknopf Modus, in dem Vorwahlknopfniveau grösser als 0ist. - - - - - -



- -VICIDIAL_USER_GROUPSTABELLE

-
-
-Benutzer-Gruppe - Dieses ist der kurze Name einer VicidialBenutzergruppe, der Versuch, zum keiner Räume zu benutzen, oderInterpunktion für dieses fangen Maximum 20 Buchstaben,Minimum von 2 Buchstaben auf. - -
-
-
-Gruppe Name - Dieses ist die Beschreibung des vicidialBenutzergruppe Maximums von 40 Buchstaben. - - - - - -



- -VICIDIAL_INDEXETABELLE

-
-
-Index Identifikation - Dieses ist der kurze Name eines VicidialIndexes. Dieser muß ein einzigartiger Bezeichner sein. Der Versuch,zum keiner Räume oder die Interpunktion für dieses zu benutzenfangen Maximum 10 Buchstaben, Minimum von 2 Buchstaben auf. - -
-
-Index-Name - Dieses ist der Titel einem Vicidial Index. Dieses isteine kurze Zusammenfassung der Indexmaximum 50 Buchstaben, Minimum von2 Buchstaben. Es sollte keine Räume geben, oder Interpunktionirgendwie der Art in den theis fangen auf. - -
-
-Index kommentiert - Dieses ist, wo Sie Anmerkungen für einenVicidial Index wie - geändert, um Aufsteigen an Sept. 23 freizugeben-. Maximum 255 Buchstaben setzen können, Minimum von 2 Buchstaben. - -
-
-Index-Text - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today? - -
-
-
-Aktiv - Dieses stellt fest, ob dieser Index vorgewählt werdenkann, durch eine Kampagne verwendet zu werden. - - - - - -



- -VICIDIAL_LEAD_FILTERTABELLE

-
-
-Filter Identifikation - Dieses ist der kurze Name eines VicidialLeitung Filter. Dieser muß ein einzigartiger Bezeichner sein.Benutzen Sie keine Räume, oder Interpunktion für diesesfangen Maximum 10 Buchstaben, Minimum von 2 Buchstaben auf. - -
-
-Filter-Name - Dieses ist ein beschreibenderer Name des Filter.Dieses ist eine kurze Zusammenfassung der Filtermaximum 30 Buchstaben,Minimum von 2 Buchstaben. - -
-
-Filter kommentiert - Dieses ist, wo Sie Anmerkungen für einenVicidial Filter wie - Anrufe alle Kalifornien Leitungen -. Maximum 255Buchstaben setzen können, Minimum von 2 Buchstaben. - -
-
-Filter SQL - Dieses ist, wohin Sie das SQL Frage Fragment setzen,das Sie vorbei filtern möchten anfangen nicht, oder Ende mit UND, dasdurch den Zufuhrbehälter cron Index automatisch hinzugefügt wird.eine Beispiel SQL Frage, die hier arbeiten würde, ist called_count \4 und called_count \. - - - - - -



- -VICIDIAL_AnrufzeitenTABELLE

-
-
-Anrufzeit ID - Dies ist der kurze Name von einer Vicidial Anrufzeit Definition. Es muss ein eindeutiger Bezeichner sein. Leerzeichen und Punkte sind in diesem Feld nicht erlaubt. Maximal 10 Zeichen, mindestens 2. - -
-
-Anrufzeit Name - Dies ist ein besser beschreibender Name für die Anrufzeit Definition. Es ist eine kurze Zusammenfassung der Anrufzeit Definition. Maximal 30 Zeichen, mindestens 2. - -
-
-Anrufzeit Kommentare - Hier können Sie Kommentare für eine Vicidial Anrufzeit Definition wie -10 bis 14 Uhr mit eigenen Beschränkungen für das angerufene Land- machen. Maximal 255 Zeichen. - -
-
-Standard Start and Stop Zeiten - Dies ist die Standardzeit, zu der Anrufe innerhalb der Anrufzeitdefinition gestartet oder gestoppt werden dürfen, wenn die Wochentag Startzeit nicht definiert ist. 0 ist Mitternacht. Um Anrufe komplett zu verhindern den Wert auf 2400 und die Standard Stopzeit ebenfalls auf 2400 setzen. Um Anrufe für 24 Stunden am Tag zu erlauben die Startzeit auf 0 und die Stopzeit auf 2400 setzen. - -
-
-Wochentag Start and Stop Zeit - Dies sind die speziellen Zeiten pro Tag, welche für die Anrufzeit Definition gesetzt werden können. Es gelten die selben Regeln wie für Start und Stop Zeiten. - -
-
-Land Anrufzeit Definition - Dies ist die Liste der landspezifischen Anrufzeit Definitionen, die von dieser Anrufzeit Definition beachtet werden. - -
-
-Landesspezifische Anrufzeit Definition - Dies ist der zwei Buchstaben Code für das Land, für das die Anrufzeit Definition gilt. Damit diese ausgeführt wird muss die in der Kampagne gesetzte lokale Anrufzeit diese landesspezifische Anrufzeit Aufzeichnung enthalten, genauso wie alle anzurufenden Anschlüsse den landesspezifischen zwei Buchstaben Code enthalten müssen . - - - - -



- -VICIDIAL LISTE LADEVORRICHTUNG FUNKTIONALITÄT

-
-
-Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach entworfen, um eine Leitung Akte zu nehmen - bis zu 8MB in derGröße - die entweder Vorsprung oder das abgegrenzte Rohr und es indie vicidial_list Tabelle zu laden ist. Es gibt auch eine neueBetaversionsuperleitung Ladevorrichtung, das auffangen dasWählen zuläßt und TXT- deutlich Text, CSV- Komma getrennte Werteund XLS- übertreffen Akte Formate. Die Leitung Ladevorrichtung tutnicht Datenprüfung, oder Überprüfung auf Duplikate in sich oder inanderen Listen, damit etwas Sie ist, muß vor Ihnen Last tun dieLeitungen. Auch überprüfen Sie, ob Sie die Liste erstellt haben,daß diese Leitungen darunter sein sollen, damit Sie sie benutzenkönnen. Es gibt auch die Angelegenheit der Zeit-Zone-Kodierung dieseLeitungen. Sie können die Frequenz erhöhen wünschen, daß dasADMIN_adjust_GMTnow_on_leads.pl in das cron auf IhremSternchenbediener gelaufen wird, damit alle mögliche geladenenLeitungen schneller kodiert werden können. Ist hier eine Liste vonauffängt in ihrem korrekten Auftrag für die Leitung Akten: -
    -
  1. Verkäufer-Leitung Code - zeigt oben im Verkäufer, den Identifikationvom GUI auffangen -
  2. Quellenprogramm - interner Gebrauch nur für admins und DBAs -
  3. Liste Identifikation - die Liste Zahl, die diese Leitungen obendarunter zeigen -
  4. Telefon-Code - das Präfix für die Telefonnummer - 1 für US, 01144für Großbritannien, 01161 für AUS, usw. -
  5. Telefonnummer - muß mindestens 8 Stellen lang sein -
  6. Titel - Titel dem Kunden - Herr Ms Mrs, usw.... -
  7. Vorname -
  8. Mittlere Initiale -
  9. Letzter Name -
  10. Adresse Linie 1 -
  11. Adresse Linie 2 -
  12. Adresse Linie 3 -
  13. Stadt -
  14. Zustand - begrenzt auf 2 Buchstaben -
  15. Provinz -
  16. Postcode -
  17. Land -
  18. Geschlecht -
  19. Geburtsdatum -
  20. Wechselnde Telefonnummer - Sicherheit Phrase -
  21. Anmerkungen -
- -
ANMERKUNGEN: Die übertreffenleitung Ladevorrichtung Funktionalitätwird durch eine Reihe Perl Indexe ermöglicht und muß eine richtigzusammengebaute /home/cron/AST_SERVER_conf.pl Akte im Platz auf demweb server haben. Auch ein Paarperl Module müssen für sie, umaußerdem zu arbeiten - OLE-Storage_Lite-Storage_Lite undVerteilungsbogen-ParseExcel geladen werden. Sie können aufLaufzeitfehler in diesen überprüfen, indem Sie Ihre Apache error_logAkte betrachten. - -







-







-DAS ENDE -
-\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$dial_status_a = $row[3]; -$dial_status_b = $row[4]; -$dial_status_c = $row[5]; -$dial_status_d = $row[6]; -$dial_status_e = $row[7]; -$local_call_time = $row[16]; -if ($lead_filter_id=='') - { - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') - { - $lead_filter_id='NONE'; - } - } - -$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; -$rslt=mysql_query($stmt, $link); -$lists_to_print = mysql_num_rows($rslt); -$camp_lists=''; -$o=0; -while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; -if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} -} -$camp_lists = eregi_replace(".$","",$camp_lists); - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - -echo "

\n"; -echo "Zeige Anzahl anrufbarer Anschlüsse -

\n"; -echo "CAMPAIGN: $campaign_id
\n"; -echo "LISTEN: $camp_lists
\n"; -echo "STATUSES: $dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e
\n"; -echo "FILTER: $lead_filter_id
\n"; -echo "CALL TIME: $local_call_time

\n"; - -### call function to calculate and print dialable leads -dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - -echo "

\n"; -echo "\n"; - -exit; -} - - -###################### -# ADD=7111111 view sample script with test variables -###################### - -if ($ADD==7111111) -{ - ##### TEST VARIABLES ##### - $vendor_lead_code = 'VENDORLEADCODE'; - $list_id = 'LISTID'; - $gmt_offset_now = 'GMTOFFSET'; - $phone_code = '1'; - $phone_number = '7275551212'; - $title = 'Mr.'; - $first_name = 'JOHN'; - $middle_initial = 'Q'; - $last_name = 'PUBLIC'; - $address1 = '1234 Main St.'; - $address2 = 'Apt. 3'; - $address3 = 'ADDRESS3'; - $city = 'CHICAGO'; - $state = 'IL'; - $province = 'PROVINCE'; - $postal_code = '33760'; - $country_code = 'USA'; - $gender = 'M'; - $date_of_birth = '1970-01-01'; - $alt_phone = '3125551212'; - $email = 'test@test.com'; - $security_phrase = 'SECUTIRY'; - $comments = 'COMMENTS FIELD'; - $RGfullname = 'JOE AGENT'; - $RGuser = '6666'; - -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; - -$script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); -$script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); -$script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); -$script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); -$script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); -$script_text = eregi_replace('--A--title--B--',"$title",$script_text); -$script_text = eregi_replace('--A--first_name--B--',"$first_name",$script_text); -$script_text = eregi_replace('--A--middle_initial--B--',"$middle_initial",$script_text); -$script_text = eregi_replace('--A--last_name--B--',"$last_name",$script_text); -$script_text = eregi_replace('--A--address1--B--',"$address1",$script_text); -$script_text = eregi_replace('--A--address2--B--',"$address2",$script_text); -$script_text = eregi_replace('--A--address3--B--',"$address3",$script_text); -$script_text = eregi_replace('--A--city--B--',"$city",$script_text); -$script_text = eregi_replace('--A--state--B--',"$state",$script_text); -$script_text = eregi_replace('--A--province--B--',"$province",$script_text); -$script_text = eregi_replace('--A--postal_code--B--',"$postal_code",$script_text); -$script_text = eregi_replace('--A--country_code--B--',"$country_code",$script_text); -$script_text = eregi_replace('--A--gender--B--',"$gender",$script_text); -$script_text = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$script_text); -$script_text = eregi_replace('--A--alt_phone--B--',"$alt_phone",$script_text); -$script_text = eregi_replace('--A--email--B--',"$email",$script_text); -$script_text = eregi_replace('--A--security_phrase--B--',"$security_phrase",$script_text); -$script_text = eregi_replace('--A--comments--B--',"$comments",$script_text); -$script_text = eregi_replace('--A--fullname--B--',"$RGfullname",$script_text); -$script_text = eregi_replace('--A--user--B--',"$RGuser",$script_text); -$script_text = eregi_replace("\n","
",$script_text); - - -echo ""; - -echo "Vorbetrachtung-Index: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') {$users_hh='bgcolor ="#FFFF99"'; $users_fc='BLACK';} # yellow - else {$users_hh=''; $users_fc='WHITE';} -if ($hh=='campaigns') {$campaigns_hh='bgcolor ="#FFCC99"'; $campaigns_fc='BLACK';} # orange - else {$campaigns_hh=''; $campaigns_fc='WHITE';} -if ($hh=='lists') {$lists_hh='bgcolor ="#FFCCCC"'; $lists_fc='BLACK';} # red - else {$lists_hh=''; $lists_fc='WHITE';} -if ($hh=='ingroups') {$ingroups_hh='bgcolor ="#CC99FF"'; $ingroups_fc='BLACK';} # purple - else {$ingroups_hh=''; $ingroups_fc='WHITE';} -if ($hh=='remoteagent') {$remoteagent_hh='bgcolor ="#CCFFCC"'; $remoteagent_fc='BLACK';} # green - else {$remoteagent_hh=''; $remoteagent_fc='WHITE';} -if ($hh=='usergroups') {$usergroups_hh='bgcolor ="#CCFFFF"'; $usergroups_fc='BLACK';} # cyan - else {$usergroups_hh=''; $usergroups_fc='WHITE';} -if ($hh=='scripts') {$scripts_hh='bgcolor ="#99FFCC"'; $scripts_fc='BLACK';} # light teal - else {$scripts_hh=''; $scripts_fc='WHITE';} -if ($hh=='filters') {$filters_hh='bgcolor ="#CCCCCC"'; $filters_fc='BLACK';} # grey - else {$filters_hh=''; $filters_fc='WHITE';} -if ($hh=='times') {$times_hh='bgcolor ="#99FF33"'; $times_fc='BLACK';} # hard teal - else {$times_hh=''; $times_fc='WHITE';} - -?> - - - - -\n"; -echo "
English Deutsch
- - - - - - - - - - - - - - - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - - - - -
  VICIDIAL ADMIN - Logout  
> SIZE=1> BENUTZER > SIZE=1> KAMPAGNEN > SIZE=1> LISTEN > SIZE=1> INDEXE > SIZE=1> FILTER > SIZE=1> IN-GROUPS > SIZE=1> Anrufzeiten > SIZE=1> BENUTZER-GRUPPEN > SIZE=1> REMOTEMITTEL > REPORTS
  LISTE BENUTZER     |     ADDIEREN Sie Einen NEUEN BENUTZER     |     SUCHE NACH Einem BENUTZER
  ADDIEREN SIE KAMPAGNE     |     LISTE KAMPAGNEN
  ZEIGEN SIE LISTEN     |     ADDIEREN SIE NEUE LISTE     |     SUCHE NACH Einer LEITUNG |     FÜGEN SIE ZAHL DNC HINZU           |     LAST NEUE LEITUNGEN
  ADDIEREN SIE INDEX     |     ANSICHT-INDEXE
  ADDIEREN SIE FILTER     |     ANSICHT-FILTER
  ZEIGEN SIE IN-GROUPS     |     ADDIEREN SIE NEUES IN-GROUP
  Zeige Anrufzeiten     |     Hinzufügen neuer Anrufzeiten     |     Zeige landesspezifische Anrufzeiten     |     Hinzufügen neuer landesspezifischer Anrufzeiten  
  ADDIEREN SIE BENUTZER-GRUPPE     |     LISTE BENUTZER-GRUPPEN     |     GRUPPE STÜNDLICH
  ZEIGEN SIE REMOTEMITTEL     |     ADDIEREN SIE NEUE REMOTEMITTEL
 
-
\n"; -echo ""; - -echo "
ADDIEREN Sie Einen NEUEN BENUTZER
\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "$NWB#vicidial_users-user_group$NWE\n"; -echo "\n"; -echo "
Benutzer-Zahl: $NWB#vicidial_users-user$NWE
Kennwort:$NWB#vicidial_users-pass$NWE
Voller Name: $NWB#vicidial_users-full_name$NWE
Benutzer-Niveau: $NWB#vicidial_users-user_level$NWE
Benutzer-Gruppe:
Telefon-LOGON: $NWB#vicidial_users-phone_login$NWE
Telefon-Durchlauf: $NWB#vicidial_users-phone_pass$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN -###################### - -if ($ADD==11) -{ -echo "
\n"; -echo ""; - -echo "
ADDIEREN Sie Eine NEUE KAMPAGNE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Kampagne Identifikation: $NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
Aktiv:$NWB#vicidial_campaigns-active$NWE
Park-Verlängerung: $NWB#vicidial_campaigns-park_ext$NWE
Park-Dateiname: $NWB#vicidial_campaigns-park_file_name$NWE
Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
Erlauben Sie Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
Ortsgespräch-Zeit: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Index: $NWB#vicidial_campaigns-campaign_script$NWE
Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Liste Identifikation: (nur Stellen)$NWB#vicidial_lists-list_id$NWE
Liste Name: $NWB#vicidial_lists-list_name$NWE
Kampagne: $NWB#vicidial_lists-campaign_id$NWE
Aktiv:$NWB#vicidial_lists-active$NWE
\n"; - -} - - -###################### -# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number -###################### - -if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) - { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NICHT ADDIERT - diese Telefonnummer ist bereits in benennen nichtListe: $phone_number

\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC FÜGTE HINZU: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); - } - } - } - -echo "
FÜGEN Sie Eine ZAHL Der DNC LISTE Hinzu\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Telefonnummer: (nur Stellen)$NWB#vicidial_list-dnc$NWE
\n"; - -} - - -###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN -###################### - -if ($ADD==1111) -{ -echo "
\n"; -echo ""; - -echo "
ADDIEREN Sie Eine NEUE INBOUND GRUPPE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Gruppe Identifikation: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
Gruppe Farbe: $NWB#vicidial_inbound_groups-group_color$NWE
Aktiv:$NWB#vicidial_inbound_groups-active$NWE
Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Anzeige: $NWB#vicidial_inbound_groups-fronter_display$NWE
Index: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN -###################### - -if ($ADD==11111) -{ -echo "
\n"; -echo ""; - -echo "
ADDIEREN SIE NEUE REMOTEMITTEL\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Benutzernummer Anfang: (nur Zahlen, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Zeilenzahl: (nur Zahlen)$NWB#vicidial_remote_agents-number_of_lines$NWE
Bediener IP: $NWB#vicidial_remote_agents-server_ip$NWE
Externe Verlängerung: (dialplan Zahl wählte, um Mittel zu erreichen)$NWB#vicidial_remote_agents-conf_exten$NWE
Status:$NWB#vicidial_remote_agents-status$NWE
Kampagne: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Gruppen: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "ANMERKUNG: Sie kann bis 30 Sekunden für die Änderungen dauern, dieauf diesem Schirm eingereicht werden, um Phasen zu gehen\n"; - -} - - -###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN -###################### - -if ($ADD==111111) -{ -echo "
\n"; -echo ""; - -echo "
ADDIEREN SIE NEUE BENUTZER-GRUPPE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Gruppe: (keine Räume oder Interpunktion)$NWB#vicidial_user_groups-user_group$NWE
Beschreibung: (Beschreibung der Gruppe)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -} - - -###################### -# ADD=1111111 display the ADD NEW SCRIPT SCREEN -###################### - -if ($ADD==1111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW SCRIPT\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Index Identifikation: (keine Räume oder Interpunktion)$NWB#vicidial_scripts-script_id$NWE
Index-Name: (Titel dem Index)$NWB#vicidial_scripts-script_name$NWE
Index-Anmerkungen: $NWB#vicidial_scripts-script_comments$NWE
Aktiv:$NWB#vicidial_scripts-active$NWE
Index-Text: $NWB#vicidial_scripts-script_text$NWE
\n"; - -} - - -###################### -# ADD=11111111 display the ADD NEW FILTER SCREEN -###################### - -if ($ADD==11111111) -{ -echo "
\n"; -echo ""; - -echo "
ADDIEREN SIE NEUEN FILTER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Filter Identifikation: (keine Räume oder Interpunktion)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter-Name: (kurze Beschreibung des Filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter-Anmerkungen: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; -} - - -###################### -# ADD=111111111 display the ADD NEW CALL TIME SCREEN -###################### - -if ($ADD==111111111) -{ -echo "
\n"; -echo ""; - -echo "
Hinzufügen neuer Anrufzeiten\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
Anrufzeit ID: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-call_time_id$NWE
Anrufzeit Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
Anrufzeit Kommentare: $NWB#vicidial_call_times-call_time_comments$NWE
Datums und Zeitoptionen erscheinen, wenn die Anrufzeitdefinition angelegt wurde
\n"; -} - - -###################### -# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN -###################### - -if ($ADD==1111111111) -{ -echo "
\n"; -echo ""; - -echo "
Hinzufügen neuer landesspezifischer Anrufzeiten\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
Landesspezifische Anrufzeiten ID: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (keine Räume oder Interpunktion)$NWB#vicidial_call_times-state_call_time_state$NWE
Landesspezifischer Anrufzeiten Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
Landesspezifischer Anrufzeiten Kommentar: $NWB#vicidial_call_times-call_time_comments$NWE
Datums und Zeitoptionen erscheinen, wenn die Anrufzeitdefinition angelegt wurde
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 2 series, validates form data and inserts the new record into the database -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=2 adds the new user to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
BENUTZER NICHT ADDIERT - es gibt bereits einen Benutzer im System mitdieser Benutzerzahl\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
BENUTZER NICHT ADDIERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
Teilnehmerbezeichnung muß zwischen 2 und 8 Buchstaben lang sein\n"; - echo "
voller Name und Kennwort müssen mindestens 2 Buchstaben lang sein\n"; - } - else - { - echo "
BENUTZER FÜGTE HINZU: $user\n"; - - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); - } - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new campaign to the system -###################### - -if ($ADD==21) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
KAMPAGNE NICHT ADDIERT - es gibt bereits eine Kampagne im System mitdieser Identifikation\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) ) - { - echo "
KAMPAGNE NICHT ADDIERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
Kampagne Identifikation muß zwischen 2 und 8 Buchstaben lang sein\n"; - echo "
Kampagne Name muß zwischen 6 und 40 Buchstaben lang sein\n"; - } - else - { - echo "
KAMPAGNE ADDIERT: $campaign_id\n"; - - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch) values('$campaign_id','$campaign_name','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN Sie Eine NEUE KAMPAGNE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - } - } -$ADD=31; -} - -###################### -# ADD=22 adds the new campaign status to the system -###################### - -if ($ADD==22) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
KAMPAGNE STATUS NICHT ADDIERT - es gibt bereits einen Kampagne-Statusim System mit diesem Namen\n";} - else - { - $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
KAMPAGNE STATUS NICHT ADDIERT - es gibt bereits einen Globalstatus imSystem mit diesem Namen\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
KAMPAGNE STATUS NICHT ADDIERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; - echo "
Status muß zwischen 1 und 8 Buchstaben lang sein\n"; - echo "
Statusname muß zwischen 2 und 30 Buchstaben lang sein\n"; - } - else - { - echo "
KAMPAGNE STATUS ADDIERT: $campaign_id - $status\n"; - - $stmt="INSERT INTO vicidial_campaign_statuses values('$status','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN Sie Eine NEUE KAMPAGNE STATUS |$PHP_AUTH_USER|$ip|'$status','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } - } -$ADD=31; -} - - -###################### -# ADD=23 adds the new campaign hotkey to the system -###################### - -if ($ADD==23) -{ - $HKstatus_data = explode('-----',$HKstatus); - $status = $HKstatus_data[0]; - $status_name = $HKstatus_data[1]; - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
KAMPAGNE HOTKEY NICHT ADDIERT worden - es gibt bereits eineKampagne-hotkey im System mit diesem hotkey\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
KAMPAGNE HOTKEY NICHT ADDIERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; - echo "
hotkey muß ein einzelner Buchstabe zwischen 1 und 9 sein \n"; - echo "
Status muß zwischen 1 und 8 Buchstaben lang sein\n"; - } - else - { - echo "
KAMPAGNE HOTKEY FÜGTE HINZU: $campaign_id - $status - $hotkey\n"; - - $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN Sie Eine NEUE KAMPAGNE HOTKEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=25 adds the new campaign lead recycle entry to the system -###################### - -if ($ADD==25) -{ - $status = eregi_replace("-----.*",'',$status); - echo ""; - $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
KAMPAGNE LEITUNG BEREITEN NICHT HINZUGEFÜGT auf - es gibt bereitseine Führenwiederverwertung für diese Kampagne mit diesem Status\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
KAMPAGNE LEITUNG BEREITEN NICHT HINZUGEFÜGT auf - gehen Sie bittezurück und betrachten Sie die Daten, die Sie eingaben\n"; - echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; - echo "
Versuch verzögert muß mindestens 120 Sekunden sein\n"; - echo "
maximale Versuche müssen von 1 bis 10 sein\n"; - } - else - { - echo "
KAMPAGNE LEITUNG BEREITEN HINZUGEFÜGT AUF: $campaign_id - $status - $attempt_delay\n"; - - $stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new list to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
LISTE NICHT ADDIERT - es gibt bereits eine Liste im System mit dieserIdentifikation\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or (strlen($list_id) < 2) or (strlen($list_id) > 8) ) - { - echo "
LISTE NICHT ADDIERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n"; - echo "
Liste Identifikation muß zwischen 2 und 8 Buchstaben lang sein\n"; - echo "
Liste Name muß mindestens 2 Buchstaben lang sein\n"; - } - else - { - echo "
LISTE ADDIERT: $list_id\n"; - - $stmt="INSERT INTO vicidial_lists values('$list_id','$list_name','$campaign_id','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|'$list_id','$list_name','$campaign_id','$active'|\n"); - fclose($fp); - } - } - } -$ADD=311; -} - - - -###################### -# ADD=2111 adds the new inbound group to the system -###################### - -if ($ADD==2111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
GRUPPE NICHT ADDIERT - es gibt bereits eine Gruppe im System mitdieser Identifikation\n";} - else - { - if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) ) - { - echo "
GRUPPE NICHT ADDIERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n"; - echo "
Gruppe Identifikation muß zwischen 2 und 20 Buchstaben lang sein undNr. enthalten ' -+'.\n"; - echo "
Gruppe Name und Gruppe Farbe muß mindestens 2 Buchstaben lang sein\n"; - } - else - { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - echo "
GRUPPE FÜGTE HINZU: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000; -} - - -###################### -# ADD=21111 adds new remote agents to the system -###################### - -if ($ADD==21111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
REMOTEMITTEL NICHT ADDIERT - es gibt bereits eineRemotemitteleintragung beginnend mit diesem userID\n";} - else - { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTEMITTEL NICHT ADDIERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; - echo "
Benutzernummer Anfang und externe Verlängerung müssen mindestens 2Buchstaben lang sein\n"; - } - else - { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTEMITTEL FÜGTEN HINZU: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW REMOTEMITTEL ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } - } - } -$ADD=10000; -} - -###################### -# ADD=211111 adds new user group to the system -###################### - -if ($ADD==211111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
BENUTZER-GRUPPE NICHT ADDIERT - es gibt bereits eine BenutzergruppeEintragung mit diesem Namen\n";} - else - { - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
BENUTZER-GRUPPE NICHT ADDIERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; - echo "
Gruppe Name und Beschreibung müssen mindestens 2 Buchstaben langsein\n"; - } - else - { - $stmt="INSERT INTO vicidial_user_groups values('$user_group','$group_name');"; - $rslt=mysql_query($stmt, $link); - - echo "
BENUTZER-GRUPPE ADDIERT: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADDIEREN Sie Einen NEUEN BENUTZER GROUP ENTRY |$PHP_AUTH_USER|$ip|'$user_group','$group_name'|\n"); - fclose($fp); - } - } - } -$ADD=100000; -} - -###################### -# ADD=2111111 adds new script to the system -###################### - -if ($ADD==2111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
INDEX NICHT ADDIERT - es gibt bereits eine Indexeintragung mit diesem Namen\n";} - else - { - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
INDEX NICHT ADDIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Indexname, -beschreibung und -text müssen mindestens 2 Buchstabenlang sein\n"; - } - else - { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; - $rslt=mysql_query($stmt, $link); - - echo "
INDEX FÜGTE HINZU: $script_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000000; -} - - -###################### -# ADD=21111111 adds new filter to the system -###################### - -if ($ADD==21111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
FILTER NICHT ADDIERT - es gibt bereits eine Filtereintragung mitdieser Identifikation\n";} - else - { - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NICHT ADDIERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Filtern Sie Identifikation, Namen und SQL muß mindestens 2 Buchstabenlang sein\n"; - } - else - { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='$lead_filter_sql';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER ADDIERT: $lead_filter_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=10000000; -} - - -###################### -# ADD=211111111 adds new call time definition to the system -###################### - -if ($ADD==211111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Anrufzeit Definition nicht hinzugefügt - Es existiert bereits ein Anrufzeiteintrag mit dieser ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
Anrufzeit Definition nicht hinzugefügt - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Anrufzeit ID und Name müssen mindestens 2 Zeichen Länge haben\n"; - } - else - { - $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments';"; - $rslt=mysql_query($stmt, $link); - - echo "
Anrufzeit hinzugefügt: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - } -$ADD=311111111; -} - - -###################### -# ADD=2111111111 adds new state call time definition to the system -###################### - -if ($ADD==2111111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Landesspezifische Anrufzeitdefinition nicht hinzugefügt - Es existiert bereits ein Anrufzeiteintrag mit dieser ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
Landesspezifische Anrufzeitdefinition nicht hinzugefügt - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Landesspezifische Anrufzeit ID, Name und Land müssen mindestens 2 Zeichen Länge haben\n"; - } - else - { - $stmt="INSERT INTO vicidial_state_call_times SET state_call_time_id='$call_time_id',state_call_time_name='$call_time_name',state_call_time_comments='$call_time_comments',state_call_time_state='$state_call_time_state';"; - $rslt=mysql_query($stmt, $link); - - echo "
landesspezifische Anrufzeiten hinzugefügt: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=3111111111; -} - - - - -###################################################################################################### -###################################################################################################### -####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below -###################################################################################################### -###################################################################################################### - - - -###################### -# ADD=4A submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4A") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
BENUTZER NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
Kennwort und voller Name jedes Notwendigkeit ot sind mindestens 2Buchstaben lang\n"; - } - else - { - echo "
BENUTZER ÄNDERTE - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - -###################### -# ADD=4B submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4B") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
BENUTZER NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
Kennwort und voller Name jedes Notwendigkeit ot sind mindestens 2Buchstaben lang\n"; - } - else - { - echo "
BENUTZER ÄNDERTE - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - - -###################### -# ADD=4 submit user modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
BENUTZER NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
Kennwort und voller Name jedes Notwendigkeit ot sind mindestens 2Buchstaben lang\n"; - } - else - { - echo "
BENUTZER ÄNDERTE: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - -###################### -# ADD=41 submit campaign modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
KAMPAGNE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
der Kampagne Name muß mindestens 6 Buchstaben lang sein\n"; - } - else - { - echo "
KAMPAGNE ÄNDERTE: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
ZURÜCKSTELLEN DES KAMPAGNE LEITUNG ZUFUHRBEHÄLTERS\n"; - echo "
- Wartezeit 1 Minute, bevor folgende Nummer gewählt wird\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=42 delete campaign status in the system -###################### - -if ($ADD==42) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
KAMPAGNE STATUS NICHT GEÄNDERT - gehen Sie bitte zurück undbetrachten Sie die Daten, die Sie eingaben\n"; - echo "
die Kampagne Kennzeichnung muß mindestens 2 Buchstaben lang sein\n"; - echo "
der Kampagne Status muß mindestens Buchstaben 1 lang sein\n"; - } - else - { - echo "
KUNDENSPEZIFISCHER KAMPAGNE STATUS GELÖSCHT: $campaign_id - $status\n"; - - $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=43 delete campaign hotkey in the system -###################### - -if ($ADD==43) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
KAMPAGNE HOTKEY NICHT GEÄNDERT - gehen Sie bitte zurück undbetrachten Sie die Daten, die Sie eingaben\n"; - echo "
die Kampagne Kennzeichnung muß mindestens 2 Buchstaben lang sein\n"; - echo "
der Kampagne Status muß mindestens Buchstaben 1 lang sein\n"; - echo "
das Kampagne hotkey muß mindestens Buchstaben 1 lang sein\n"; - } - else - { - echo "
KUNDENSPEZIFISCHE KAMPAGNE HOTKEY LÖSCHTE: $campaign_id - $status - $hotkey\n"; - - $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=44 submit campaign modifications to the system - Basic View -###################### - -if ($ADD==44) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
KAMPAGNE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
der Kampagne Name muß mindestens 6 Buchstaben lang sein\n"; - } - else - { - echo "
KAMPAGNE ÄNDERTE: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
ZURÜCKSTELLEN DES KAMPAGNE LEITUNG ZUFUHRBEHÄLTERS\n"; - echo "
- Wartezeit 1 Minute, bevor folgende Nummer gewählt wird\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=34; # go to campaign modification form below -} - -###################### -# ADD=45 modify campaign lead recycle in the system -###################### - -if ($ADD==45) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; - echo "
Versuch verzögert muß mindestens 120 Sekunden sein\n"; - echo "
maximale Versuche müssen von 1 bis 10 sein\n"; - } - else - { - echo "
CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=411 submit list modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) - { - echo "
LISTE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n"; - echo "
Liste Name muß mindestens 2 Buchstaben lang sein\n"; - } - else - { - echo "
LISTE ÄNDERTE: $list_id\n"; - - $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') - { - echo "
ZURÜCKSTELLEN VON VON LIST-CALLED-STATUS\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } - } - if ($campaign_id != "$old_campaign_id") - { - echo "
ENTFERNEN DER LISTE ZUFUHRBEHÄLTER-LEITUNGEN VOM ALTEN KAMPAGNEZUFUHRBEHÄLTER ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id'|\n"); - fclose($fp); - } - } - -$ADD=311; # go to list modification form below -} - - -###################### -# ADD=4111 modify in-group info in the system -###################### - -if ($ADD==4111) -{ - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) - { - echo "
GRUPPE NICHT GEÄNDERT - gehen Sie bitte zurück und betrachten Siedie Daten, die Sie eingaben\n"; - echo "
Gruppe Name und Gruppe Farbe muß mindestens 2 Buchstaben lang sein\n"; - } - else - { - echo "
GRUPPE GEÄNDERT: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_message='$drop_message',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111; # go to in-group modification form below -} - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTEMITTEL NICHT GEÄNDERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n"; - echo "
Benutzernummer Anfang und externe Verlängerung müssen mindestens 2Buchstaben lang sein\n"; - } - else - { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTEMITTEL GEÄNDERT\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTEMITTEL ENTRY |$PHP_AUTH_USER|$ip|set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - } - -$ADD=31111; # go to remote agents modification form below -} - - - -###################### -# ADD=411111 modify user group info in the system -###################### - -if ($ADD==411111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
BENUTZER-GRUPPE NICHT GEÄNDERT - gehen Sie bitte zurück undbetrachten Sie die Daten, die Sie eingaben\n"; - echo "
Gruppe Name und Beschreibung müssen mindestens 2 Buchstaben langsein\n"; - } - else - { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); - - echo "
BENUTZER-GRUPPE GEÄNDERT\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group'|\n"); - fclose($fp); - } - } - -$ADD=311111; # go to user group modification form below -} - -###################### -# ADD=4111111 modify script in the system -###################### - -if ($ADD==4111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
INDEX NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Indexname, -beschreibung und -text müssen mindestens 2 Buchstabenlang sein\n"; - } - else - { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
INDEX ÄNDERTE\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111; # go to script modification form below -} - - -###################### -# ADD=41111111 modify filter in the system -###################### - -if ($ADD==41111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NICHT GEÄNDERT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Filtern Sie Identifikation, Namen und SQL muß mindestens 2 Buchstabenlang sein\n"; - } - else - { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='$lead_filter_sql' where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER GEÄNDERT\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31111111; # go to filter modification form below -} - - -###################### -# ADD=411111111 modify call time in the system -###################### - -if ($ADD==411111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
Anrufzeit nicht geändert - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Anrufzeit ID und Name müssen mindestens 2 Zeichen Länge haben\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
Anrufzeit geändert\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - -$ADD=311111111; # go to call time modification form below -} - - -###################### -# ADD=4111111111 modify state call time in the system -###################### - -if ($ADD==4111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
Landesspezifische Anrufzeit nicht geändert - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Landesspezifische Anrufzeit ID, Name und Land müssen mindestens 2 Zeichen Länge haben\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
Landesspezifische Anrufzeit geändert\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111111; # go to state call time modification form below -} - - - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of user -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) - { - echo "
BENUTZER NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - echo "
BENUTZER-AUSLASSUNG BESTÄTIGUNG: $user\n"; - echo "

Klicken Sie hier, um Benutzer zu löschen $user


\n"; - } - -$ADD='3'; # go to user modification below -} - -###################### -# ADD=51 confirmation before deletion of campaign -###################### - -if ($ADD==51) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) ) - { - echo "
KAMPAGNE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Kampagne_id be at least 2 characters in length\n"; - } - else - { - echo "
KAMPAGNE AUSLASSUNG BESTÄTIGUNG: $campaign_id\n"; - echo "

Klicken Sie hier, um Kampagne zu löschen $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=52 confirmation before logging all agents out of campaign of campaign -###################### - -if ($ADD==52) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
MITTEL GELOGGT NICHT AUS KAMPAGNE HERAUS - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Kampagne_id be at least 2 characters in length\n"; - } - else - { - echo "
MITTELLOGOUT-BESTÄTIGUNG: $campaign_id\n"; - echo "

Klicken Sie hier, um alle Mittel aus zu loggen $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=511 confirmation before deletion of list -###################### - -if ($ADD==511) -{ - echo ""; - - if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) ) - { - echo "
LISTE NICHT GELÖSCHT WORDEN - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - echo "
LISTE AUSLASSUNG BESTÄTIGUNG: $list_id\n"; - echo "

Klicken Sie hier, um Liste und alle seine Leitungen zu löschen $list_id


\n"; - } - -$ADD='311'; # go to campaign modification below -} - -###################### -# ADD=5111 confirmation before deletion of in-group -###################### - -if ($ADD==5111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) ) - { - echo "
IN-GROUP NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - echo "
IN-GROUP AUSLASSUNG BESTÄTIGUNG: $group_id\n"; - echo "

Klicken Sie hier, um Ingruppe zu löschen $group_id


\n"; - } - -$ADD='3111'; # go to in-group modification below -} - -###################### -# ADD=51111 confirmation before deletion of remote agent record -###################### - -if ($ADD==51111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) ) - { - echo "
REMOTEMITTEL NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - echo "
REMOTEMITTEL-AUSLASSUNG BESTÄTIGUNG: $remote_agent_id\n"; - echo "

Klicken Sie hier, um Remotemittel zu löschen $remote_agent_id


\n"; - } - -$ADD='31111'; # go to remote agent modification below -} - -###################### -# ADD=511111 confirmation before deletion of user group record -###################### - -if ($ADD==511111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) - { - echo "
BENUTZER-GRUPPE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - echo "
BENUTZER-GRUPPE AUSLASSUNG BESTÄTIGUNG: $user_group\n"; - echo "

Klicken Sie hier, um Benutzergruppe zu löschen $user_group


\n"; - } - -$ADD='311111'; # go to user group modification below -} - -###################### -# ADD=5111111 confirmation before deletion of script record -###################### - -if ($ADD==5111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) ) - { - echo "
INDEX NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Script_id must be at least 2 characters in length\n"; - } - else - { - echo "
INDEX-AUSLASSUNG BESTÄTIGUNG: $script_id\n"; - echo "

Klicken Sie hier, um Index zu löschen $script_id


\n"; - } - -$ADD='3111111'; # go to script modification below -} - -###################### -# ADD=51111111 confirmation before deletion of filter record -###################### - -if ($ADD==51111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) ) - { - echo "
FILTER NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Filter Identifikation muß mindestens 2 Buchstaben lang sein\n"; - } - else - { - echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; - echo "

Klicken Sie hier, um Filter zu löschen$lead_filter_id


\n"; - } - -$ADD='31111111'; # go to filter modification below -} - -###################### -# ADD=511111111 confirmation before deletion of call time record -###################### - -if ($ADD==511111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
Anrufzeit nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Anrufzeit ID muss mindestens 2 Zeichen lang sein\n"; - } - else - { - echo "
Löschen der Anrufzeit bestätigen: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; - } - -$ADD='311111111'; # go to call time modification below -} - -###################### -# ADD=5111111111 confirmation before deletion of call time record -###################### - -if ($ADD==5111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
Landesspezifische Anrufzeit nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Anrufzeit ID muss mindestens 2 Zeichen lang sein\n"; - } - else - { - echo "
Löschen der landesspezifischen Anrufzeit bestätigen: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; - } - -$ADD='3111111111'; # go to state call time modification below -} - - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete user record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) - { - echo "
BENUTZER NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|user='$user'|\n"); - fclose($fp); - } - echo "
BENUTZER-AUSLASSUNG FÜHRTE DURCH: $user\n"; - echo "

\n"; - } - -$ADD='0'; # go to user list -} - -###################### -# ADD=61 delete campaign record -###################### - -if ($ADD==61) -{ - echo ""; - - if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) - { - echo "
KAMPAGNE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Kampagne_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
ENTFERNEN DER LISTE ZUFUHRBEHÄLTER-LEITUNGEN VOM ALTEN KAMPAGNEZUFUHRBEHÄLTER ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
KAMPAGNE AUSLASSUNG FÜHRTE DURCH: $campaign_id\n"; - echo "

\n"; - } - -$ADD='10'; # go to campaigns list -} - -###################### -# ADD=62 Logout all agents fro a campaign -###################### - -if ($ADD==62) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
MITTEL GELOGGT NICHT AUS KAMPAGNE HERAUS - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Kampagne_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!MITTELLOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
MITTELLOGOUT FÜHRTE DURCH: $campaign_id\n"; - echo "

\n"; - } - -$ADD='31'; # go to campaign modification below -} - - -###################### -# ADD=65 delete campaign lead recycle in the system -###################### - -if ($ADD==65) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
KAMPAGNE LEITUNG BEREITEN NICHT GELÖSCHT AUF - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Status muß zwischen 1 und 6 Buchstaben lang sein\n"; - echo "
Versuch verzögert muß mindestens 120 Sekunden sein\n"; - echo "
maximale Versuche müssen von 1 bis 10 sein\n"; - } - else - { - echo "
KAMPAGNE LEITUNG BEREITEN GELÖSCHT AUF: $campaign_id - $status - $attempt_delay\n"; - - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=611 delete list record and all leads within it -###################### - -if ($ADD==611) -{ - echo ""; - - if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) - { - echo "
LISTE NICHT GELÖSCHT WORDEN - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
ENTFERNEN DER LISTE ZUFUHRBEHÄLTER-LEITUNGEN VOM ALTEN KAMPAGNEZUFUHRBEHÄLTER ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
ENTFERNEN DER LISTE LEITUNGEN VON DER VICIDIAL_LIST TABELLE\n"; - $stmt="DELETE from vicidial_list where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } - echo "
LISTE AUSLASSUNG DURCHGEFÜHRT: $list_id\n"; - echo "

\n"; - } - -$ADD='100'; # go to lists list -} - -###################### -# ADD=6111 delete in-group record -###################### - -if ($ADD==6111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) - { - echo "
IN-GROUP NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } - echo "
IN-GROUP AUSLASSUNG FÜHRTE DURCH: $group_id\n"; - echo "

\n"; - } - -$ADD='1000'; # go to in-group list -} - -###################### -# ADD=61111 delete remote agent record -###################### - -if ($ADD==61111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) - { - echo "
REMOTEMITTEL NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - echo "
REMOTEMITTEL-AUSLASSUNG FÜHRTE DURCH: $remote_agent_id\n"; - echo "

\n"; - } - -$ADD='10000'; # go to remote agents list -} - -###################### -# ADD=611111 delete user group record -###################### - -if ($ADD==611111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) - { - echo "
BENUTZER-GRUPPE NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } - echo "
BENUTZER-GRUPPE AUSLASSUNG DURCHGEFÜHRT: $user_group\n"; - echo "

\n"; - } - -$ADD='100000'; # go to user group list -} - -###################### -# ADD=6111111 delete script record -###################### - -if ($ADD==6111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) - { - echo "
INDEX NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Script_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } - echo "
INDEX-AUSLASSUNG FÜHRTE DURCH: $script_id\n"; - echo "

\n"; - } - -$ADD='1000000'; # go to script list -} - - -###################### -# ADD=61111111 delete filter record -###################### - -if ($ADD==61111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) - { - echo "
FILTER NICHT GELÖSCHT - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Filter Identifikation muß mindestens 2 Buchstaben lang sein\n"; - } - else - { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } - echo "
FILTER-AUSLASSUNG DURCHGEFÜHRT: $lead_filter_id\n"; - echo "

\n"; - } - -$ADD='10000000'; # go to filter list -} - - -###################### -# ADD=611111111 delete call times record -###################### - -if ($ADD==611111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
Anrufzeit nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Anrufzeit ID muss mindestens 2 Zeichen lang sein\n"; - } - else - { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
Löschen der Anrufzeiten beendet: $call_time_id\n"; - echo "

\n"; - } - -$ADD='100000000'; # go to call times list -} - - -###################### -# ADD=6111111111 delete call times record -###################### - -if ($ADD==6111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
Landesspezifische Anrufzeit nicht gelöscht - Gehen Sie bitte zurück und betrachten Sie die Daten, die Sieeingaben\n"; - echo "
Anrufzeit ID muss mindestens 2 Zeichen lang sein\n"; - } - else - { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; - $rslt=mysql_query($stmt, $link); - $sct_to_print = mysql_num_rows($rslt); - $sct_list=''; - - $o=0; - while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_ids[$o] = "$rowx[0]"; - $sct_states[$o] = "$rowx[1]"; - $o++; - } - $o=0; - - while ($sct_to_print > $o) { - $sct_states[$o] = eregi_replace("\|$call_time_id\|",'|',$sct_states[$o]); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$sct_states[$o]' where call_time_id='$sct_ids[$o]';"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - echo "Landesrichlinie gelöscht: $sct_ids[$o]
\n"; - $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
Löschen der landesspezifischen Anrufzeit beendet: $call_time_id\n"; - echo "

\n"; - } - -$ADD='1000000000'; # go to call times list -} - - - - - - -###################################################################################################### -###################################################################################################### -####### 3 series, record modification forms -###################################################################################################### -###################################################################################################### - - - - -###################### -# ADD=3 modify user info in the system -###################### - -if ($ADD==3) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_level = $row[4]; - $user_group = $row[5]; - $phone_login = $row[6]; - $phone_pass = $row[7]; - $delete_users = $row[8]; - $delete_user_groups = $row[9]; - $delete_lists = $row[10]; - $delete_campaigns = $row[11]; - $delete_ingroups = $row[12]; - $delete_remote_agents = $row[13]; - $load_leads = $row[14]; - $campaign_detail = $row[15]; - $ast_admin_access = $row[16]; - $ast_delete_phones = $row[17]; - $delete_scripts = $row[18]; - $modify_leads = $row[19]; - $hotkeys_active = $row[20]; - $change_agent_campaign =$row[21]; - $agent_choose_ingroups =$row[22]; - $scheduled_callbacks = $row[24]; - $agentonly_callbacks = $row[25]; - $agentcall_manual = $row[26]; - $vicidial_recording = $row[27]; - $vicidial_transfers = $row[28]; - $delete_filters = $row[29]; - $alter_agent_interface_options =$row[30]; - $closer_default_blended = $row[31]; - $delete_call_times = $row[32]; - $modify_call_times = $row[33]; - -if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) - { - echo "
Sie haben nicht Erlaubnis, diesen Benutzer zu ändern: $row[1]\n"; - } -else - { - echo "
ÄNDERN Sie Einen BENUTZER-SATZ: $row[1]\n"; - if ($LOGuser_level > 8) - {echo "\n";} - else - { - if ($LOGalter_agent_interface == "1") - {echo "\n";} - else - {echo "\n";} - } - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - if ($LOGuser_level > 8) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
Benutzer-Zahl: $row[1]$NWB#vicidial_users-user$NWE
Kennwort:$NWB#vicidial_users-pass$NWE
Voller Name: $NWB#vicidial_users-full_name$NWE
Benutzer-Niveau: $NWB#vicidial_users-user_level$NWE
Benutzer-Gruppe: $NWB#vicidial_users-user_group$NWE
Telefon-LOGON: $NWB#vicidial_users-phone_login$NWE
Telefon-Durchlauf: $NWB#vicidial_users-phone_pass$NWE
MITTEL-SCHNITTSTELLE WAHLEN:
Mittel Wählen Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
HotKeys Aktiv: $NWB#vicidial_users-hotkeys_active$NWE
Zeitlich geplante Wiederholungsbesuche: $NWB#vicidial_users-scheduled_callbacks$NWE
Mittel-Nur Wiederholungsbesuche: $NWB#vicidial_users-agentonly_callbacks$NWE
Vertreter-Anruf-Handbuch: $NWB#vicidial_users-agentcall_manual$NWE
Vicidial Aufnahme: $NWB#vicidial_users-vicidial_recording$NWE
Vicidial Übertragungen: $NWB#vicidial_users-vicidial_transfers$NWE
Genauere Rückstellung Gemischt: $NWB#vicidial_users-closer_default_blended$NWE
Inbound Gruppen: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_users-closer_campaigns$NWE
ADMIN SCHNITTSTELLE WAHLEN:
Ändern Sie Mittel-Schnittstelle Wahlen:$NWB#vicidial_users-alter_agent_interface_options$NWE
Löschung-Benutzer: $NWB#vicidial_users-delete_users$NWE
Löschung-Benutzer-Gruppen: $NWB#vicidial_users-delete_user_groups$NWE
Löschung-Listen: $NWB#vicidial_users-delete_lists$NWE
Löschung-Kampagnen: $NWB#vicidial_users-delete_campaigns$NWE
Löschung In-Gruppen: $NWB#vicidial_users-delete_ingroups$NWE
Löschung-Direktübertragung Mittel: $NWB#vicidial_users-delete_remote_agents$NWE
Löschung-Indexs: $NWB#vicidial_users-delete_scripts$NWE
Last Leitungen: $NWB#vicidial_users-load_leads$NWE
Kampagne Detail: $NWB#vicidial_users-campaign_detail$NWE
AGC Admin Zugang: $NWB#vicidial_users-ast_admin_access$NWE
AGC Löschung-Telefone: $NWB#vicidial_users-ast_delete_phones$NWE
Ändern Sie Leitungen: $NWB#vicidial_users-modify_leads$NWE
Ändern Sie Vertreter-Kampagne: $NWB#vicidial_users-change_agent_campaign$NWE
Löschung-Filter: $NWB#vicidial_users-delete_filters$NWE
Lösche Anrufzeits: $NWB#vicidial_users-delete_call_times$NWE
Bearbeite Anrufzeits: $NWB#vicidial_users-modify_call_times$NWE
\n"; - - if ($LOGdelete_users > 0) - { - echo "

LÖSCHEN SIE DIESEN BENUTZER\n"; - } - echo "

Klicken Sie hier für Benutzerzeitblatt\n"; - echo "

Klicken Sie hier für Benutzerstatus\n"; - echo "

Klicken Sie hier für Benutzernotfall\n"; - echo "

Klicken Sie hier für Benutzer Wiederholungsbesuch Einflüsse\n"; - } - -} - - -###################### -# ADD=31 modify campaign info in the system - Detail view -###################### - -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed - -if ($ADD==31) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $campaign_rec_exten = $row[22]; - $campaign_recording = $row[23]; - $campaign_rec_filename = $row[24]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $am_message_exten = $row[27]; - $amd_send_to_vmx = $row[28]; - $xferconf_a_dtmf = $row[29]; - $xferconf_a_number = $row[30]; - $xferconf_b_dtmf = $row[31]; - $xferconf_b_number = $row[32]; - $alt_number_dialing = $row[33]; - $scheduled_callbacks = $row[34]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; - $safe_harbor_exten = $row[38]; - $display_dialable_count = $row[39]; - $wrapup_seconds = $row[40]; - $wrapup_message = $row[41]; -# $closer_campaigns = $row[42]; - $use_internal_dnc = $row[43]; - -echo "
ÄNDERN Sie Einen KAMPAGNEN SATZ: $row[0] - Grundlegende Ansicht"; -echo " | Detail-Ansicht | "; -echo "Echtzeit Bildschirm\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -if (eregi("CLOSER", $campaign_id)) - { - echo "\n"; - } - - - -echo "\n"; -echo "
Kampagne Identifikation: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
Aktiv:$NWB#vicidial_campaigns-active$NWE
Park-Verlängerung: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Netz-Form: $NWB#vicidial_campaigns-web_form_address$NWE
Erlauben Sie Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Vorwahlknopfstatus1: $NWB#vicidial_campaigns-dial_status$NWE
Vorwahlknopfstatus2: $NWB#vicidial_campaigns-dial_status$NWE
Vorwahlknopfstatus3: $NWB#vicidial_campaigns-dial_status$NWE
Vorwahlknopfstatus4: $NWB#vicidial_campaigns-dial_status$NWE
Vorwahlknopfstatus5: $NWB#vicidial_campaigns-dial_status$NWE
Liste Auftrag: $NWB#vicidial_campaigns-lead_order$NWE
Leitung Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_campaigns-next_agent_call$NWE
Ortsgespräch-Zeit: $NWB#vicidial_campaigns-local_call_time$NWE
Vorwahlknopf-Abschaltung: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Vorwahlknopf-Präfix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Kampagne CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Kampagne VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Kampagne Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Kampagne Aufnahme: $NWB#vicidial_campaigns-campaign_recording$NWE
Kampagne Rec Dateiname: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_campaigns-get_call_launch$NWE
Antwortende Maschine Anzeige: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD senden zu VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
BringenSie DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
BringenSie Zahl 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
BringenSie DTMF 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
BringenSie Zahl 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Alternative Nummer wählen: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Zeitlich geplante Wiederholungsbesuche: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Verbindungsaufbau Sekunden: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Benutze Sicherheitsnachricht: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Sicherheitsnebenstelle: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Nachbereitung Sekunden $NWB#vicidial_campaigns-wrapup_seconds$NWE
Nachbereitung Nachricht $NWB#vicidial_campaigns-wrapup_message$NWE
Benutzen Sie Interne DNC Liste: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Gewährte Inbound Gruppen:
"; - echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; - echo "$groups_list"; - echo "
\n"; - -echo "
\n"; -echo "
LISTEN INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LISTE IDENTIFIKATIONLISTE NAMEAKTIV
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Diese Kampagne hat$active_lists aktive Listen und$inactive_lists unaktivierte Listen

\n"; - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - Verberge

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - Zeige

"; - } - - - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "Diese Kampagne hat$hopper_leads Leitungen im Vorwahlknopfzufuhrbehälter

\n"; -echo "Klicken Sie hier, um zu sehen, welche Leitungen im Zufuhrbehälter imAugenblick sind

\n"; -echo "Klicken Sie hier, um alle Wiederholungsbesuch Einflüsse in dieserKampagne zu sehen

\n"; -echo "
\n"; - - - - -echo "
\n"; -echo "
KUNDENSPEZIFISCHE STATUS INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_statuses$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
STATUSBESCHREIBUNGAUSWÄHLBARLÖSCHUNG
$rowx[0]$rowx[1]$rowx[2]LÖSCHUNG
\n"; - -echo "
ADDIEREN SIE NEUEN KUNDENSPEZIFISCHEN KAMPAGNE STATUS
\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Beschreibung:   \n"; -echo "Auswählbar:   \n"; -echo "
\n"; - -echo "

\n"; - - - -echo "
GEWOHNHEIT HOTKEYS INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
HOTKEYSTATUSBESCHREIBUNGLÖSCHUNG
$rowx[1]$rowx[0]$rowx[2]LÖSCHUNG
\n"; - -echo "
ADDIEREN SIE NEUE KUNDENSPEZIFISCHE KAMPAGNE HOTKEY
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Hotkey:   \n"; -echo "Status:   \n"; -echo "
\n"; -echo "

\n"; - - - -echo "

LEITUNG, DIE INNERHALB DIESER KAMPAGNE AUFBEREITET:   $NWB#vicidial_lead_recycle$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $recycle_to_print = mysql_num_rows($rslt); - $o=0; - while ($recycle_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - -echo "
STATUSVERSUCH VERZÖGERTVERSUCH MAXIMUMAKTIV LÖSCHUNG
$rowx[2]
\n"; - echo "\n"; - echo "\n"; - echo "
LÖSCHUNG
\n"; - -echo "
ADDIEREN SIE NEUE KAMPAGNE LEITUNG AUFBEREITEN
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Versuch Verzögert: \n"; -echo "Versuch Maximum: \n"; -echo "
\n"; - -echo "

\n"; - -echo "LOGGEN SIE ALLE MITTEL AUS DIESER KAMPAGNE HERAUS

\n"; - -if ($LOGdelete_campaigns > 0) - { - echo "

LÖSCHEN SIE DIESE KAMPAGNE\n"; - } - -} - - -###################### -# ADD=34 modify campaign info in the system - Basic View -###################### - -if ($ADD==34) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $display_dialable_count = $row[39]; - -echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Grundlegende Ansicht | "; -echo "Detail-Ansicht | "; -echo "Echtzeit Bildschirm\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; -echo "
Kampagne Identifikation: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Kampagne Name: $NWB#vicidial_campaigns-campaign_name$NWE
Aktiv:$NWB#vicidial_campaigns-active$NWE
Park-Verlängerung: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Netz-Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Erlauben Sie Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Vorwahlknopfstatus1: $NWB#vicidial_campaigns-dial_status$NWE
Vorwahlknopfstatus2: $NWB#vicidial_campaigns-dial_status$NWE
Vorwahlknopfstatus3: $NWB#vicidial_campaigns-dial_status$NWE
Vorwahlknopfstatus4: $NWB#vicidial_campaigns-dial_status$NWE
Vorwahlknopfstatus5: $NWB#vicidial_campaigns-dial_status$NWE
Liste Auftrag: $NWB#vicidial_campaigns-lead_order$NWE
Leitung Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Zufuhrbehälter-Niveau: $NWB#vicidial_campaigns-hopper_level$NWE
Kraft-Zurückstellen des Zufuhrbehälters: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Selbstvorwahlknopf-Niveau: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Script: $script_id
Erhalten Sie Anruf-Produkteinführung: $get_call_launch
\n"; - -echo "
\n"; -echo "
LISTEN INNERHALB DIESER KAMPAGNE:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LISTE IDENTIFIKATIONLISTE NAMEAKTIV
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Diese Kampagne hat$active_lists aktive Listen und$inactive_lists unaktivierte Listen

\n"; - - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - Verberge

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - Zeige

"; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "Diese Kampagne hat$hopper_leads Leitungen im Vorwahlknopfzufuhrbehälter

\n"; -echo "Klicken Sie hier, um zu sehen, welche Leitungen im Zufuhrbehälter imAugenblick sind

\n"; -echo "Klicken Sie hier, um alle Wiederholungsbesuch Einflüsse in dieserKampagne zu sehen

\n"; -echo "
\n"; - -echo "
\n"; - -echo "LOGGEN SIE ALLE MITTEL AUS DIESER KAMPAGNE HERAUS

\n"; - - -if ($LOGdelete_campaigns > 0) - { - echo "

LÖSCHEN SIE DIESE KAMPAGNE\n"; - } - - -} - - -###################### -# ADD=311 modify list info in the system -###################### - -if ($ADD==311) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $Cstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($Cstatuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - # end grab status names - - -echo "
ÄNDERN Sie Einen LISTEN SATZ: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Liste Identifikation: $row[0]$NWB#vicidial_lists-list_id$NWE
Liste Name: $NWB#vicidial_lists-list_name$NWE
Kampagne: $NWB#vicidial_lists-campaign_id$NWE
Aktiv:$NWB#vicidial_lists-active$NWE
Stellen Sie Führen-Benennen-Status für diese Liste zurück: $NWB#vicidial_lists-reset_list$NWE
\n"; - -echo "
\n"; -echo "
STATUS INNERHALB DIESER LISTE:
\n"; -echo "\n"; -echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $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($rslt); - - $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]] = ($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; - if ($lead_list['count'] > 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 ($dispo == 'CBHOLD') - { - $CLB=""; - $CLE=""; - } - else - { - $CLB=''; - $CLE=''; - } - - echo "\n"; - $o++; - } - } - -echo "\n"; -echo "\n"; - -echo "
STATUSSTATUS-NAMEBENANNTNICHT BENANNT
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
GESAMTMENGE$lead_list[count]

\n"; -unset($lead_list); - - - - - -echo "
\n"; -echo "
ZEIT-ZONEN INNERHALB DIESER LISTE:
\n"; -echo "\n"; -echo "\n"; - - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - $plus='+'; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $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]] = ($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++; - } - - if ($lead_list['count'] > 0) - { - while (list($tzone,) = each($lead_list[$since_reset])) - { - $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - - if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} - else {$DISPtzone = "$tzone";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - } - } - -echo "\n"; -echo "\n"; - -echo "
GMT VERSETZTE JETZT (lokale Zeit)BENANNTNICHT BENANNT
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
TEILSUMMEN$lead_list[Y_count]$lead_list[N_count]
GESAMTMENGE$lead_list[count]

\n"; -unset($lead_list); - - - - - - - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; - $rslt=mysql_query($stmt, $link); - $status_called_to_print = mysql_num_rows($rslt); - - $o=0; - $sts=0; - $first_row=1; - $all_called_first=1000; - $all_called_last=0; - while ($status_called_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $leads_in_list = ($leads_in_list + $rowx[2]); - $count_statuses[$o] = "$rowx[0]"; - $count_called[$o] = "$rowx[1]"; - $count_count[$o] = "$rowx[2]"; - $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); - - if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) - { - if ($first_row) {$first_row=0;} - else {$sts++;} - $status[$sts] = "$rowx[0]"; - $status_called_first[$sts] = "$rowx[1]"; - if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} - } - $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); - $status_called_last[$sts] = "$rowx[1]"; - if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} - - $o++; - } - - - - -echo "
\n"; -echo "
BENANNTE ZÄHLIMPULSE INNERHALB DIESER LISTE:
\n"; -echo "\n"; -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - - $sts=0; - $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 ""; - - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $sts)) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - else - { - if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - - $called_printed=0; - $o=0; - while ($status_called_to_print > $o) - { - if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) - { - $called_printed++; - echo ""; - } - - - $o++; - } - if (!$called_printed) - {echo "";} - $first++; - } - echo "\n\n"; - - $sts++; - } - -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - -echo "
STATUSSTATUS-NAME$firstTEILSUMME
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
GESAMTMENGE$all_called_count[$first]$leads_in_list

\n"; - - - - - -echo "
\n"; - -if ($LOGdelete_lists > 0) - { - echo "

LÖSCHEN SIE DIESE LISTE\n"; - } - -} - - - -###################### -# ADD=3111 modify in-group info in the system -###################### - -if ($ADD==3111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $group_name = $row[1]; - $group_color = $row[2]; - $active = $row[3]; - $web_form_address = $row[4]; - $voicemail_ext = $row[5]; - $next_agent_call = $row[6]; - $fronter_display = $row[7]; - $script_id = $row[8]; - $get_call_launch = $row[9]; - $xferconf_a_dtmf = $row[10]; - $xferconf_a_number = $row[11]; - $xferconf_b_dtmf = $row[12]; - $xferconf_b_number = $row[13]; - $drop_call_seconds = $row[14]; - $drop_message = $row[15]; - $drop_exten = $row[16]; - -echo "
ÄNDERN Sie Einen GRUPPEN SATZ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -echo "\n"; -echo "
Gruppe Identifikation: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Gruppe Name: $NWB#vicidial_inbound_groups-group_name$NWE
Gruppe Farbe: $NWB#vicidial_inbound_groups-group_color$NWE
Aktiv:$NWB#vicidial_inbound_groups-active$NWE
Netz-Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Folgender Vertreter-Anruf: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Anzeige: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Erhalten Sie Anruf-Produkteinführung: $NWB#vicidial_inbound_groups-get_call_launch$NWE
BringenSie DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
BringenSie Zahl 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
BringenSie DTMF 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
BringenSie Zahl 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Verbindungsaufbau Sekunden: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Benutze Verbindungsaufbaunachricht: $NWB#vicidial_inbound_groups-drop_message$NWE
Verbindungsaufbaunebenstelle: $NWB#vicidial_inbound_groups-drop_exten$NWE
\n"; - -echo "

\n"; - -echo "
\n"; - -if ($LOGdelete_ingroups > 0) - { - echo "

LÖSCHEN SIE DIESES IN-GROUP\n"; - } - -} - - - -###################### -# ADD=31111 modify remote agents info in the system -###################### - -if ($ADD==31111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
ÄNDERN Sie Eine REMOTEMITTEL-EINTRAGUNG: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Benutzernummer Anfang: (nur Zahlen, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Zeilenzahl: (nur Zahlen)$NWB#vicidial_remote_agents-number_of_lines$NWE
Bediener IP: $NWB#vicidial_remote_agents-server_ip$NWE
Externe Verlängerung: (dialplan Zahl wählte, um Mittel zu erreichen)$NWB#vicidial_remote_agents-conf_exten$NWE
Status:$NWB#vicidial_remote_agents-status$NWE
Kampagne: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Gruppen: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "ANMERKUNG: Sie kann bis 30 Sekunden für die Änderungen dauern, dieauf diesem Schirm eingereicht werden, um Phasen zu gehen\n"; - - -if ($LOGdelete_remote_agents > 0) - { - echo "

LÖSCHEN SIE DIESES REMOTEMITTEL\n"; - } - -} - - -###################### -# ADD=311111 modify user group info in the system -###################### - -if ($ADD==311111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; -echo ""; - -echo "
ÄNDERN Sie Eine BENUTZER-GRUPPE EINTRAGUNG\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Gruppe: (keine Räume oder Interpunktion)$NWB#vicidial_user_groups-user_group$NWE
Beschreibung: (Beschreibung der Gruppe)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -if ($LOGdelete_user_groups > 0) - { - echo "

LÖSCHEN SIE DIESE BENUTZER-GRUPPE\n"; - } - -} - - -###################### -# ADD=3111111 modify script info in the system -###################### - -if ($ADD==3111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $script_name = $row[1]; - $script_comments = $row[2]; - $script_text = $row[3]; - $active = $row[4]; -echo ""; - -echo "
ÄNDERN Sie Einen INDEX\n"; -echo "\n"; -echo "\n"; -echo "
Index Identifikation: $script_id$NWB#vicidial_scripts-script_name$NWE
Index-Name: (Titel dem Index)$NWB#vicidial_scripts-script_name$NWE
Index-Anmerkungen: $NWB#vicidial_scripts-script_comments$NWE
Aktiv:$NWB#vicidial_scripts-active$NWE
Index-Text:

Vorbetrachtung-Index
$NWB#vicidial_scripts-script_text$NWE
\n"; - -if ($LOGdelete_scripts > 0) - { - echo "

LÖSCHEN SIE DIESEN INDEX\n"; - } - -} - - -###################### -# ADD=31111111 modify filter info in the system -###################### - -if ($ADD==31111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $lead_filter_name = $row[1]; - $lead_filter_comments = $row[2]; - $lead_filter_sql = $row[3]; -echo ""; - -echo "
ÄNDERN Sie Einen FILTER\n"; -echo "\n"; -echo "\n"; -echo "
Filter Identifikation:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter-Name: (kurze Beschreibung des Filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter-Anmerkungen: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - -echo "

"; -echo "
Testen der Kampagne:
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -if ($LOGdelete_filters > 0) - { - echo "

LÖSCHEN SIE DIESEN FILTER\n"; - } - -} - - -###################### -# ADD=321111111 modify call time definition info in the system -###################### - -if ($ADD==321111111) -{ -if ($LOGmodify_call_times==1) -{ - -if ( ($stage=="ADD") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - if (eregi("\|$",$ct_state_call_times)) - {$ct_state_call_times = "$ct_state_call_times$state_rule\|";} - else - {$ct_state_call_times = "$ct_state_call_times\|$state_rule\|";} - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "Landesrichtlinie hinzugefügt: $state_rule
\n"; - } -if ( ($stage=="REMOVE") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - $ct_state_call_times = eregi_replace("\|$state_rule\|",'|',$ct_state_call_times); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "Landesrichlinie gelöscht: $state_rule
\n"; - } - -$ADD=311111111; -} -else -{ -echo "Sie haben nicht die Rechte, um diese Seite anzusehen. Bitte zurück gehen."; -} - -} - - -###################### -# ADD=311111111 modify call time definition info in the system -###################### - -if ($ADD==311111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -$ct_srs=1; -$b=0; -$srs_SQL =''; -if (strlen($ct_state_call_times)>2) - { - $state_rules = explode('|',$ct_state_call_times); - $ct_srs = ((count($state_rules)) - 1); - } -echo "\n"; -echo "\n"; -while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>0) - { - $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - echo "\n"; - $srs_SQL .= "'$state_rules[$b]',"; - $srs_state_SQL .= "'$row[0]',"; - } - $b++; - } -if (strlen($srs_SQL)>2) - { - $srs_SQL = "$srs_SQL''"; - $srs_state_SQL = "$srs_state_SQL''"; - $srs_SQL = "where state_call_time_id NOT IN($srs_SQL) and state_call_time_state NOT IN($srs_state_SQL)"; - } -else - {$srs_SQL='';} -$stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;"; -$rslt=mysql_query($stmt, $link); -$sct_to_print = mysql_num_rows($rslt); -$sct_list=''; - -$o=0; -while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_list .= "\n"; - $o++; -} -echo "\n"; -echo "\n"; - -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $call_time_name = $row[1]; - $call_time_comments = $row[2]; - $ct_default_start = $row[3]; - $ct_default_stop = $row[4]; - $ct_sunday_start = $row[5]; - $ct_sunday_stop = $row[6]; - $ct_monday_start = $row[7]; - $ct_monday_stop = $row[8]; - $ct_tuesday_start = $row[9]; - $ct_tuesday_stop = $row[10]; - $ct_wednesday_start = $row[11]; - $ct_wednesday_stop = $row[12]; - $ct_thursday_start = $row[13]; - $ct_thursday_stop = $row[14]; - $ct_friday_start = $row[15]; - $ct_friday_stop = $row[16]; - $ct_saturday_start = $row[17]; - $ct_saturday_stop = $row[18]; - $ct_state_call_times = $row[19]; - -echo ""; - -echo "
Bearbeite eine Anrufzeit\n"; -echo "\n"; -echo "\n"; -echo "
Anrufzeit ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Anrufzeit Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
Anrufzeit Kommentare: $NWB#vicidial_call_times-call_time_comments$NWE
Standard Start Standard Stop $NWB#vicidial_call_times-ct_default_start$NWE
Sonntag Start Sonntag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Montag Start Montag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Dienstag Start Dienstag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Mittwoch Start Mittwoch Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Donnerstag Start Donnerstag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Freitag Start Freitag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Sonnabend Start Sonnabend Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Aktive landesspezifische Anrufzeit Definitionen für diese Aufnahme:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Add state call time rule:


\n"; -echo "Kampagnen, die diese Anrufzeit nutzen:
\n"; -echo "\n"; - - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - $CT_camp_id = $row[1]; - $CT_camp_name = $row[2]; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

Lösche diese Anrufzeit Definition\n"; - } -} -else -{ -echo "Sie haben nicht die Rechte, um diese Seite anzusehen. Bitte zurück gehen."; -} - -} - - -###################### -# ADD=3111111111 modify state call time definition info in the system -###################### - -if ($ADD==3111111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $state_call_time_state =$row[1]; - $call_time_name = $row[2]; - $call_time_comments = $row[3]; - $ct_default_start = $row[4]; - $ct_default_stop = $row[5]; - $ct_sunday_start = $row[6]; - $ct_sunday_stop = $row[7]; - $ct_monday_start = $row[8]; - $ct_monday_stop = $row[9]; - $ct_tuesday_start = $row[10]; - $ct_tuesday_stop = $row[11]; - $ct_wednesday_start = $row[12]; - $ct_wednesday_stop = $row[13]; - $ct_thursday_start = $row[14]; - $ct_thursday_stop = $row[15]; - $ct_friday_start = $row[16]; - $ct_friday_stop = $row[17]; - $ct_saturday_start = $row[18]; - $ct_saturday_stop = $row[19]; - -echo ""; - -echo "
Bearbeite eine landesspezifische Anrufzeit
\n"; -echo "\n"; -echo "\n"; -echo "
Anrufzeit ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
Landesspezifischer Anrufzeiten Name: (Kurze Beschreibung der Anrufzeit)$NWB#vicidial_call_times-call_time_name$NWE
Landesspezifischer Anrufzeiten Kommentar: $NWB#vicidial_call_times-call_time_comments$NWE
Standard Start Standard Stop $NWB#vicidial_call_times-ct_default_start$NWE
Sonntag Start Sonntag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Montag Start Montag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Dienstag Start Dienstag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Mittwoch Start Mittwoch Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Donnerstag Start Donnerstag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Freitag Start Freitag Stop $NWB#vicidial_call_times-ct_sunday_start$NWE
Sonnabend Start Sonnabend Stop $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; -echo "Anrufzeiten, die diese landesspezifische Anrufzeit benutzen:
\n"; -echo "\n"; - - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

Diese landesspezifische Anrufzeitdefinition löschen\n"; - } - -} -else -{ -echo "Sie haben nicht die Rechte, um diese Seite anzusehen. Bitte zurück gehen."; -} - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo "
\n"; -echo ""; - -echo "
SUCHE NACH Einem BENUTZER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
Benutzer-Zahl:
Voller Name:
Benutzer-Niveau:
Benutzer-Gruppe:
\n"; - -} - -###################### -# ADD=66 user search results -###################### - -if ($ADD==66) -{ -echo "
\n"; - echo ""; - - $SQL = ''; - if ($user) {$SQL .= " user LIKE \"%$user%\" and";} - if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";} - if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";} - if ($user_group) {$SQL .= " user_group = '$user_group' and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SUCHRESULTATE:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]ÄNDERN Sie | Notfall | STATUS | TIME
\n"; - -} - - -###################################################################################################### -###################################################################################################### -####### 8 series, Callback lists -###################################################################################################### -###################################################################################################### - -###################### -# ADD=8 find all callbacks on hold by a User -###################### -if ($ADD==8) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user='$user' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
USER CALLBACK HOLD LISTINGS: $user\n"; -$ADD='82'; -} - -###################### -# ADD=81 find all callbacks on hold within a Campaign -###################### -if ($ADD==81) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and campaign_id='$campaign_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN CALLBACK HOLD LISTINGS: $campaign_id\n"; -$ADD='82'; -} - -###################### -# ADD=811 find all callbacks on hold within a List -###################### -if ($ADD==811) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and list_id='$list_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; -$ADD='82'; -} - -###################### -# ADD=82 display all callbacks on hold -###################### -if ($ADD==82) -{ -echo "
\n"; -echo "
\n"; -echo "\n"; - - $o=0; - while ($cb_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
LEADLISTCAMPAIGNENTRYDATUMCALLBACKDATUMUSERRECIPIENTSTATUS
$row[1]$row[2]$row[3]$row[5]$row[6]$row[8]$row[9]$row[4]
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 0 series, displays and searches -###################################################################################################### -###################################################################################################### - -###################### -# ADD=0 display all active users -###################### -if ($ADD==0) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users order by full_name"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
BENUTZER-AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]ÄNDERN Sie | Notfall | STATUS | TIME
\n"; -} - -###################### -# ADD=10 display all campaigns -###################### -if ($ADD==10) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
KAMPAGNE AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  ÄNDERN Sie
\n"; -} - - -###################### -# ADD=100 display all lists -###################### -if ($ADD==100) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists order by list_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
LISTE AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]  ÄNDERN Sie
\n"; -} - - - -###################### -# ADD=1000 display all inbound groups -###################### -if ($ADD==1000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
INBOUND GRUPPE AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[5]  ÄNDERN Sie
\n"; -} - - -###################### -# ADD=10000 display all remote agents -###################### -if ($ADD==10000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
REMOTEMITTEL-AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]ÄNDERN Sie
\n"; -} - - -###################### -# ADD=100000 display all user groups -###################### -if ($ADD==100000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
BENUTZER-GRUPPEN AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]ÄNDERN Sie
\n"; -} - - -###################### -# ADD=1000000 display all scripts -###################### -if ($ADD==1000000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
INDEX-AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]ÄNDERN Sie
\n"; -} - - -###################### -# ADD=10000000 display all filters -###################### -if ($ADD==10000000) -{ -echo "\n";echo "\n";?> -
-
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
LEITUNG FILTER-AUFLISTUNGEN:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]ÄNDERN Sie
\n"; -} - - -###################### -# ADD=100000000 display all call times -###################### -if ($ADD==100000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
Anrufzeiten Liste:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[4] ÄNDERN Sie
\n"; -} - -###################### -# ADD=1000000000 display all state call times -###################### -if ($ADD==1000000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
Liste der landesspezifische Anrufzeiten:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] ÄNDERN Sie
\n"; -} - - - - - -echo "
\n"; - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds"; -echo "             VERSION: $version"; -echo "             BAU: $build
\n"; - - -?> - - -
- - - -1) - { - $g=0; - $p='13'; - $GMT_gmt[0] = ''; - $GMT_hour[0] = ''; - $GMT_day[0] = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $pmin=(gmdate("i", time() + $pzone)); - $phour=( (gmdate("G", time() + $pzone)) * 100); - $pday=gmdate("w", time() + $pzone); - $tz = sprintf("%.2f", $p); - $GMT_gmt[$g] = "$tz"; - $GMT_day[$g] = "$pday"; - $GMT_hour[$g] = ($phour + $pmin); - $p = ($p - 0.25); - $g++; - } - - $stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $Gct_default_start = "$rowx[3]"; - $Gct_default_stop = "$rowx[4]"; - $Gct_sunday_start = "$rowx[5]"; - $Gct_sunday_stop = "$rowx[6]"; - $Gct_monday_start = "$rowx[7]"; - $Gct_monday_stop = "$rowx[8]"; - $Gct_tuesday_start = "$rowx[9]"; - $Gct_tuesday_stop = "$rowx[10]"; - $Gct_wednesday_start = "$rowx[11]"; - $Gct_wednesday_stop = "$rowx[12]"; - $Gct_thursday_start = "$rowx[13]"; - $Gct_thursday_stop = "$rowx[14]"; - $Gct_friday_start = "$rowx[15]"; - $Gct_friday_stop = "$rowx[16]"; - $Gct_saturday_start = "$rowx[17]"; - $Gct_saturday_stop = "$rowx[18]"; - $Gct_state_call_times = "$rowx[19]"; - - $ct_states = ''; - $ct_state_gmt_SQL = ''; - $ct_srs=0; - $b=0; - if (strlen($Gct_state_call_times)>2) - { - $state_rules = explode('|',$Gct_state_call_times); - $ct_srs = ((count($state_rules)) - 2); - } - while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>1) - { - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Gstate_call_time_id = "$row[0]"; - $Gstate_call_time_state = "$row[1]"; - $Gsct_default_start = "$row[4]"; - $Gsct_default_stop = "$row[5]"; - $Gsct_sunday_start = "$row[6]"; - $Gsct_sunday_stop = "$row[7]"; - $Gsct_monday_start = "$row[8]"; - $Gsct_monday_stop = "$row[9]"; - $Gsct_tuesday_start = "$row[10]"; - $Gsct_tuesday_stop = "$row[11]"; - $Gsct_wednesday_start = "$row[12]"; - $Gsct_wednesday_stop = "$row[13]"; - $Gsct_thursday_start = "$row[14]"; - $Gsct_thursday_stop = "$row[15]"; - $Gsct_friday_start = "$row[16]"; - $Gsct_friday_stop = "$row[17]"; - $Gsct_saturday_start = "$row[18]"; - $Gsct_saturday_stop = "$row[19]"; - - $ct_states .="'$Gstate_call_time_state',"; - - $r=0; - $state_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday lokale Zeit - { - if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday lokale Zeit - { - if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday lokale Zeit - { - if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday lokale Zeit - { - if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday lokale Zeit - { - if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday lokale Zeit - { - if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday lokale Zeit - { - if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - $state_gmt = "$state_gmt'99'"; - $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; - } - - $b++; - } - if (strlen($ct_states)>2) - { - $ct_states = eregi_replace(",$",'',$ct_states); - $ct_statesSQL = "and state NOT IN($ct_states)"; - } - else - { - $ct_statesSQL = ""; - } - - $r=0; - $default_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday lokale Zeit - { - if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday lokale Zeit - { - if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday lokale Zeit - { - if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday lokale Zeit - { - if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday lokale Zeit - { - if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday lokale Zeit - { - if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday lokale Zeit - { - if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - - $default_gmt = "$default_gmt'99'"; - $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; - - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL"; - #$DB=1; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rslt_rows = mysql_num_rows($rslt); - if ($rslt_rows) - { - $rowx=mysql_fetch_row($rslt); - $active_leads = "$rowx[0]"; - } - else {$active_leads = '0';} - - echo "Diese Kampagne hat$active_leads führt, in jenen Listen gewählt zu werden\n"; - } - else - { - echo "Keine aktiven Listen für diese Kampagne gewählt\n"; - } - } -else - { - echo "Keine aktiven Listen für diese Kampagne gewählt\n"; - } -##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### -} -?> diff --git a/LANG_admin/vicidial_de/admin_modify_lead.php b/LANG_admin/vicidial_de/admin_modify_lead.php deleted file mode 100644 index d3fd2386..00000000 --- a/LANG_admin/vicidial_de/admin_modify_lead.php +++ /dev/null @@ -1,476 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} - elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} -if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} - elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} -if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} - elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} - elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead - -# CHANGES -# -# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user -# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60609-1112 - Added DNC list addition if status changed to DNC -# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat -# - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Leitung notieren Änderung - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Informationen geändert

\n"; - echo "\n"; - - if ( ($dispo != $status) and ($dispo == 'CBHOLD') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - - if ( ($dispo != $status) and ($status == 'DNC') ) - { - ### add lead to the internal DNC list - $stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; - } - -} -else -{ - - if ($CBchangeUSERtoANY == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to ANYONE
\n"; - } - if ($CBchangeUSERtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record user changed to $CBuser
\n"; - } - if ($CBchangeANYtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; - } - - - - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Anrufinformationen: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     Liste Identifikation: $list_id
Vorname:   \n"; - echo " Letzter Name:
  \n"; - echo "Postcode:
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select * from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } - - - - - - - } - else - { - echo "Leitung Nachschlagen FIEL für lead_id aus $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - -echo "

\n"; - -echo "
\n"; - -echo "ANRUFE ZU DIESEM LEITUNG:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD
$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial_de/admin_search_lead.php b/LANG_admin/vicidial_de/admin_search_lead.php deleted file mode 100644 index 26e58758..00000000 --- a/LANG_admin/vicidial_de/admin_search_lead.php +++ /dev/null @@ -1,224 +0,0 @@ - LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php -# -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead -# -# changes: -# 60620-1055 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - Changed results to multi-record -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Leitung Suche - -Leitung Nachschlagen - - - -
\n"; - echo "
\n"; - echo "\n"; - echo "Tragen Sie bitte a ein:
Vendor ID(Verkäuferleitung Code): or \n"; - echo "
eine Haupttelefonnummer: or\n"; - echo "
eine Leitung Identifikation:

\n"; - echo "
\n"; - echo "\n
\n"; - echo "\n"; - exit; - } - -else - { - - if ($vendor_id) - { - $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000"; - } - else - { - if ($phone) - { - $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000"; - } - else - { - if ($lead_id) - { - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000"; - } - else - { - print "ERROR: you must search for something! Go back and search for something"; - exit; - } - } - } - if ($DB) - { - echo "\n\n$stmt\n\n"; - } - - $rslt=mysql_query($stmt, $link); - $results_to_print = mysql_num_rows($rslt); - if ($results_to_print < 1) - { - echo date("l F j, Y G:i:s A"); - echo "\n

\n"; - echo "Die Suchvariablen, die Sie eintrugen, sind nicht im System aktiv

\n"; - echo "Bitte zurück und verdoppeln Überprüfung gehen die Informationen,die Sie eintrugen und reichen wieder ein\n"; - echo "
\n"; - echo "\n"; - exit; - } - else - { - echo "RESULTS: $results_to_print

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $o=0; - while ($results_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $o++; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "
#LEAD IDSTATUSVENDOR IDLAST AGENTLISTE IDENTIFIKATIONPHONENAMECITYSECURITYLAST CALL
$o$row[0]$row[3]$row[5]$row[4]$row[7]$row[11]$row[13] $row[15]$row[19]$row[28]$row[2]
\n"; - } - } - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\nNEUE SUCHE"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds"; - - -?> - - - - - diff --git a/LANG_admin/vicidial_de/count.htm b/LANG_admin/vicidial_de/count.htm deleted file mode 100644 index 51f8a361..00000000 --- a/LANG_admin/vicidial_de/count.htm +++ /dev/null @@ -1 +0,0 @@ - diff --git a/LANG_admin/vicidial_de/dbconnect.php b/LANG_admin/vicidial_de/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_admin/vicidial_de/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_admin/vicidial_de/group_hourly_stats.php b/LANG_admin/vicidial_de/group_hourly_stats.php deleted file mode 100644 index 954f159c..00000000 --- a/LANG_admin/vicidial_de/group_hourly_stats.php +++ /dev/null @@ -1,252 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1014 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];} - elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$date_with_hour_default = date("Y-m-d H"); -$date_no_hour_default = $TODAY; - -if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} - $date_no_hour = $date_with_hour; - $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - -# $stmt="SELECT full_name from vicidial_users where user='$user';"; -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: Gruppe Stündlicher Notfall -\n"; -?> - - -
- - - - - -= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDtotal[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDday[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDcount[$o] = "$row[0]"; - $o++; - } - -echo "
  VICIDIAL ADMIN: Gruppe Stündlicher Notfall  
\n"; - -echo "
\n"; - -echo "TSR STUNDE ZÄHLIMPULSE: $group | $status | $date_with_hour | $date_no_hour\n"; - -echo "
\n"; -echo "\n"; - - $day_calls=0; - $hour_calls=0; - $total_calls=0; - $o=0; - while($o < $tsrs_to_print) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $VDtotal[$o]); - $hour_calls = ($hour_calls + $VDcount[$o]); - $day_calls = ($day_calls + $VDday[$o]); - - $o++; - } - -echo "\n"; - - -} - -echo "
TSR ID   $status   GESAMTANRUFE   $status DAY    
$VDuser[$o] $VDname[$o] $VDcount[$o] $VDtotal[$o] $VDday[$o]ÄNDERN Sie | Notfall
TOTAL $status $hour_calls $total_calls $day_calls
\n"; -echo "

\n"; - - - echo "
Melden Sie bitte die Gruppe an, die Sie stündlichen Notfall fürerhalten möchten:
\n"; - echo "\n"; - echo "group:
\n"; - echo "status:   (example: XFER)
\n"; - echo "date with hour:   (example: 2004-06-25 14)
\n"; - echo "\n"; - echo "


\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_de/help.gif b/LANG_admin/vicidial_de/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/vicidial_de/help.gif and /dev/null differ diff --git a/LANG_admin/vicidial_de/listloader.php b/LANG_admin/vicidial_de/listloader.php deleted file mode 100644 index 877ab1a4..00000000 --- a/LANG_admin/vicidial_de/listloader.php +++ /dev/null @@ -1,698 +0,0 @@ - LICENSE: GPLv2 -# -# AST Web GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1006 - added listID override and gmt_offset lookup while loading -# 60619-1652 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -# - -$version = '1.1.12'; -$build = '60619-1652'; - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];} -$list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - - -#$DB=1; -#$DBX=1; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('listloader.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HILFE\""; - - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -?> - - - - - - method=post enctype="multipart/form-data"> -
- - - - - - - - - - - - - -
Last Leitungen von dieser Akte:
Liste Identifikation Override: (nur Zahlen or leave blank for values in the file)
KLICKEN SIE HIER, UM ZUR SUPERLEITUNG LADEVORRICHTUNG ZU GEHEN (BETA VERSION)     ZURÜCK ZU ADMIN
- -document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - $pulldate=date("Y-m-d H:i:s"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("./vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Verarbeitung$delim_name-delimited file... ($tab_count|$pipe_count)\n"; - - if (strlen($list_id_override)>0) - { - print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city = $row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) - { - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $gmt_offset = '0'; - $called_since_last_reset='N'; - - if (strlen($list_id_override)>0) - { - # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =='1') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### MEXICO ### - if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### AUSTRALIA ### - if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
STÖRUNG: Die Akte hat nicht die erforderliche Zahl vonauffängt, um sie zu verarbeiten.
"; - } - print ""; -} else if (filesize($leadfile)>8388608) { - print "
STÖRUNG: Akte übersteigt die Begrenzung 8MB.
"; -} -?> - - diff --git a/LANG_admin/vicidial_de/listloaderMAIN.php b/LANG_admin/vicidial_de/listloaderMAIN.php deleted file mode 100644 index dc41a8b0..00000000 --- a/LANG_admin/vicidial_de/listloaderMAIN.php +++ /dev/null @@ -1,79 +0,0 @@ - LICENSE: GPLv2 -# -# this is the main frame page for the lead loading section. This is where you -# would upload a file and have it inserted into vicidial_list -# -# changes: -# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - -VICIDIAL: Leitung Ladevorrichtung Modul - - - - - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/new_listloader_superL.php b/LANG_admin/vicidial_de/new_listloader_superL.php deleted file mode 100644 index 2eb6171b..00000000 --- a/LANG_admin/vicidial_de/new_listloader_superL.php +++ /dev/null @@ -1,1364 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60113-1603 - Fixed a few bugs in Excel import -# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1240 - added listID override -# 60616-1604 - added gmt lookup for each lead -# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. - -$version = '1.1.12-1'; -$build = '60619-1651'; - - -require("dbconnect.php"); - -### links used for testing -#$link=mysql_connect("10.10.10.15", "cron", "1234"); -#mysql_select_db("asterisk"); -#$WeBServeRRooT = '/home/www/htdocs'; - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} - elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} - elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} -if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} - elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} -if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} - elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} -if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} - elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} -if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} - elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} -if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} - elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} -if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} - elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} -if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} - elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} -if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} - elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} -if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} - elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} -if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} - elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} -if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} - elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} -if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} - elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} -if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} - elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} -if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} - elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} -if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} - elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} -if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} - elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} -if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} - elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} -if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} - elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} -if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} - elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} -if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} - elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} -if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} - elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} -if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} - elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} -if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} - elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} -if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} - elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} -if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} - elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} -if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} - elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); - -# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HILFE\""; - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -function macfontfix($fontsize) { - - $browser = getenv("HTTP_USER_AGENT"); - $pctype = explode("(", $browser); - if (ereg("Mac",$pctype[1])) { - /* Browser is a Mac. If not Netscape 6, raise fonts */ - - $blownbrowser = explode('/', $browser); - $ver = explode(' ', $blownbrowser[1]); - $ver = $ver[0]; - if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); - - } else return $fontsize; /* Browser is not a Mac - don't touch fonts */ -} - -echo "\n"; - -?> - - - -VICIDIAL ADMIN: Super Lead Loader - - -
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - - - - - - - - - - - - - - - - - - - - -
Last Leitungen von dieser Akte:
Liste Identifikation Override: (nur Zahlen or leave blank for values in the file)
Zu verwenden Dateiaufbau:Standard-VICIDIAL    Kundenspezifischer Plan
        
KLICKEN SIE HIER, UM ZUR BASIC LEITUNG LADEVORRICHTUNG ZU GEHEN         ZURÜCK ZU ADMIN
SUPERLISTE LADEVORRICHTUNG-     VERSION:     BAU:
- - -document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - $total=0; $good=0; $bad=0; - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Verarbeitung$delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - - if (strlen($list_id_override)>0) - { - # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
STÖRUNG: Die Akte hat nicht die erforderliche Zahl vonauffängt, um sie zu verarbeiten.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - print "
VerarbeitungExcel file... \n"; - if (strlen($list_id_override)>0) - { - print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

\n"; - } - # print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override"); - } else { - # copy($leadfile, "./vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
VerarbeitungCSV file... \n"; - if (strlen($list_id_override)>0) - { - print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - } - print ""; - } - -if ($leadfile && filesize($LF_path)<=8388608) { - $total=0; $good=0; $bad=0; - if ($file_layout=="standard") { - - print ""; - flush(); - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Verarbeitung$delim_name-delimited file... ($tab_count|$pipe_count)\n"; - if (strlen($list_id_override)>0) - { - print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - } - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
STÖRUNG: Die Akte hat nicht die erforderliche Zahl vonauffängt, um sie zu verarbeiten.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
VerarbeitungCSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } - print ""; - - } else { - print "
"; - flush(); - print "\r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Verarbeitung$delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - } - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
VerarbeitungCSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - $total=0; $good=0; $bad=0; - $row=fgetcsv($file, 1000, ","); - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print "
VICIDIAL SpalteAkte Daten
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
        
\r\n"; - # } - print ""; - } -} else if (filesize($leadfile)>8388608) { - print "
STÖRUNG: Akte übersteigt die Begrenzung 8MB.
"; -} -?> - - - - - - - - - 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### MEXICO ### -if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### AUSTRALIA ### -if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### ALL OTHER COUNTRY CODES ### -if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - -### Find out if DST to raise the gmt offset ### -$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); -$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - -$AC_processed=0; -if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # lokale Zeit calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } -if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - -return $gmt_offset; -} \ No newline at end of file diff --git a/LANG_admin/vicidial_de/remote_dispo.php b/LANG_admin/vicidial_de/remote_dispo.php deleted file mode 100644 index 01d5eb2d..00000000 --- a/LANG_admin/vicidial_de/remote_dispo.php +++ /dev/null @@ -1,327 +0,0 @@ - LICENSE: GPLv2 -### -# this is the remote agent disposition screen for calls sent to remote agents. This allows the remote agent to modify customer information and disposition the call - -# CHANGES -# -# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat -# - - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -VICIDIAL DIREKTÜBERTRAGUNG: Anruf-Einteilung -\n"; -?> - - -
- -"; - -if ($end_call > 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Anruf ist dispositioned gewesen       $NOW_TIME\n

\n"; - - echo "
\n"; - -} -else -{ - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Anrufinformationen: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Kampagne Identifikation: $campaign_id
Fronter: $tsr     Liste Identifikation: $list_id
Vorname:   \n"; - echo " Letzter Name:
  \n"; - echo "Postcode:
\n"; - echo "


\n"; - - } - else - { - echo "Leitung Nachschlagen FIEL für lead_id aus $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial_de/server_stats.php b/LANG_admin/vicidial_de/server_stats.php deleted file mode 100644 index eede94e1..00000000 --- a/LANG_admin/vicidial_de/server_stats.php +++ /dev/null @@ -1,96 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: Bediener-Notfall and Reports -VICIDIAL: Bediener-Notfall and Reports                           -ZURÜCK ZU ADMIN

- - -

-
- $o)
-	{
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	$o++;
-	}
-
-?>
-
SERVERBESCHREIBUNGIP ADDRESSAKTIVVDAD timeVDcall timePARK timeCLOSER/INBOUND time
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_de/user_stats.php b/LANG_admin/vicidial_de/user_stats.php deleted file mode 100644 index a32851eb..00000000 --- a/LANG_admin/vicidial_de/user_stats.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: User Stats -\n"; -?> - - -
- - - - - -\n"; -echo "
  VICIDIAL ADMIN: User Stats for  
  \n"; - -echo "
\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - -echo "
\n"; - -echo "GESPRÄCH ZEIT UND STATUS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - -echo "\n"; -echo "
STATUSZÄHLIMPULSHOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
GESAMTANRUFE $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LOGIN/LOGOUT ZEIT:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); - $event_minutes = ($event_hours - $event_hours_int); - $event_minutes = ($event_minutes * 60); - $event_minutes_int = round($event_minutes, 0); - if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - } - - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - -$total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); -$total_login_minutes = ($total_login_hours - $total_login_hours_int); -$total_login_minutes = ($total_login_minutes * 60); -$total_login_minutes_int = round($total_login_minutes, 0); -if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} - -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "
FALL DATUM KAMPAGNEHOURS:MINUTES
$row[0] $row[2] $row[3]
$row[0] $row[2] $row[3] $event_hours_int:$event_minutes_int
$row[0] $row[2] $row[3]
GESAMTMENGE $total_login_hours_int:$total_login_minutes_int
\n"; - - -echo "

\n"; - -echo "
\n"; - -echo "ANRUFE DES LETZT-50:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS PHONE KAMPAGNE LIST LEAD
$row[4] $row[7] $row[8] $row[10] $row[3] $row[2] $row[1]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_de/user_status.php b/LANG_admin/vicidial_de/user_status.php deleted file mode 100644 index b92d57bb..00000000 --- a/LANG_admin/vicidial_de/user_status.php +++ /dev/null @@ -1,238 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $change_agent_campaign=$row[1]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - $stmt="SELECT * from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $agents_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $agents_to_print) - { - $row=mysql_fetch_row($rslt); - $Aserver_ip = $row[2]; - $Asession_id = $row[3]; - $Aextension = $row[4]; - $Astatus = $row[5]; - $Acampaign = $row[7]; - $Alast_call = $row[14]; - $Acl_campaigns = $row[15]; - $i++; - } - - } - -$stmt="select * from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - - - -?> - - -VICIDIAL ADMIN: User Status -\n"; -?> - - -
-
- - - - -\n"; -echo "
  VICIDIAL ADMIN: User Status for  
  \n"; - -if ($stage == "live_campaign_change") -{ - $stmt="UPDATE vicidial_live_agents set campaign_id='" . mysql_real_escape_string($group) . "' where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name changed to $group campaign
\n"; - - exit; -} - -if ($stage == "log_agent_out") -{ - $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser
\n"; - - exit; -} - -if ($agents_to_print > 0) -{ - echo "
";
-	echo "Agent Logged in at server:  $Aserver_ip\n";
-	echo "               in session:  $Asession_id\n";
-	echo "               from phone:  $Aextension\n";
-	echo "Agent is in campaign:       $Acampaign\n";
-	echo "              status:       $Astatus\n";
-	echo " hungup last call at:       $Alast_call\n";
-	echo "       Closer groups:       $Acl_campaigns\n\n";
-
-	echo "
"; - - - if ($change_agent_campaign > 0) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "Current Kampagne: \n"; - echo "
\n"; - - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - } -} - -else -{ - echo "Agent is not logged in\n
"; - -} - - -echo "           $user - $full_name - \n"; - -echo "VICIDIAL Time Sheet\n"; - -echo "
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - -echo "|$stage|$group|"; - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_de/vdremote.php b/LANG_admin/vicidial_de/vdremote.php deleted file mode 100644 index 58bcd035..00000000 --- a/LANG_admin/vicidial_de/vdremote.php +++ /dev/null @@ -1,602 +0,0 @@ - LICENSE: GPLv2 -# -# Changes -# 50307-1721 - First version -# 51123-1502 - removed requirement of PHP Globals=on -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time - -$version = '1.1.12'; -$build = '60619-1603'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($force_logout)) {$force_logout = 0;} - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Sie haben jetzt heraus geloggt. Danke\n"; - exit; -} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$popup_page = './closer_popup.php'; -$STARTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Unzulässiges Username/Kennwort:|$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - $stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $authx=$row[0]; - - if($authx>0) - { - $stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id=$row[0]; - $server_ip=$row[1]; - if (!$number_of_lines) {$number_of_lines=$row[2];} - - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; - exit; - } - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -if ($ADD==61111) - { - echo"\n"; - } -echo "\n"; -?> - -VICIDIAL DIREKTÜBERTRAGUNG MITTEL: $LOGfullname - $PHP_AUTH_USER "; - -if (!$ADD) {$ADD="31111";} -if ($ADD==31111) {echo "Ändern Sie Remotemittel";} -if ($ADD==41111) {echo "Ändern Sie Remotemittel";} -if ($ADD==61111) {echo "Remote Agent Status";} -if ($ADD==71111) {echo "Remote Agent Closer Stats";} - - -if (strlen($ADD)>4) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "2) {$groups_value .= " -";} - } - -?> - - - -
-
- - - -
  VICIDIAL DIREKTÜBERTRAGUNG MITTEL:   Logout  
  ÄNDERN Sie | ">STATUS | ">INBOUND NOTFALL
-"; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
ÄNDERN Sie Eine REMOTEMITTEL-EINTRAGUNG: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Benutzernummer Anfang: $user_start
Zeilenzahl: (nur Zahlen)
Bediener IP: $row[3]
Externe Verlängerung: (number dialed to reach agents [i.e. 913125551212])
Status:
Kampagne: $campaign_id
Inbound Gruppen: \n"; -echo "$groups_list"; -echo "
\n"; -echo "ANMERKUNG: Sie kann bis 30 Sekunden für die Änderungen dauern, dieauf diesem Schirm eingereicht werden, um Phasen zu gehen\n"; - -} - - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) - {echo "
REMOTEMITTEL NICHT GEÄNDERT - gehen Sie bitte zurück und betrachtenSie die Daten, die Sie eingaben\n";} - else - { - $stmt="UPDATE vicidial_remote_agents set number_of_lines='" . mysql_real_escape_string($number_of_lines) . "', conf_exten='" . mysql_real_escape_string($conf_exten) . "', status='" . mysql_real_escape_string($status) . "', closer_campaigns='" . mysql_real_escape_string($groups_value) . "' where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - -# echo "$stmt\n"; - echo "
REMOTEMITTEL GEÄNDERT\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTEMITTEL ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - - } - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
ÄNDERN Sie Eine REMOTEMITTEL-EINTRAGUNG: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Benutzernummer Anfang: $user_start
Zeilenzahl: (nur Zahlen)
Bediener IP: $row[3]
Externe Verlängerung: (number dialed to reach agents [i.e. 913125551212])
Status:
Kampagne: $campaign_id
Inbound Gruppen: \n"; -echo "$groups_list"; -echo "
\n"; -echo "ANMERKUNG: Sie kann bis 30 Sekunden für die Änderungen dauern, dieauf diesem Schirm eingereicht werden, um Phasen zu gehen\n"; - -} - - - - -###################### -# ADD=61111 status of remote agent in the system and active calls and queue -###################### - -if ($ADD==61111) -{ - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTEMITTEL-STÖRUNG - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'" . mysql_real_escape_string($nextuser) . "',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - echo "VICIDIAL: Remote Agent Time On Calls $NOW_TIME\n\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $leadlink=0; - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[3]=''; - $row[5]='- WARTEND -'; - $row[6]=$row[7]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $leadid = sprintf("%-12s", $row[2]); - if ($row[2] > 0) - { - $leadidLINK=$row[2]; - $leadlink++; - if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;} - $leadid = "$leadid"; - } - $channel = sprintf("%-10s", $row[3]); - $cc=0; - while ( (strlen($channel) > 10) and ($cc < 100) ) - { - $channel = eregi_replace(".$","",$channel); - $cc++; - if (strlen($channel) <= 10) {$cc=101;} - } - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = ($STARTtime - $row[6]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} - if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo " $i Mittel geloggt innen auf Bediener $server_ip\n\n"; - - echo " - 5 Minuten oder mehr beim Anruf\n"; - echo " - Über 10 Minuten beim Anruf\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "*********************************KEINE MITTEL BEI DEN ANRUFEN*********************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - -###################### -# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log) -###################### - -if ($ADD==71111) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTEMITTEL-STÖRUNG - gehen Sie bitte zurück und betrachten Sie dieDaten, die Sie eingaben\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'$nextuser',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $in_calls = $row[0]; - $in_time = $row[1]; - $in_time_M = ($in_time / 60); - $in_time_M = round($in_time_M, 2); - $in_time_M_int = intval("$in_time_M"); - $in_time_SEC = ($in_time_M - $in_time_M_int); - $in_time_SEC = ($in_time_SEC * 60); - $in_time_SEC = round($in_time_SEC, 0); - if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";} - $in_time_MS = "$in_time_M_int:$in_time_SEC"; - $in_time_MS = sprintf("%7s", $in_time_MS); - - echo "VICIDIAL: Inbound Notfall des Remotemittels $NOW_TIME\n\n"; - echo "\n"; - echo "Gesamtanrufe genommen$query_date: $in_calls\n"; - echo "Gesamtgespräch Zeit an$query_date: $in_time_MS (minutes:seconds)\n"; - echo "\n"; - echo "\n"; - echo "Anrufliste für$query_date:\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - $user = sprintf("%-8s", $row[0]); - $leadid = sprintf("%-10s", $row[1]); - $group = sprintf("%-14s", $row[2]); - $phone = sprintf("%-10s", $row[3]); - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = $row[6]; - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - # if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - # echo " $i Mittel geloggt innen auf Bediener $server_ip\n\n"; - - # echo " - 5 Minuten oder mehr beim Anruf\n"; - # echo " - Über 10 Minuten beim Anruf\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "*********************************KEIN ERSUCHT UM DIESEN TAG*******************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nIndexlaufzeit: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_el/AST_CLOSERstats.php b/LANG_admin/vicidial_el/AST_CLOSERstats.php deleted file mode 100644 index b8f2479e..00000000 --- a/LANG_admin/vicidial_el/AST_CLOSERstats.php +++ /dev/null @@ -1,396 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select group_id from vicidial_inbound_groups;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Στατιστικά VDAD Closer\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "ΠΑΡΑΚΑΛΩ ΕΠΙΛΕΞΤΕ ΜΙΑ ΕΚΣΤΡΑΤΕΙΑ ΚΑΙ ΜΙΑ ΗΜΕΡΟΜΗΝΙΑ ΑΝΩΤΕΡΩ, ΚΑΙ ΠΑΤΗΣΤΕ ΕΠΙΒΕΒΑΙΩΣΗ\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Στατιστικά αυτόματης κλήσης Closer                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Συνολικά κλήσεις που τοποθετήθηκαν από την Εκστρατεία: $TOTALcalls\n";
-echo "Μέσος όρος σε δευτερόλεπτα για όλες τις κλήσεις: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- ΕΓΚΑΤΑΛ\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Συνολικά ΕΓΚΑΤΑΛΕΙΜΕΝΕΣ κλήσεις: $DROPcalls  $DROPpercent%\n";
-echo "Μέσος όρος σε δευτερόλεπτα για ΕΓΚΑΤΑΕΙΜΕΝΕΣ κλήσεις: $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- ΣΤΑΤΙΣΤΙΚΑ ΧΡΗΣΤΗ\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| ΧΡΗΣΤΗΣ                  | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- ΣΤΑΤΙΣΤΙΚΑ ΧΡΟΝΟΥ\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ ΠΟΥ ΤΟΠΟΘΕΤΟΥΝΤΑΙ ΑΠΟ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/AST_VDADstats.php b/LANG_admin/vicidial_el/AST_VDADstats.php deleted file mode 100644 index c94aa544..00000000 --- a/LANG_admin/vicidial_el/AST_VDADstats.php +++ /dev/null @@ -1,417 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "ΠΑΡΑΚΑΛΩ ΕΠΙΛΕΞΤΕ ΜΙΑ ΕΚΣΤΡΑΤΕΙΑ ΚΑΙ ΜΙΑ ΗΜΕΡΟΜΗΝΙΑ ΑΝΩΤΕΡΩ, ΚΑΙ ΠΑΤΗΣΤΕ ΕΠΙΒΕΒΑΙΩΣΗ\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Συνολικά κλήσεις που τοποθετήθηκαν από την Εκστρατεία: $TOTALcalls\n";
-echo "Μέσος όρος σε δευτερόλεπτα για όλες τις κλήσεις: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- ΕΓΚΑΤΑΛ\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Συνολικά ΕΓΚΑΤΑΛΕΙΜΕΝΕΣ κλήσεις: $DROPcalls  $DROPpercent%\n";
-echo "Μέσος όρος σε δευτερόλεπτα για ΕΓΚΑΤΑΕΙΜΕΝΕΣ κλήσεις: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- ΜΗ ΑΠΑΝΤΗΜΕΝΕΣ ΑΥΤΟΜΑΤΕΣ ΚΛΗΣΕΙΣ\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='NA' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$NAcalls =	sprintf("%10s", $row[0]);
-$NApercent = (($NAcalls / $TOTALcalls) * 100);
-$NApercent = round($NApercent, 0);
-
-$average_na_seconds = ($row[1] / $row[0]);
-$average_na_seconds = round($average_na_seconds, 0);
-$average_na_seconds =	sprintf("%10s", $average_na_seconds);
-
-echo "Συνολικά ΝΑ κλήσεις -Busy,Disconnect,BTvoicemail: $NAcalls  $NApercent%\n";
-echo "Μέσος όρος σε δευτερόλεπτα για ΝΑ κλήσεις: $average_na_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- ΣΤΑΤΙΣΤΙΚΑ ΧΡΗΣΤΗ\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| ΧΡΗΣΤΗΣ                  | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- ΣΤΑΤΙΣΤΙΚΑ ΧΡΟΝΟΥ\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "ΓΡΑΦΙΚΗ ΠΑΡΑΣΤΑΣΗ ΜΕ 15ΛΕΠΤΕΣ ΑΥΞΗΣΕΙΣ ΤΩΝ ΣΥΝΟΛΙΚΩΝ ΚΛΗΣΕΩΝ ΠΟΥ ΤΟΠΟΘΕΤΟΥΝΤΑΙ ΑΠΟ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/AST_VICIDIAL_hopperlist.php b/LANG_admin/vicidial_el/AST_VICIDIAL_hopperlist.php deleted file mode 100644 index 015b382b..00000000 --- a/LANG_admin/vicidial_el/AST_VICIDIAL_hopperlist.php +++ /dev/null @@ -1,161 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.10.15';} - -$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $campaign_id[$i] =$row[0]; - $campaign_name[$i] =$row[1]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Λίστα Hopper\n"; -echo "
\n"; -#echo "\n"; -#echo "\n"; -echo "\n"; -echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "ΠΑΡΑΚΑΛΩ ΕΠΙΛΕΞΤΕ ΜΙΑ ΕΚΣΤΡΑΤΕΙΑ ΑΝΩΤΕΡΩ ΚΑΙ ΠΑΤΗΣΤΕ ΕΠΙΒΕΒΑΙΩΣΗ\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Ενεργή Λίστα στον Hopper                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-
-echo "Αριθμός οδηγών στον hopper τώρα::       $TOTALcalls\n";
-
-
-##############################
-#########  LEAD STATS
-
-echo "\n";
-echo "---------- LEADS IN HOPPER\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-echo "|      | LEAD_ID   | PHONE NUM  | STATE | STATUS | COUNT | GMT    |\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$FMT_i =		sprintf("%-4s", $i);
-	$lead_id =		sprintf("%-9s", $row[0]);
-	$phone_number =	sprintf("%-10s", $row[1]);
-	$state =		sprintf("%-5s", $row[2]);
-	$status =		sprintf("%-6s", $row[3]);
-	$count =		sprintf("%-5s", $row[4]);
-	$gmt =			sprintf("%-6s", $row[5]);
-
-	echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt |\n";
-
-	$i++;
-	}
-
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/AST_admin_log_display.php b/LANG_admin/vicidial_el/AST_admin_log_display.php deleted file mode 100644 index aab85960..00000000 --- a/LANG_admin/vicidial_el/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "ΔΙΑΧΕΙΡΙΣΗ LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-echo "ΔΙΑΧΕΙΡΙΣΗ CHANGE LOG                             $NOW_TIME\n";
-
-#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
-passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/AST_agent_performance.php b/LANG_admin/vicidial_el/AST_agent_performance.php deleted file mode 100644 index 5ddd508c..00000000 --- a/LANG_admin/vicidial_el/AST_agent_performance.php +++ /dev/null @@ -1,232 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Agent Performance\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A ΔΙΑΚΟΜΙΣΤΗΣ AND DATE-TIME ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:33:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:33:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:33:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:33:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_el/AST_agent_performance_detail.php b/LANG_admin/vicidial_el/AST_agent_performance_detail.php
deleted file mode 100644
index b342c85f..00000000
--- a/LANG_admin/vicidial_el/AST_agent_performance_detail.php
+++ /dev/null
@@ -1,406 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]))				{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))		{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($group)) {$group = '';}
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-$stmt="select campaign_id from vicidial_campaigns;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$campaigns_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $campaigns_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 03:45:00";   
-	$query_date_END = "$query_date 15:15:00";
-	$time_BEGIN = "03:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:15:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$TOTtotWAIT=($TOTtotWAIT + $row[7]);
-	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
-	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-	$USERtotPAUSE =	$row[5];
-	$USERavgPAUSE =	$row[6];
-	$USERtotWAIT =	$row[7];
-	$USERavgWAIT =	$row[8];
-	$USERtotDISPO =	$row[9];
-	$USERavgDISPO =	$row[10];
-
-	$USERtime_M = ($USERtime / 60);
-	$USERtime_M = round($USERtime_M, 2);
-	$USERtime_M_int = intval("$USERtime_M");
-	$USERtime_S = ($USERtime_M - $USERtime_M_int);
-	$USERtime_S = ($USERtime_S * 60);
-	$USERtime_S = round($USERtime_S, 0);
-	if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
-	$USERtime_MS = "$USERtime_M_int:$USERtime_S";
-	$pfUSERtime_MS[$i] =		sprintf("%7s", $USERtime_MS);
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-
-	$USERtotPAUSE_M = ($USERtotPAUSE / 60);
-	$USERtotPAUSE_M = round($USERtotPAUSE_M, 2);
-	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M");
-	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
-	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
-	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
-	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
-	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
-	$pfUSERtotPAUSE_MS[$i] =		sprintf("%6s", $USERtotPAUSE_MS);
-
-	$USERavgPAUSE_M = ($USERavgPAUSE / 60);
-	$USERavgPAUSE_M = round($USERavgPAUSE_M, 2);
-	$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M");
-	$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
-	$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
-	$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
-	if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
-	$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
-	$pfUSERavgPAUSE_MS[$i] =		sprintf("%6s", $USERavgPAUSE_MS);
-
-	$USERtotWAIT_M = ($USERtotWAIT / 60);
-	$USERtotWAIT_M = round($USERtotWAIT_M, 2);
-	$USERtotWAIT_M_int = intval("$USERtotWAIT_M");
-	$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
-	$USERtotWAIT_S = ($USERtotWAIT_S * 60);
-	$USERtotWAIT_S = round($USERtotWAIT_S, 0);
-	if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
-	$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
-	$pfUSERtotWAIT_MS[$i] =		sprintf("%6s", $USERtotWAIT_MS);
-
-	$USERavgWAIT_M = ($USERavgWAIT / 60);
-	$USERavgWAIT_M = round($USERavgWAIT_M, 2);
-	$USERavgWAIT_M_int = intval("$USERavgWAIT_M");
-	$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
-	$USERavgWAIT_S = ($USERavgWAIT_S * 60);
-	$USERavgWAIT_S = round($USERavgWAIT_S, 0);
-	if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
-	$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
-	$pfUSERavgWAIT_MS[$i] =		sprintf("%6s", $USERavgWAIT_MS);
-	
-	$USERtotDISPO_M = ($USERtotDISPO / 60);
-	$USERtotDISPO_M = round($USERtotDISPO_M, 2);
-	$USERtotDISPO_M_int = intval("$USERtotDISPO_M");
-	$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
-	$USERtotDISPO_S = ($USERtotDISPO_S * 60);
-	$USERtotDISPO_S = round($USERtotDISPO_S, 0);
-	if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
-	$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
-	$pfUSERtotDISPO_MS[$i] =		sprintf("%6s", $USERtotDISPO_MS);
-
-	$USERavgDISPO_M = ($USERavgDISPO / 60);
-	$USERavgDISPO_M = round($USERavgDISPO_M, 2);
-	$USERavgDISPO_M_int = intval("$USERavgDISPO_M");
-	$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
-	$USERavgDISPO_S = ($USERavgDISPO_S * 60);
-	$USERavgDISPO_S = round($USERavgDISPO_S, 0);
-	if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
-	$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
-	$pfUSERavgDISPO_MS[$i] =		sprintf("%6s", $USERavgDISPO_MS);
-
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]);	$TOT_CB = ($TOT_CB + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtime_M = ($TOTtime / 60);
-	$TOTtime_M = round($TOTtime_M, 2);
-	$TOTtime_M_int = intval("$TOTtime_M");
-	$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
-	$TOTtime_S = ($TOTtime_S * 60);
-	$TOTtime_S = round($TOTtime_S, 0);
-	if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
-	$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
-	$TOTtime_MS =		sprintf("%7s", $TOTtime_MS);
-		while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOTtotDISPO_M = ($TOTtotDISPO / 60);
-	$TOTtotDISPO_M = round($TOTtotDISPO_M, 2);
-	$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M");
-	$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
-	$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
-	$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
-	if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
-	$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
-	$TOTtotDISPO_MS =		sprintf("%7s", $TOTtotDISPO_MS);
-		while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
-
-	$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
-	$TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2);
-	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M");
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
-	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
-	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
-	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
-	$TOTtotPAUSE_MS =		sprintf("%7s", $TOTtotPAUSE_MS);
-		while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
-
-	$TOTtotWAIT_M = ($TOTtotWAIT / 60);
-	$TOTtotWAIT_M = round($TOTtotWAIT_M, 2);
-	$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M");
-	$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
-	$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
-	$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
-	if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
-	$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
-	$TOTtotWAIT_MS =		sprintf("%7s", $TOTtotWAIT_MS);
-		while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
-
-
-	$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);
-	$TOTavgTALK_M = round($TOTavgTALK_M, 2);
-	$TOTavgTALK_M_int = intval("$TOTavgTALK_M");
-	$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
-	$TOTavgTALK_S = ($TOTavgTALK_S * 60);
-	$TOTavgTALK_S = round($TOTavgTALK_S, 0);
-	if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
-	$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
-	$TOTavgTALK_MS =		sprintf("%6s", $TOTavgTALK_MS);
-		while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
-
-	$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);
-	$TOTavgDISPO_M = round($TOTavgDISPO_M, 2);
-	$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M");
-	$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
-	$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
-	$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
-	if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
-	$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
-	$TOTavgDISPO_MS =		sprintf("%6s", $TOTavgDISPO_MS);
-		while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
-
-	$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);
-	$TOTavgPAUSE_M = round($TOTavgPAUSE_M, 2);
-	$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M");
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
-	$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
-	if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
-	$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
-	$TOTavgPAUSE_MS =		sprintf("%6s", $TOTavgPAUSE_MS);
-		while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
-
-	$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);
-	$TOTavgWAIT_M = round($TOTavgWAIT_M, 2);
-	$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M");
-	$TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int);
-	$TOTavgWAIT_S = ($TOTavgWAIT_S * 60);
-	$TOTavgWAIT_S = round($TOTavgWAIT_S, 0);
-	if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";}
-	$TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S";
-	$TOTavgWAIT_MS =		sprintf("%6s", $TOTavgWAIT_MS);
-		while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
-
-	
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_CB = sprintf("%-5s", $TOT_CB);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_el/AST_agent_time_sheet.php b/LANG_admin/vicidial_el/AST_agent_time_sheet.php
deleted file mode 100644
index 75c707af..00000000
--- a/LANG_admin/vicidial_el/AST_agent_time_sheet.php
+++ /dev/null
@@ -1,281 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
-	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["calls_summary"]))				{$calls_summary=$_GET["calls_summary"];}
-	elseif (isset($_POST["calls_summary"]))		{$calls_summary=$_POST["calls_summary"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]))				{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))		{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN ΧΕΙΡΙΣΤΗΣID AND DATE-TIME ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
-echo " NOTE: stats taken from available agent log data\n";
-}
-
-else
-{
-$query_date_BEGIN = "$query_date 00:00:00";   
-$query_date_END = "$query_date 23:59:59";
-$time_BEGIN = "00:00:00";   
-$time_END = "23:59:59";
-
-$stmt="select full_name from vicidial_users where user='$agent';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$full_name = $row[0];
-
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- ΧΕΙΡΙΣΤΗΣTIME SHEET: $agent - $full_name -------------\n\n";
-
-if ($calls_summary)
-	{
-	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
-
-		$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣTAKEN: $row[0]\n";
-	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
-	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
-	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
-	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
-	echo "----------------------------------------------------------------\n";
-	echo "TOTAL ACTIVE ΧΕΙΡΙΣΤΗΣTIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_el/AST_server_performance.php b/LANG_admin/vicidial_el/AST_server_performance.php
deleted file mode 100644
index 0a266f00..00000000
--- a/LANG_admin/vicidial_el/AST_server_performance.php
+++ /dev/null
@@ -1,310 +0,0 @@
-    LICENSE: GPLv2
-#
-# CHANGES
-#
-# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
-if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]))				{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))	{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-# path from root to where ploticus files will be stored
-$DOCroot = "$WeBServeRRooT/vicidial/ploticus/";
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-if (!isset($group)) {$group = '';}
-
-$stmt="select server_ip from servers;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$servers_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $servers_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Server Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "             ΑΝΑΦΟΡΕΣ \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A ΔΙΑΚΟΜΙΣΤΗΣ AND DATE-TIME ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:32:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:32:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- TOTALS, PEAKS and AVERAGES\n";
-
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGload =	sprintf("%10s", $row[0]);
-$AVGchannels =	sprintf("%10s", $row[1]);
-
-$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGcpuUSER =	sprintf("%10s", $row[0]);
-$AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
-$AVGcpuIDLE =	sprintf("%10s", $row[2]);
-
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-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','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
-
-
-echo "Total Calls in/out on this server:        $TOTALcalls\n";
-echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
-echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
-echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
-echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
-
-echo "\n";
-echo "---------- LINE GRAPH:\n";
-
-
-
-##############################
-#########  Graph stats
-
-$DAT = '.dat';
-$HTM = '.htm';
-$PNG = '.png';
-$filedate = date("Y-m-d_His");
-$DATfile = "$group$query_date$shift$filedate$DAT";
-$HTMfile = "$group$query_date$shift$filedate$HTM";
-$PNGfile = "$group$query_date$shift$filedate$PNG";
-
-$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
-$DATfp = fopen ("$DOCroot/$DATfile", "a");
-
-$stmt="select DATE_FORMAT(start_time,'%H:%i:%s') as timex,sysload,processes,channels_total,live_recordings,cpu_user_percent,cpu_system_percent from server_performance where server_ip='" . mysql_real_escape_string($group) . "' and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' order by timex;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$row[5] = intval(($row[5] + $row[6]) * $HIGHmulti);
-	$row[6] = intval($row[6] * $HIGHmulti);
-	fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
-	$i++;
-	}
-fclose($DATfp);
-
-$rows_to_max = ($rows_to_print + 100);
-
-
-
-$HTMcontent  = '';
-$HTMcontent .= "#proc page\n";
-$HTMcontent .= "#if @DEVICE in png,gif\n";
-$HTMcontent .= "   scale: 0.6\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#endif\n";
-$HTMcontent .= "#proc getdata\n";
-$HTMcontent .= "file: $DOCroot/$DATfile\n";
-$HTMcontent .= "fieldnames: userproc sysproc time load processes channels\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc areadef\n";
-$HTMcontent .= "title: Server $group   $query_date_BEGIN to $query_date_END\n";
-$HTMcontent .= "titledetails: size=14  align=C\n";
-$HTMcontent .= "rectangle: 1 1 14 7\n";
-$HTMcontent .= "xscaletype: time hh:mm:ss\n";
-$HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
-$HTMcontent .= "stubformat: hh:mm:ssa\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc yaxis\n";
-$HTMcontent .= "stubs: inc 50\n";
-$HTMcontent .= "grid: color=yellow\n";
-$HTMcontent .= "gridskip: min\n";
-$HTMcontent .= "ticincrement: 100 1000\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: userproc\n";
-$HTMcontent .= "linedetails: color=purple width=.5\n";
-$HTMcontent .= "fill: lavender\n";
-$HTMcontent .= "legendlabel: user proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: sysproc\n";
-$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
-$HTMcontent .= "fill: dullyellow\n";
-$HTMcontent .= "legendlabel: system proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: load\n";
-$HTMcontent .= "linedetails: color=blue width=.5\n";
-$HTMcontent .= "legendlabel: load\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: processes\n";
-$HTMcontent .= "linedetails: color=red width=.5\n";
-$HTMcontent .= "legendlabel: processes\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: channels\n";
-$HTMcontent .= "linedetails: color=green width=.5\n";
-$HTMcontent .= "legendlabel: channels\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc legend\n";
-$HTMcontent .= "location: max-2 max\n";
-$HTMcontent .= "seglen: 0.2\n";
-$HTMcontent .= "\n";
-
-fwrite ($HTMfp, "$HTMcontent");
-fclose($HTMfp);
-
-
-passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
-
-sleep(1);
-
-echo "
\n"; -echo "\n"; -echo "\n"; - - -echo ""; - -} - - - -?> - - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/AST_timeonVDAD.php b/LANG_admin/vicidial_el/AST_timeonVDAD.php deleted file mode 100644 index 6414148b..00000000 --- a/LANG_admin/vicidial_el/AST_timeonVDAD.php +++ /dev/null @@ -1,255 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 60620-1040 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Χρόνος Χειριστών σε κλήσεις        $NOW_TIME    ΑΝΑΦΟΡΕΣ\n\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL    | STATUS | START TIME          | MINUTES |\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	$agentcount=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- ΑΝΑΜΟΝΗ -';
-			$row[6]=$row[7];
-			}
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$sessionid =		sprintf("%-9s", $row[2]);
-		$channel =			sprintf("%-10s", $row[3]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[4]);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 5) {$G=''; $EG='';}
-		if ($call_time_M_int >= 10) {$G=''; $EG='';}
-		if (eregi("PAUSED",$row[4])) 
-			{
-			if ($call_time_M_int >= 1) 
-				{$i++; continue;} 
-			else
-				{$G=''; $EG='';}
-			}
-
-		$agentcount++;
-		echo "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-		echo "  $agentcount Χειριστές συνδεμένοι στον διακομιστή $server_ip\n\n";
-
-		echo "             - Χειριστές σε παύση\n";
-		echo "             - 5 λεπτά ή παραπάνω σε κλήση\n";
-		echo "             - Πάνω από 10 λεπτά σε κλήση\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* ΚΑΝΕΝΑΣ ΧΕΙΡΙΣΤΗΣ ΣΕ ΚΛΗΣΕΙΣ*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-echo "| CHANNEL    | STATUS | CAMPAIGN | PHONE NUMBER       | START TIME          | MINUTES |\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-8s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-		echo "  $i κλήσεις που τοποθετήθηκαν στον διακομιστή $server_ip\n\n";
-
-		echo "             - ΑΝΑΜΟΝΗ ΕΝΕΡΓΗΣ ΚΛΗΣΗΣ\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "*******************************ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ*********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - diff --git a/LANG_admin/vicidial_el/AST_timeonVDAD_closer.php b/LANG_admin/vicidial_el/AST_timeonVDAD_closer.php deleted file mode 100644 index 07234545..00000000 --- a/LANG_admin/vicidial_el/AST_timeonVDAD_closer.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# CHANGES -# -# 60620-1037 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - -\n"; -echo " - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Χρόνος Χειριστών σε κλήσεις        $NOW_TIME    ΑΝΑΦΟΡΕΣ\n\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
-			}
-		$extension[$i] =		sprintf("%-10s", $row[0]);
-		$user[$i] =				sprintf("%-6s", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
-			$cc[$i]=0;
-		while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
-			{
-			$channel[$i] = eregi_replace(".$","",$channel[$i]);   
-			$cc[$i]++;
-			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
-			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
-			$cd[$i]=0;
-		while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
-			{
-			$start_time[$i] = eregi_replace("^.","",$start_time[$i]);   
-			$cd[$i]++;
-			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
-			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
-
-		$call_time_M[$i] = ($call_time_S[$i] / 60);
-		$call_time_M[$i] = round($call_time_M[$i], 2);
-		$call_time_M_int[$i] = intval("$call_time_M[$i]");
-		$call_time_SEC[$i] = ($call_time_M[$i] - $call_time_M_int[$i]);
-		$call_time_SEC[$i] = ($call_time_SEC[$i] * 60);
-		$call_time_SEC[$i] = round($call_time_SEC[$i], 0);
-		if ($call_time_SEC[$i] < 10) {$call_time_SEC[$i] = "0$call_time_SEC[$i]";}
-		$call_time_MS[$i] = "$call_time_M_int[$i]:$call_time_SEC[$i]";
-		$call_time_MS[$i] =		sprintf("%7s", $call_time_MS[$i]);
-		$i++;
-		}
-		$ext_count = $i;
-		$i=0;
-	while ($i < $ext_count)
-		{
-
-		$stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$camp_to_print = mysql_num_rows($rslt);
-		if ($camp_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$campaign = sprintf("%-12s", $row[0]);
-			$camp_color = $row[0];
-			}
-		else
-			{$campaign = 'DEAD        ';   	$camp_color = 'DEAD';}
-		if (eregi("READY|PAUSED|CLOSER",$status[$i]))
-			{$campaign = '            ';   	$camp_color = '';}
-
-		$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$xfer_to_print = mysql_num_rows($rslt);
-		if ($xfer_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$fronter = sprintf("%-6s", $row[0]);
-			}
-		else
-			{$fronter = '      ';}
-
-		$G = '';		$EG = '';
-		$G=""; $EG='';
-	#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
-	#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-
-		echo "| $G$extension[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-		echo "  $i Χειριστές συνδεμένοι στον διακομιστή $server_ip\n\n";
-
-	#	echo "             - 5 λεπτά ή παραπάνω σε κλήση\n";
-	#	echo "             - Πάνω από 10 λεπτά σε κλήση\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* ΚΑΝΕΝΑΣ ΧΕΙΡΙΣΤΗΣ ΣΕ ΚΛΗΣΕΙΣ*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-#echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-echo "| CHANNEL             | STATUS | CAMPAIGN     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-19s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 19) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 19) {$cc=101;}
-			}
-		$start_time =		sprintf("%-8s", $row[5]);
-			$cd=0;
-		while ( (strlen($start_time) > 8) and ($cd < 100) )
-			{
-			$start_time = eregi_replace("^.","",$start_time);   
-			$cd++;
-			if (strlen($start_time) <= 8) {$cd=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-12s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-		echo "  $i κλήσεις που τοποθετήθηκαν στον διακομιστή $server_ip\n\n";
-
-		echo "             - ΑΝΑΜΟΝΗ ΕΝΕΡΓΗΣ ΚΛΗΣΗΣ\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "*******************************ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ*********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/AST_timeonVDADall.php b/LANG_admin/vicidial_el/AST_timeonVDADall.php deleted file mode 100644 index ac70cbdc..00000000 --- a/LANG_admin/vicidial_el/AST_timeonVDADall.php +++ /dev/null @@ -1,349 +0,0 @@ - LICENSE: GPLv2 -# -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60511-1343 - Added leads and drop info at the top of the screen -# 60608-1539 - Fixed CLOSER tallies for active calls -# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -if (!isset($group)) {$group='';} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -$rslt=mysql_query($stmt, $link); -if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!isset($RR)) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if (!isset($reset_counter)) {$reset_counter=0;} -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Εκστρατεία: $group\n"; -echo "
\n"; -echo "VICIDIAL: Realtime Εκστρατεία: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$HOPlev = $row[8]; - -echo "
"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$VDhop = $row[0]; - -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
DIAL LEVEL:  $row[0]    STATUSES:  $row[1], $row[2], $row[3], $row[4], $row[5]     ORDER:  $row[6]     FILTER:  $row[7]    
HOPPER LEVEL:  $HOPlev     LEADS IN HOPPER:  $VDhop     DIALABLE LEADS:  $DAleads       TIME:
CALLS TODAY:  $callsTODAY     CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
"; - - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; - } -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo "ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Εκστρατεία: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | ΔΙΑΚΟΜΙΣΤΗΣ IP | CALL ΔΙΑΚΟΜΙΣΤΗΣ IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; - - $Aecho .= " - Χειριστές σε παύση\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " ΚΑΝΕΝΑΣ ΧΕΙΡΙΣΤΗΣ ΣΕ ΚΛΗΣΕΙΣ\n";
-	}
-
-?>
-
- - diff --git a/LANG_admin/vicidial_el/AST_timeonVDADall_SIPmonitor.php b/LANG_admin/vicidial_el/AST_timeonVDADall_SIPmonitor.php deleted file mode 100644 index 7bcf0cde..00000000 --- a/LANG_admin/vicidial_el/AST_timeonVDADall_SIPmonitor.php +++ /dev/null @@ -1,282 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$ΥΠΟΒΑΛΛΩ=$_GET["ΥΠΟΒΑΛΛΩ"]; if (!$ΥΠΟΒΑΛΛΩ) {$ΥΠΟΒΑΛΛΩ=$_POST["ΥΠΟΒΑΛΛΩ"];} - - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Εκστρατείας: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Εκστρατείας: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "                   \n"; -echo "STOP | GO \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='$group';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='$group' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='$group';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo "ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Εκστρατείας: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | ΚΕΝΤΡΙΚΟΣΥΠΟΛΟΓΙΣΤΉΣ IP | CALL ΚΕΝΤΡΙΚΟΣΥΠΟΛΟΓΙΣΤΉΣ IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='$group' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTERN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Χρήστες σε παύση\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " ΚΑΝΕΝΑΣ ΧΡΗΣΤΗΣ ΣΕ ΚΛΗΣΕΙΣ\n";
-	}
-
-?>
-
- - - - - - - diff --git a/LANG_admin/vicidial_el/AST_timeoncall.php b/LANG_admin/vicidial_el/AST_timeoncall.php deleted file mode 100644 index 7c648199..00000000 --- a/LANG_admin/vicidial_el/AST_timeoncall.php +++ /dev/null @@ -1,180 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΥΠΟΒΑΛΛΩ"])) {$ΥΠΟΒΑΛΛΩ=$_GET["ΥΠΟΒΑΛΛΩ"];} - elseif (isset($_POST["ΥΠΟΒΑΛΛΩ"])) {$ΥΠΟΒΑΛΛΩ=$_POST["ΥΠΟΒΑΛΛΩ"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Call\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Call                                          $NOW_TIME\n\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-echo "| STATION    | SESSIONID | CHANNEL   | NUMBER DIALED    | START TIME          | MINUTES |\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-
-$stmt="SELECT count(*) from live_sip_channels where server_ip='$server_ip';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="select extension from live_channels where server_ip='$server_ip';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$ext_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_zap_counter=0;
-	$sessions = '';
-	while ($i < $ext_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if (preg_match("/^8600/i",$row[0]))
-			{
-			$sessions .= "$row[0]|";
-			}
-		$i++;
-		}
-	$sessions = preg_replace("/\|$/",'',$sessions);
-
-	if ($DB) {echo "SESSIONS: -$sessions-\n";}
-
-	$stmt="select * from live_sip_channels where server_ip='$server_ip' order by channel;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_calls_counter=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ( (preg_match("/Zap\/|internal|ring/i",$row[3])) or (preg_match("/Local\//i",$row[0])) )
-			{
-			if ($DB) {echo "NOT STATION |$row[0]|$row[3]|\n";}
-			$session_id = '';
-			}
-		else 
-			{
-			if (preg_match("/$row[3]/i",$sessions))
-				{
-				if ($DB) {echo "LIVE STATION|$row[0]|$row[3]|\n";}
-				$session_id = $row[3];
-				$station = preg_replace("/SIP\//",'',$row[0]);
-				$station = preg_replace("/-.*/",'',$station);
-			
-				$LIVE_sessions[$live_calls_counter] =			"$session_id";
-				$LIVE_sessions_FORMAT[$live_calls_counter] =	sprintf("%-9s", $session_id);
-				$LIVE_stations[$live_calls_counter] =			"$station";
-				$LIVE_stations_FORMAT[$live_calls_counter] =	sprintf("%-10s", $station);
-
-		#		echo "| $station | $session_id | \n";
-
-				$live_calls_counter++;
-				}
-			else
-				{
-				if ($DB) {echo "NOT STATIONZ|$row[0]|$row[3]|\n";}
-				$session_id = '';
-				}
-			}
-
-		$i++;
-		}
-
-		if ($live_calls_counter > 0)
-		{
-		$i=0;
-		$LC_counter = $live_calls_counter;
-
-		while ($i < $live_calls_counter)
-			{
-			$stmt="select channel,extension,number_dialed,start_time,start_epoch from call_log where extension='$LIVE_stations[$i]' and server_ip='$server_ip' order by uniqueid desc LIMIT 1;";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$parked_to_print = mysql_num_rows($rslt);
-			$row=mysql_fetch_row($rslt);
-
-			$channel =			sprintf("%-9s", $row[0]);
-			$number_dialed =	sprintf("%-16s", $row[2]);
-			$start_time =		sprintf("%-19s", $row[3]);
-			$call_time_S = ($STARTtime - $row[4]);
-
-			$call_time_M = ($call_time_S / 60);
-			$call_time_M = round($call_time_M, 2);
-			$call_time_M_int = intval("$call_time_M");
-			$call_time_SEC = ($call_time_M - $call_time_M_int);
-			$call_time_SEC = ($call_time_SEC * 60);
-			$call_time_SEC = round($call_time_SEC, 0);
-			if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-			$call_time_MS = "$call_time_M_int:$call_time_SEC";
-			$call_time_MS =		sprintf("%7s", $call_time_MS);
-			$G = '';		$EG = '';
-			if ($call_time_M_int >= 12) {$G=''; $EG='';}
-			if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-			echo "| $G$LIVE_stations_FORMAT[$i]$EG | $G$LIVE_sessions_FORMAT[$i]$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-			$i++;
-			}
-
-		echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-		echo "  $i stations on live calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on live call\n";
-		echo "             - Over 30 minutes on live call\n";
-
-		}
-		else
-		{
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*************************************** NO LIVE STATIONS ********************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		}
-
-	}
-	else
-	{
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*************************************** NO LIVE STATIONS ********************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	}
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/AST_timeonpark.php b/LANG_admin/vicidial_el/AST_timeonpark.php deleted file mode 100644 index 8aabf8a5..00000000 --- a/LANG_admin/vicidial_el/AST_timeonpark.php +++ /dev/null @@ -1,197 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΥΠΟΒΑΛΛΩ"])) {$ΥΠΟΒΑΛΛΩ=$_GET["ΥΠΟΒΑΛΛΩ"];} - elseif (isset($_POST["ΥΠΟΒΑΛΛΩ"])) {$ΥΠΟΒΑΛΛΩ=$_POST["ΥΠΟΒΑΛΛΩ"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$timeONEhoursAGO = ($STARTtime - 3600); -$epochHALFhoursAGO = ($STARTtime - 1860); -$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO); -$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - $stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Park\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Park                       $NOW_TIME\n\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 1) {$G=''; $EG='';}
-		if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+-----------------+---------------------+---------+\n";
-		echo "  $i callers waiting on server $server_ip\n\n";
-
-		echo "             - 1 minute or more on hold\n";
-		echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	echo "********************ΔΕΝ ΥΠΑΡΧΟΥΝ ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΝΑΜΟΝΗ*********************\n";
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	}
-
-###################################################################################
-###### TIME ON INBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Agents Time On Inbound Calls                             $NOW_TIME\n\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-echo "| STATION    | USER   | CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 12) {$G=''; $EG='';}
-		if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-		echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-		echo "  $i agents on calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on call\n";
-		echo "             - Over 30 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* ΚΑΝΕΝΑΣ ΧΡΗΣΤΗΣ ΣΕ ΚΛΗΣΕΙΣ*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/admin.php b/LANG_admin/vicidial_el/admin.php deleted file mode 100644 index 1419fe6e..00000000 --- a/LANG_admin/vicidial_el/admin.php +++ /dev/null @@ -1,6514 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["user_level"])) {$user_level=$_GET["user_level"];} - elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];} -if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} - elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["campaign_name"])) {$campaign_name=$_GET["campaign_name"];} - elseif (isset($_POST["campaign_name"])) {$campaign_name=$_POST["campaign_name"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["park_ext"])) {$park_ext=$_GET["park_ext"];} - elseif (isset($_POST["park_ext"])) {$park_ext=$_POST["park_ext"];} -if (isset($_GET["park_file_name"])) {$park_file_name=$_GET["park_file_name"];} - elseif (isset($_POST["park_file_name"])) {$park_file_name=$_POST["park_file_name"];} -if (isset($_GET["web_form_address"])) {$web_form_address=$_GET["web_form_address"];} - elseif (isset($_POST["web_form_address"])) {$web_form_address=$_POST["web_form_address"];} -if (isset($_GET["allow_closers"])) {$allow_closers=$_GET["allow_closers"];} - elseif (isset($_POST["allow_closers"])) {$allow_closers=$_POST["allow_closers"];} -if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} - elseif (isset($_POST["hopper_level"])) {$hopper_level=$_POST["hopper_level"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["next_agent_call"])) {$next_agent_call=$_GET["next_agent_call"];} - elseif (isset($_POST["next_agent_call"])) {$next_agent_call=$_POST["next_agent_call"];} -if (isset($_GET["local_call_time"])) {$local_call_time=$_GET["local_call_time"];} - elseif (isset($_POST["local_call_time"])) {$local_call_time=$_POST["local_call_time"];} -if (isset($_GET["voicemail_ext"])) {$voicemail_ext=$_GET["voicemail_ext"];} - elseif (isset($_POST["voicemail_ext"])) {$voicemail_ext=$_POST["voicemail_ext"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} - elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} -if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} - elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["group_color"])) {$group_color=$_GET["group_color"];} - elseif (isset($_POST["group_color"])) {$group_color=$_POST["group_color"];} -if (isset($_GET["fronter_display"])) {$fronter_display=$_GET["fronter_display"];} - elseif (isset($_POST["fronter_display"])) {$fronter_display=$_POST["fronter_display"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["dial_status_a"])) {$dial_status_a=$_GET["dial_status_a"];} - elseif (isset($_POST["dial_status_a"])) {$dial_status_a=$_POST["dial_status_a"];} -if (isset($_GET["dial_status_b"])) {$dial_status_b=$_GET["dial_status_b"];} - elseif (isset($_POST["dial_status_b"])) {$dial_status_b=$_POST["dial_status_b"];} -if (isset($_GET["dial_status_c"])) {$dial_status_c=$_GET["dial_status_c"];} - elseif (isset($_POST["dial_status_c"])) {$dial_status_c=$_POST["dial_status_c"];} -if (isset($_GET["dial_status_d"])) {$dial_status_d=$_GET["dial_status_d"];} - elseif (isset($_POST["dial_status_d"])) {$dial_status_d=$_POST["dial_status_d"];} -if (isset($_GET["dial_status_e"])) {$dial_status_e=$_GET["dial_status_e"];} - elseif (isset($_POST["dial_status_e"])) {$dial_status_e=$_POST["dial_status_e"];} -if (isset($_GET["lead_order"])) {$lead_order=$_GET["lead_order"];} - elseif (isset($_POST["lead_order"])) {$lead_order=$_POST["lead_order"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["campaign_vdad_exten"])) {$campaign_vdad_exten=$_GET["campaign_vdad_exten"];} - elseif (isset($_POST["campaign_vdad_exten"])) {$campaign_vdad_exten=$_POST["campaign_vdad_exten"];} -if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec_exten"];} - elseif (isset($_POST["campaign_rec_exten"])) {$campaign_rec_exten=$_POST["campaign_rec_exten"];} -if (isset($_GET["campaign_recording"])) {$campaign_recording=$_GET["campaign_recording"];} - elseif (isset($_POST["campaign_recording"])) {$campaign_recording=$_POST["campaign_recording"];} -if (isset($_GET["campaign_rec_filename"])) {$campaign_rec_filename=$_GET["campaign_rec_filename"];} - elseif (isset($_POST["campaign_rec_filename"])) {$campaign_rec_filename=$_POST["campaign_rec_filename"];} -if (isset($_GET["hotkey"])) {$hotkey=$_GET["hotkey"];} - elseif (isset($_POST["hotkey"])) {$hotkey=$_POST["hotkey"];} -if (isset($_GET["reset_list"])) {$reset_list=$_GET["reset_list"];} - elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} -if (isset($_GET["old_campaign_id"])) {$old_campaign_id=$_GET["old_campaign_id"];} - elseif (isset($_POST["old_campaign_id"])) {$old_campaign_id=$_POST["old_campaign_id"];} -if (isset($_GET["OLDuser_group"])) {$OLDuser_group=$_GET["OLDuser_group"];} - elseif (isset($_POST["OLDuser_group"])) {$OLDuser_group=$_POST["OLDuser_group"];} -if (isset($_GET["status_name"])) {$status_name=$_GET["status_name"];} - elseif (isset($_POST["status_name"])) {$status_name=$_POST["status_name"];} -if (isset($_GET["selectable"])) {$selectable=$_GET["selectable"];} - elseif (isset($_POST["selectable"])) {$selectable=$_POST["selectable"];} -if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} - elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["delete_users"])) {$delete_users=$_GET["delete_users"];} - elseif (isset($_POST["delete_users"])) {$delete_users=$_POST["delete_users"];} -if (isset($_GET["delete_user_groups"])) {$delete_user_groups=$_GET["delete_user_groups"];} - elseif (isset($_POST["delete_user_groups"])) {$delete_user_groups=$_POST["delete_user_groups"];} -if (isset($_GET["delete_lists"])) {$delete_lists=$_GET["delete_lists"];} - elseif (isset($_POST["delete_lists"])) {$delete_lists=$_POST["delete_lists"];} -if (isset($_GET["delete_campaigns"])) {$delete_campaigns=$_GET["delete_campaigns"];} - elseif (isset($_POST["delete_campaigns"])) {$delete_campaigns=$_POST["delete_campaigns"];} -if (isset($_GET["delete_ingroups"])) {$delete_ingroups=$_GET["delete_ingroups"];} - elseif (isset($_POST["delete_ingroups"])) {$delete_ingroups=$_POST["delete_ingroups"];} -if (isset($_GET["delete_remote_agents"])) {$delete_remote_agents=$_GET["delete_remote_agents"];} - elseif (isset($_POST["delete_remote_agents"])) {$delete_remote_agents=$_POST["delete_remote_agents"];} -if (isset($_GET["load_leads"])) {$load_leads=$_GET["load_leads"];} - elseif (isset($_POST["load_leads"])) {$load_leads=$_POST["load_leads"];} -if (isset($_GET["campaign_detail"])) {$campaign_detail=$_GET["campaign_detail"];} - elseif (isset($_POST["campaign_detail"])) {$campaign_detail=$_POST["campaign_detail"];} -if (isset($_GET["ast_admin_access"])) {$ast_admin_access=$_GET["ast_admin_access"];} - elseif (isset($_POST["ast_admin_access"])) {$ast_admin_access=$_POST["ast_admin_access"];} -if (isset($_GET["ast_delete_phones"])) {$ast_delete_phones=$_GET["ast_delete_phones"];} - elseif (isset($_POST["ast_delete_phones"])) {$ast_delete_phones=$_POST["ast_delete_phones"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} -if (isset($_GET["delete_scripts"])) {$delete_scripts=$_GET["delete_scripts"];} - elseif (isset($_POST["delete_scripts"])) {$delete_scripts=$_POST["delete_scripts"];} -if (isset($_GET["script_id"])) {$script_id=$_GET["script_id"];} - elseif (isset($_POST["script_id"])) {$script_id=$_POST["script_id"];} -if (isset($_GET["script_name"])) {$script_name=$_GET["script_name"];} - elseif (isset($_POST["script_name"])) {$script_name=$_POST["script_name"];} -if (isset($_GET["script_comments"])) {$script_comments=$_GET["script_comments"];} - elseif (isset($_POST["script_comments"])) {$script_comments=$_POST["script_comments"];} -if (isset($_GET["script_text"])) {$script_text=$_GET["script_text"];} - elseif (isset($_POST["script_text"])) {$script_text=$_POST["script_text"];} -if (isset($_GET["reset_hopper"])) {$reset_hopper=$_GET["reset_hopper"];} - elseif (isset($_POST["reset_hopper"])) {$reset_hopper=$_POST["reset_hopper"];} -if (isset($_GET["get_call_launch"])) {$get_call_launch=$_GET["get_call_launch"];} - elseif (isset($_POST["get_call_launch"])) {$get_call_launch=$_POST["get_call_launch"];} -if (isset($_GET["am_message_exten"])) {$am_message_exten=$_GET["am_message_exten"];} - elseif (isset($_POST["am_message_exten"])) {$am_message_exten=$_POST["am_message_exten"];} -if (isset($_GET["amd_send_to_vmx"])) {$amd_send_to_vmx=$_GET["amd_send_to_vmx"];} - elseif (isset($_POST["amd_send_to_vmx"])) {$amd_send_to_vmx=$_POST["amd_send_to_vmx"];} -if (isset($_GET["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_GET["xferconf_a_dtmf"];} - elseif (isset($_POST["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_POST["xferconf_a_dtmf"];} -if (isset($_GET["xferconf_a_number"])) {$xferconf_a_number=$_GET["xferconf_a_number"];} - elseif (isset($_POST["xferconf_a_number"])) {$xferconf_a_number=$_POST["xferconf_a_number"];} -if (isset($_GET["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_GET["xferconf_b_dtmf"];} - elseif (isset($_POST["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_POST["xferconf_b_dtmf"];} -if (isset($_GET["xferconf_b_number"])) {$xferconf_b_number=$_GET["xferconf_b_number"];} - elseif (isset($_POST["xferconf_b_number"])) {$xferconf_b_number=$_POST["xferconf_b_number"];} -if (isset($_GET["modify_leads"])) {$modify_leads=$_GET["modify_leads"];} - elseif (isset($_POST["modify_leads"])) {$modify_leads=$_POST["modify_leads"];} -if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} - elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} -if (isset($_GET["change_agent_campaign"])) {$change_agent_campaign=$_GET["change_agent_campaign"];} - elseif (isset($_POST["change_agent_campaign"])) {$change_agent_campaign=$_POST["change_agent_campaign"];} -if (isset($_GET["agent_choose_ingroups"])) {$agent_choose_ingroups=$_GET["agent_choose_ingroups"];} - elseif (isset($_POST["agent_choose_ingroups"])) {$agent_choose_ingroups=$_POST["agent_choose_ingroups"];} -if (isset($_GET["alt_number_dialing"])) {$alt_number_dialing=$_GET["alt_number_dialing"];} - elseif (isset($_POST["alt_number_dialing"])) {$alt_number_dialing=$_POST["alt_number_dialing"];} -if (isset($_GET["scheduled_callbacks"])) {$scheduled_callbacks=$_GET["scheduled_callbacks"];} - elseif (isset($_POST["scheduled_callbacks"])) {$scheduled_callbacks=$_POST["scheduled_callbacks"];} -if (isset($_GET["lead_filter_id"])) {$lead_filter_id=$_GET["lead_filter_id"];} - elseif (isset($_POST["lead_filter_id"])) {$lead_filter_id=$_POST["lead_filter_id"];} -if (isset($_GET["lead_filter_name"])) {$lead_filter_name=$_GET["lead_filter_name"];} - elseif (isset($_POST["lead_filter_name"])) {$lead_filter_name=$_POST["lead_filter_name"];} -if (isset($_GET["lead_filter_comments"])) {$lead_filter_comments=$_GET["lead_filter_comments"];} - elseif (isset($_POST["lead_filter_comments"])) {$lead_filter_comments=$_POST["lead_filter_comments"];} -if (isset($_GET["lead_filter_sql"])) {$lead_filter_sql=$_GET["lead_filter_sql"];} - elseif (isset($_POST["lead_filter_sql"])) {$lead_filter_sql=$_POST["lead_filter_sql"];} -if (isset($_GET["agentonly_callbacks"])) {$agentonly_callbacks=$_GET["agentonly_callbacks"];} - elseif (isset($_POST["agentonly_callbacks"])) {$agentonly_callbacks=$_POST["agentonly_callbacks"];} -if (isset($_GET["agentcall_manual"])) {$agentcall_manual=$_GET["agentcall_manual"];} - elseif (isset($_POST["agentcall_manual"])) {$agentcall_manual=$_POST["agentcall_manual"];} -if (isset($_GET["vicidial_recording"])) {$vicidial_recording=$_GET["vicidial_recording"];} - elseif (isset($_POST["vicidial_recording"])) {$vicidial_recording=$_POST["vicidial_recording"];} -if (isset($_GET["vicidial_transfers"])) {$vicidial_transfers=$_GET["vicidial_transfers"];} - elseif (isset($_POST["vicidial_transfers"])) {$vicidial_transfers=$_POST["vicidial_transfers"];} -if (isset($_GET["delete_filters"])) {$delete_filters=$_GET["delete_filters"];} - elseif (isset($_POST["delete_filters"])) {$delete_filters=$_POST["delete_filters"];} -if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_options=$_GET["alter_agent_interface_options"];} - elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];} -if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];} - elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];} -if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];} - elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];} -if (isset($_GET["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} -if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];} - elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];} -if (isset($_GET["drop_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} -if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];} - elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];} -if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];} - elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];} -if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];} - elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];} -if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];} - elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];} -if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];} - elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];} -if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];} - elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];} -if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];} - elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];} -if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];} - elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];} -if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];} - elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];} -if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];} - elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];} -if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];} - elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];} -if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];} - elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];} -if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];} - elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];} -if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];} - elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];} -if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];} - elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];} -if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];} - elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];} -if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];} - elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];} -if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];} - elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];} -if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];} - elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];} -if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];} - elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];} -if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];} - elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];} -if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];} - elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];} -if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];} - elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];} -if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];} - elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];} -if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];} - elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} -if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} - elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} -if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} - elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} -if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} - elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} - - if (isset($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS ONLY ### -$user_level = ereg_replace("[^0-9]","",$user_level); -$wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); -$drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); -$am_message_exten = ereg_replace("[^0-9]","",$am_message_exten); -$campaign_rec_exten = ereg_replace("[^0-9]","",$campaign_rec_exten); -$campaign_vdad_exten = ereg_replace("[^0-9]","",$campaign_vdad_exten); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); -$dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); -$park_ext = ereg_replace("[^0-9]","",$park_ext); -$hopper_level = ereg_replace("[^0-9]","",$hopper_level); -$agent_choose_ingroups = ereg_replace("[^0-9]","",$agent_choose_ingroups); -$hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); -$agentonly_callbacks = ereg_replace("[^0-9]","",$agentonly_callbacks); -$agentcall_manual = ereg_replace("[^0-9]","",$agentcall_manual); -$vicidial_recording = ereg_replace("[^0-9]","",$vicidial_recording); -$vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); -$closer_default_blended = ereg_replace("[^0-9]","",$closer_default_blended); -$alter_agent_interface_options = ereg_replace("[^0-9]","",$alter_agent_interface_options); -$delete_users = ereg_replace("[^0-9]","",$delete_users); -$delete_user_groups = ereg_replace("[^0-9]","",$delete_user_groups); -$delete_scripts = ereg_replace("[^0-9]","",$delete_scripts); -$delete_remote_agents = ereg_replace("[^0-9]","",$delete_remote_agents); -$delete_lists = ereg_replace("[^0-9]","",$delete_lists); -$delete_ingroups = ereg_replace("[^0-9]","",$delete_ingroups); -$delete_filters = ereg_replace("[^0-9]","",$delete_filters); -$delete_campaigns = ereg_replace("[^0-9]","",$delete_campaigns); -$delete_call_times = ereg_replace("[^0-9]","",$delete_call_times); -$load_leads = ereg_replace("[^0-9]","",$delete_call_times); -$campaign_detail = ereg_replace("[^0-9]","",$campaign_detail); -$ast_delete_phones = ereg_replace("[^0-9]","",$ast_delete_phones); -$ast_admin_access = ereg_replace("[^0-9]","",$ast_admin_access); -$modify_leads = ereg_replace("[^0-9]","",$modify_leads); -$change_agent_campaign = ereg_replace("[^0-9]","",$change_agent_campaign); -$modify_call_times = ereg_replace("[^0-9]","",$modify_call_times); -$ct_wednesday_stop = ereg_replace("[^0-9]","",$ct_wednesday_stop); -$ct_wednesday_start = ereg_replace("[^0-9]","",$ct_wednesday_start); -$ct_tuesday_stop = ereg_replace("[^0-9]","",$ct_tuesday_stop); -$ct_tuesday_start = ereg_replace("[^0-9]","",$ct_tuesday_start); -$ct_thursday_stop = ereg_replace("[^0-9]","",$ct_thursday_stop); -$ct_thursday_start = ereg_replace("[^0-9]","",$ct_thursday_start); -$ct_sunday_stop = ereg_replace("[^0-9]","",$ct_sunday_stop); -$ct_sunday_start = ereg_replace("[^0-9]","",$ct_sunday_start); -$ct_saturday_stop = ereg_replace("[^0-9]","",$ct_saturday_stop); -$ct_saturday_start = ereg_replace("[^0-9]","",$ct_saturday_start); -$ct_monday_stop = ereg_replace("[^0-9]","",$ct_monday_stop); -$ct_monday_start = ereg_replace("[^0-9]","",$ct_monday_start); -$ct_friday_stop = ereg_replace("[^0-9]","",$ct_friday_stop); -$ct_friday_start = ereg_replace("[^0-9]","",$ct_friday_start); -$ct_default_stop = ereg_replace("[^0-9]","",$ct_default_stop); -$ct_default_start = ereg_replace("[^0-9]","",$ct_default_start); -$number_of_lines = ereg_replace("[^0-9]","",$number_of_lines); -$user_start = ereg_replace("[^0-9]","",$user_start); -$phone_number = ereg_replace("[^0-9]","",$phone_number); -$remote_agent_id = ereg_replace("[^0-9]","",$remote_agent_id); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); -$attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); -$hotkey = ereg_replace("[^0-9]","",$hotkey); -$list_id = ereg_replace("[^0-9]","",$list_id); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); -$allow_closers = ereg_replace("[^NY]","",$allow_closers); -$reset_hopper = ereg_replace("[^NY]","",$reset_hopper); -$amd_send_to_vmx = ereg_replace("[^NY]","",$amd_send_to_vmx); -$alt_number_dialing = ereg_replace("[^NY]","",$alt_number_dialing); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); -$selectable = ereg_replace("[^NY]","",$selectable); -$reset_list = ereg_replace("[^NY]","",$reset_list); -$fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); -$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); - -### ALPHA-NUMERIC ONLY ### -$user = ereg_replace("[^0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^0-9a-zA-Z]","",$pass); -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); -$submit = ereg_replace("[^0-9a-zA-Z]","",$submit); -$CoNfIrM = ereg_replace("[^0-9a-zA-Z]","",$CoNfIrM); -$campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid); -$get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch); -$campaign_recording = ereg_replace("[^0-9a-zA-Z]","",$campaign_recording); -$ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD); -$dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix); -$state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state); -$scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); - -### DIGITS and Dots -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); - -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); - -### ALPHA-NUMERIC and underscore and dash -$dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); -$dial_status_d = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_d); -$dial_status_c = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_c); -$dial_status_b = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_b); -$dial_status_a = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_a); -$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage); -$lead_filter_id = ereg_replace("[^-\_0-9a-zA-Z]","",$lead_filter_id); -$campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id); -$old_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_campaign_id); -$park_file_name = ereg_replace("[^-\_0-9a-zA-Z]","",$park_file_name); -$next_agent_call = ereg_replace("[^-\_0-9a-zA-Z]","",$next_agent_call); -$local_call_time = ereg_replace("[^-\_0-9a-zA-Z]","",$local_call_time); -$call_time_id = ereg_replace("[^-\_0-9a-zA-Z]","",$call_time_id); -$phone_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_pass); -$phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); -$group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); -$user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); -$OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); -$state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); - -### ALPHA-NUMERIC and spaces -$lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); -### ALPHA-NUMERIC and hash -$group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); -$campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); -$status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); -$HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); -$status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); -$script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); -$script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); -$list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); -$lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); -$lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); -$campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); -$call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); -$call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - -### remove semi-colons ### -$lead_filter_sql = ereg_replace(";","",$lead_filter_sql); - -### VARIABLES TO BE mysql_real_escape_string ### -# $web_form_address -# $script_text - -##### END VARIABLE FILTERING FOR SECURITY ##### - - -# AST GUI database administration -# admin.php -# -# CHANGES -# 50315-1110 - Added Custom Campaign Statuses -# 50317-1438 - Added Fronter Display var to inbound groups -# 50322-1355 - Added custom callerID per campaign -# 50517-1356 - Added user_groups sections and user_group to vicidial_users -# 50517-1440 - Added ability to logout (must click OK with empty user/pass) -# 50602-1622 - Added lead loader pages to load new files into vicidial_list -# 50620-1351 - Added custom vdad transfer AGI extension per campaign -# 50810-1414 - modified in groups to kick out spaces and dashes -# 50908-2136 - Added Custom Campaign HotKeys -# 50914-0950 - Fixed user search by user_group -# 50926-1358 - Modified to allow for language translation -# 50926-1615 - Added WeBRooTWritablE write controls -# 51020-1008 - Added editable web address and park ext - NEW dial campaigns -# 51020-1056 - Added fields and help for campaign recording control -# 51123-1335 - Altered code to function in php globals=off -# 51208-1038 - Added user_level changes, function controls and default user phones -# 51208-1556 - Added deletion of users/lists/campaigns/in groups/remote agents -# 51213-1706 - Added add/delete/modify vicidial scripts -# 51214-1737 - Added preview of vicidial script in popup window -# 51219-1225 - Added campaign and ingroups script selector and get_call_launch field -# 51222-1055 - Added am_message_exten to campaigns to allow for AM Message button -# 51222-1125 - Fixed new vicidial_campaigns default values not being assigned bug -# 51222-1156 - Added LOG OUT ALL AGENTS ON THIS CAMPAIGN button to campaign screen -# 60204-0659 - Fixed hopper reset bug -# 60207-1413 - Added AMD send to voicemail extension and xfer-conf dtmf presets -# 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 -# 60417-1416 - Added vicidial_lead_filters sections -# - Changed the header links to color-coded sectional with sublinks below -# - Added filter name and script name to campaign and in-group modify sections -# - Added callback and alt dial options to campaigns section -# - Added callback, alt dial and other options to users section -# 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered -# 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60425-2355 - Added agent options to vicidial_users, reformatted user page -# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen -# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen -# 60505-1117 - Added initial framework for new local_call_times tables and definitions -# 60506-1033 - More revisions to the local_call_time section -# 60508-1354 - Finished call_times and state_call_times sections -# - Added modify/delete options for call_times -# 60509-1311 - Functionalize campaign dialable leads calculation -# - Change state_call_times selection from call_times to only allow one per state -# - Added dialable leads count popup to campaign screen if auto-calc is disabled -# - Added test dialable leads count popup to filter screen -# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen -# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen -# 60609-1051 - Added add-to-dnc in LISTS section -# 60613-1415 - Added lead recycling options to campaign detail screen -# 60619-1523 - Added variable filtering to eliminate SQL injection attack threat -# 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug -# - -# 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.12-3'; -$build = '60623-1159'; - -$STARTtime = date("U"); - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Έχετε αποσυνδεθεί. Σας ευχαριστούμε\n"; - exit; -} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGuser_level =$row[4]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); -echo "\n"; -echo "\n"; -echo "\n"; -echo "ΔΙΑΧΕΙΡΙΣΗ: "; - -if (!isset($ADD)) {$ADD=0;} - -if ($ADD==1) {$hh='users'; echo "Πρόσθεσε Νέο Χρήστη";} -if ($ADD==11) {$hh='campaigns'; echo "Πρόσθεσε Νέα Εκστρατεία";} -if ($ADD==111) {$hh='lists'; echo "Πρόσθεσε Νέα Λίστα";} -if ($ADD==121) {$hh='lists'; echo "Προσθέστε νέο DNC";} -if ($ADD==1111) {$hh='ingroups'; echo "Πρόσθεσε Νέα Εισ-Ομάδα";} -if ($ADD==11111) {$hh='remoteagent'; echo "Πρόσθεσε Νέους Απομακρυσμένους Χειριστές";} -if ($ADD==111111) {$hh='usergroups'; echo "Πρόσθεσε Νέα Ομάδα Χρηστών";} -if ($ADD==1111111) {$hh='scripts'; echo "Πρόσθεσε Νέο Βοηθό";} -if ($ADD==11111111) {$hh='filters'; echo "Πρόσθεσε Φίλτρο";} -if ($ADD==111111111) {$hh='times'; echo "Πρόσθεσε Νέο Χρόνο Κλήσης";} -if ($ADD==1111111111) {$hh='times'; echo "Πρόσθεσε Νέο Χρόνο Κλήσης Κατάστασης";} -if ($ADD==2) {$hh='users'; echo "Προσθήκη Νέου Χρήστη";} -if ($ADD==21) {$hh='campaigns'; echo "Προσθήκη Νέας Εκστρατείας";} -if ($ADD==22) {$hh='campaigns'; echo "Προσθήκη Νέας Κατάστασης Εκστρατείας";} -if ($ADD==23) {$hh='campaigns'; echo "Προσθήκη Νέου Κλειδιού Εκστρατείας";} -if ($ADD==25) {$hh='campaigns'; echo "Νέα ανακύκλωσης προσθήκη μολύβδου εκστρατείας";} -if ($ADD==211) {$hh='lists'; echo "Προσθήκη Νέας Λίστας";} -if ($ADD==2111) {$hh='ingroups'; echo "Προσθήκη Νέας Εισ-Ομάδας";} -if ($ADD==21111) {$hh='remoteagent'; echo "Προσθήκη Νέων Απομακρυσμένων Χειριστών";} -if ($ADD==211111) {$hh='usergroups'; echo "Προσθήκη Νέας Ομάδας Χρηστών";} -if ($ADD==2111111) {$hh='scripts'; echo "Νέα προσθήκη Βοηθού";} -if ($ADD==21111111) {$hh='filters'; echo "Προσθήκη Νέου Φίλτρου";} -if ($ADD==211111111) {$hh='times'; echo "Προσθήκη Νέου Χρόνου Κλήσης";} -if ($ADD==2111111111) {$hh='times'; echo "Προσθήκη Νέου Χρόνου Κλήσης Κατάστασης";} -if ($ADD==3) {$hh='users'; echo "Τροποποίηση Χρήστη";} -if ($ADD==31) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας";} -if ($ADD==34) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση";} -if ($ADD==311) {$hh='lists'; echo "Τροποποίηση Λίστας";} -if ($ADD==3111) {$hh='ingroups'; echo "Τροποποίηση Εισ-Ομάδων";} -if ($ADD==31111) {$hh='remoteagent'; echo "Τροποποίηση Απομακρυσμένων Χειριστών";} -if ($ADD==311111) {$hh='usergroups'; echo "Τροποποίηση Ομάδων Χρηστών";} -if ($ADD==3111111) {$hh='scripts'; echo "Τροποποιήστε τον Βοηθό";} -if ($ADD==31111111) {$hh='filters'; echo "Τροποποίηση Φίλτρου";} -if ($ADD==311111111) {$hh='times'; echo "Τροποποίηση Χρόνου Κλήσης";} -if ($ADD==321111111) {$hh='times'; echo "Τροποποίηση Λίστας Ορισμών Χρόνου Κλήσης Κατάστασης ";} -if ($ADD==3111111111) {$hh='times'; echo "Τροποπίηση Χρόνου Κλήσης Κατάστασης";} -if ($ADD=="4A") {$hh='users'; echo "Τροποποίηση Χρήστη - Admin";} -if ($ADD=="4B") {$hh='users'; echo "Τροποποίηση Χρήστη - Admin";} -if ($ADD==4) {$hh='users'; echo "Τροποποίηση Χρήστη";} -if ($ADD==41) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας";} -if ($ADD==42) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας Status";} -if ($ADD==43) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση";} -if ($ADD==45) {$hh='campaigns'; echo "Τροποποιήστε το μόλυβδο εκστρατείας ανακύκλωσης";} -if ($ADD==411) {$hh='lists'; echo "Τροποποίηση Λίστας";} -if ($ADD==4111) {$hh='ingroups'; echo "Τροποποίηση Εισ-Ομάδων";} -if ($ADD==41111) {$hh='remoteagent'; echo "Τροποποίηση Απομακρυσμένων Χειριστών";} -if ($ADD==411111) {$hh='usergroups'; echo "Τροποποίηση Ομάδων Χρηστών";} -if ($ADD==4111111) {$hh='scripts'; echo "Τροποποιήστε τον Βοηθό";} -if ($ADD==41111111) {$hh='filters'; echo "Τροποποίηση Φίλτρου";} -if ($ADD==411111111) {$hh='times'; echo "Τροποποίηση Χρόνου Κλήσης";} -if ($ADD==4111111111) {$hh='times'; echo "Τροποπίηση Χρόνου Κλήσης Κατάστασης";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Εκστρατεία";} -if ($ADD==52) {$hh='campaigns'; echo "Αποσυνδεμένοι Χειριστές";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==51111) {$hh='remoteagent'; echo "Διάγραψε τους Απομακρυσμένους Χειριστές";} -if ($ADD==511111) {$hh='usergroups'; echo "Διάγραψε τους χρήστες Group";} -if ($ADD==5111111) {$hh='scripts'; echo "Διάγραψε τον Βοηθό";} -if ($ADD==51111111) {$hh='filters'; echo "Διαγραφή Φίλτρου";} -if ($ADD==511111111) {$hh='times'; echo "Διαγραφή Χρόνου Κλήσης";} -if ($ADD==5111111111) {$hh='times'; echo "Διαγραφή Χρόνου Κλήσης Κατάστασης";} -if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Εκστρατεία";} -if ($ADD==62) {$hh='campaigns'; echo "Αποσυνδεμένοι Χειριστές";} -if ($ADD==65) {$hh='campaigns'; echo "Διαγράψτε το μόλυβδο ανακύκλωσης";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==61111) {$hh='remoteagent'; echo "Διάγραψε τους Απομακρυσμένους Χειριστές";} -if ($ADD==611111) {$hh='usergroups'; echo "Διάγραψε τους χρήστες Group";} -if ($ADD==6111111) {$hh='scripts'; echo "Διάγραψε τον Βοηθό";} -if ($ADD==61111111) {$hh='filters'; echo "Διαγραφή Φίλτρου";} -if ($ADD==611111111) {$hh='times'; echo "Διαγραφή Χρόνου Κλήσης";} -if ($ADD==6111111111) {$hh='times'; echo "Διαγραφή Χρόνου Κλήσης Κατάστασης";} -if ($ADD==73) {$hh='campaigns'; echo "Μετρητής Κληθέντων Οδηγών";} -if ($ADD==7111111) {$hh='scripts'; echo "Προεπισκόπιση Βοηθού";} -if ($ADD==0) {$hh='users'; echo "Λίστα Χρηστών";} -if ($ADD==8) {$hh='users'; echo "Επανακλήσεις μέσα στον χειριστή";} -if ($ADD==81) {$hh='campaigns'; echo "Επανακλήσεις μέσα στην εκστρατεία";} -if ($ADD==811) {$hh='campaigns'; echo "Επανακλήσεις μέσα στην λίστα";} -if ($ADD==10) {$hh='campaigns'; echo "Εκστρατείες";} -if ($ADD==100) {$hh='lists'; echo "Λίστες";} -if ($ADD==1000) {$hh='ingroups'; echo "Εισ-Ομάδες";} -if ($ADD==10000) {$hh='remoteagent'; echo "Απομακρυσμένοι Χειριστές";} -if ($ADD==100000) {$hh='usergroups'; echo "Ομάδες Χρήστη";} -if ($ADD==1000000) {$hh='scripts'; echo "Βοηθοί";} -if ($ADD==10000000) {$hh='filters'; echo "Φίλτρα";} -if ($ADD==100000000) {$hh='times'; echo "Χρόνοι Κλήσεων";} -if ($ADD==1000000000) {$hh='times'; echo "";} -if ($ADD==55) {$hh='users'; echo "Φόρμα Αναζήτησης";} -if ($ADD==66) {$hh='users'; echo "Αποτελέσματα Αναζήτησης";} -if ($ADD==99999) {$hh='users'; echo "ΒΟΗΘΕΙΑ";} - -if ( ($ADD>9) && ($ADD < 99998) ) - { - ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $scripts_to_print = mysql_num_rows($rslt); - $scripts_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($scripts_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $scriptname_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - $filters_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($filters_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $filtername_list["$rowx[0]"] = "$rowx[1]"; - $filtersql_list["$rowx[0]"] = "$rowx[2]"; - $o++; - } - - ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $times_to_print = mysql_num_rows($rslt); - - $o=0; - while ($times_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $call_timename_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - } - -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD==31) or ($ADD==41) or ($ADD=="4A") or ($ADD=="4B") ) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ($ADD==31) - { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ($ADD==3) - { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) - { - if ($group_id_value == $groups[$p]) - { - $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; - } - $p++; - } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; - $o++; - } - if (strlen($groups_value)>2) {$groups_value .= " -";} - } - - - - - -$NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"ΒΟΗΘΕΙΑ\" ALIGN=TOP></A>"; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
ΔΙΑΧΕΙΡΙΣΗ: ΒΟΗΘΕΙΑ


\n"; - -?> -VICIDIAL_ΧΡΗΣΤΕΣ ΠΙΝΑΚΑΣ

- -
-ID Χρήστη - Σε αυτό το πεδίο τοποθετείται ο αριθμός ID του χρήστη, μπορεί να είναι μεταξύ 2 και 8 ψηφία. - -
-
-
-Κωδικός - Σε αυτό το πεδίο τοποθετείται ο κωδικός του χρήστη στο VICIDIAL. Πρέπει να είναι τουλάχιστον 2 χαρακτήρες. - -
-
-
-Πλήρες Ονομα - Αυτό το πεδίο είναι που μπορείτε να ορίσετε το πλήρες όνομα των χρηστών VICIDIAL. Πρέπει να είναι τουλάχιστον 2 χαρακτήρες. - -
-
-
-Επίπεδο Χρήστη - Αυτός ο κατάλογος επιλογών είναι που μπορείτε να επιλέξετε το επίπεδο χρήστη των VICIDIAL χρηστών. Πρέπει να έχει επίπεδο 1 για να συνδεθεί στο σύστημα. Πρέπει να έχει επίπεδο μεγαλύτερο από 2 για να συνδεθεί ως closer. Πρέπει να έχει επίπεδο 8 ή μεγαλύερο για ενέργειες διαχειριστή. - -
-
-
-Ομάδα Χρήστη - Αυτός ο κατάλογος επιλογών είναι που μπορείτε να επιλέξετε την ομάδα χρηστών που ανήκει ο χρήστης. - -
-
-
-Σύνδεση Τηλεφώνου - εδώ μπορείτε να θέσετε μία προκαθορισμένη σύνδεση τηλεφώνου κατά την είσοδο του χειριστή στο vicidial.php. - -
-
-
-Κωδικός Τηλεφώνου - εδώ μπορείτε να θέσετε ένα προκαθορισμένο κωδικό τηλεφώνου κατά την είσοδο του χειριστή στο vicidial.php. - -
-
-
-HotKeys ενεργός - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να χρησιμοποιήσει τα πλήκτρα γρήγορου τερματισμού vicidial.php. - -
-
-
-Ο πράκτορας επιλέγει Ingroups - εάν θέσετε σε 1 αυτή την επιλογή επιτρέπει στο χρήστη να επιλέξει τις εισ-ομάδες που θα λάβουν τις κλήσεις. Διαφορετικά ο Manager θα πρέπει να το θέσει αυτό στην σελίδα διαχείρισης. - -
-
-
-Εισερχόμενες Ομάδες - Εδώ μπορείτε να επιλέξετε τις εισερχόμενες ομάδες που θέλετε να λαμβάνουν τις κλήσεις , εάν έχετε επιλέξει την εκστρατεία CLOSER. - -
-
-
-Προγραμματισμένες Επανακλήσεις - Αυτή η επιλογή επιτρέπει στον χειριστή να τερματίσει μία κλήση ως CALLBK και να επιλέξει τα δεδομένα και την ώρα κατά την οποία ο οδηγός θα ξανα-ενεργοποιηθεί. - -
-
-
-Μόνο του Χρήστη Επανακλήσεις- Αυτή η επιλογή επιτρέπει στον χρήστη να θέσει μία επανάκληση με τέτοιο τρόπο, ώστε μόνο αυτός να μπορεί να καλέσει τον πελάτη. Επίσης, επιτρέπει στον χρήστη να δει τις λίστες των επανακλήσεων και να τις καλέσει οποιαδήποτε στιγμή. - -
-
-
-Χειροκίνητη Κλήση Χρήστη - Αυτή η επιλογή επιτρέπει στον χειριστή να καταχωρήσει χειροκίνητα ένα νέο οδηγό στο σύστημα και να τον καλέσει. - -
-
-
-Ηχογράφηση - Αυτή η επιλογή μπορεί να απαγορεύσει σε έναν χειριστή να κάνει ηχογραφήσεις και θα πρέπει να ακολουθεί την διαδικασία ηχογράφησης της εκστρατείας. - -
-
-
-Μεταφορές- Αυτή η επιλογή μπορεί να απαγορεύσει σε έναν χειριστή να ανοίξει την διαδικασία μεταφορά-συνδιάσκεψη. Αν είναι απενεργοποιημένη, ο χρήστης δεν μπορεί να μεταφέρει κλήσεις ή να κάνει κλήση σε τρίτο. - -
-
-
-Πιό στενή προεπιλογή που συνδυάζεται - αυτή η επιλογή προκαθορίζει απλά το συνδυασμένο τετραγωνίδιο σε μια ΠΙΟ ΣΤΕΝΉ οθόνη σύνδεσης. - -
-
-
-Αλλάξτε τις επιλογές διεπαφών Χειριστών - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο διαχειριστή να τροποποιήσει τις επιλογές διεπαφών χειριστών στην admin.php. - -
-
-
-Διαγραφή Χρηστών - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει άλλους χρήστες ίσου ή μικρότερου επιπέδου από το σύστημα. - -
-
-
-Διαγραφή Ομάδων Χρηστών - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει τις ομάδες χρηστών από το σύστημα. - -
-
-
-Διαγραφή Λιστών - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει τις λίστες από το σύστημα. - -
-
-
-Διαγραφή Εκστρατειών - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει τις εκστρατείες από το σύστημα. - -
-
-
-Διαγραφή Εισ-Ομάδων - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει τις Εισ-Ομάδες από το σύστημα. - -
-
-
-Διαγράψτε τους Απομακρυσμένους Χειριστές - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει τους απομακρυσμένους χειριστές από το σύστημα. - -
-
-
-Εισαγωγή Οδηγών - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να εισάγει τους οδηγούς στον πίνακα vicidial_list μέσω του βασισμένου σε Ιστοσελίδα Εισαγωγέα οδηγών. - -
-
-
-Λεπτομέρειες Εκστρατείας - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να δει και να τροποποιήσει τα λεπτομερή στοιχεία της εκστρατείας. - -
-
-
-AGC Πρόσβαση Διαχειριστή - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να συνδεθεί στις σελίδες του astGUIclient ως διαχειριστής. - -
-
-
-AGC διαγραφή τηλεφώνων - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει τα τηλέφωνα στις σελίδες του διαχειριστή του astGUIclient. - -
-
-
-Διαγραφή Βοηθού - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να διαγράψει τους οδηγούς της εκστρατείας . - -
-
-
-Τροποποιήστε τους οδηγούς - αυτή η επιλογή εάν τη θέσετε σε 1, επιτρέπει στο χρήστη να τροποποιήσει τους οδηγούς στη σελίδα αποτελεσμάτων αναζήτησης οδηγών. - -
-
-
-Αλλαγή Εκστρατείας Χειριστού - εάν θέσετε σε 1 αυτή την επιλογή, επιτρέπει στο χρήστη να αλλάξει την εκτρατεία όπου ένας πράκτορας έχει συνδεθεί . - -
-
-
-Διαγραφή Φίλτρων - Αυτή η επιλογή επιτρέπει στον χειριστή να διαγράφει φίλτρα από το σύστημα. - -
-
-
-Διαγραφή Χρόνων Κλήσεων - Αυτή η επιλογή επιτρέπει στον χρήστη να διαγράφει εγγραφές χρόνων κλήσεων και καταστάσεων από το σύστημα. - -
-
-
-Τροποποίηση Χρόνων Κλήσεων - Αυτή η επιλογή επιτρέπει στον χρήστη εμφανίσει και να τροποποιήσει τους χρόνους κλήσεων και τις εγγραφές χρόνων κλήσεων κατάστασης. Δεν χρειάζεται να είναι ενεργή αυτή η επιλογή εάν μόνο χρειάζεται η αλλαγή της επιλογής των χρόνων κλήσεων στην οθόνη των εκστρατειών. - - - - -



- -VICIDIAL_ΕΚΣΤΡΑΤΕΙΕΣ ΠΙΝΑΚΑΣ

-
-
-ID Εκστρατείας - Αυτό είναι το σύντομο όνομα της εκστρατείας, δεν μπορεί να διορθωθεί μετά από την αρχική παράδοση, δεν μπορεί να περιέχει κενά και πρέπει να είναι μεταξύ 2 και 8 χαρακτήρεςh. - -
-
-
-Ονομα Εκστρατείας - Αυτό είναι η περιγραφή της εκστρατείας, πρέπει να είναι μεταξύ 6 και 40 χαρακτήρες. - -
-
-
-Ενεργοποίηση - Εδώ μπορείτε να θέσετε την εκστρατεία ενεργή ή μη ενεργή. Εάν είναι μη ενεργή, κανένας δεν μπορεί να συνδεθεί σε αυτήν. - -
-
-
-Τηλ.Σύνδεση Στάθμευσης - Εδώ μπορείτε να ορίσετε την μουσική αναμονής για το VICIDIAL. Επιβεβαιώστε, ότι η εσωτ.σύνδεση βρίσκεται στο extensions.conf και ότι δείχνει το αρχείο παρακάτω. - -
-
-
-ν Αρχείου Στάθμευσης - Εδώ μπορείτε να προσαρμόσετε την μουσική αναμονής για το VICIDIAL. Επιβεβαιώστε ότι το αρχείο έχει 10 χαρακτήρες ή λιγότερους και ότι το αρχείο βρίσκεται στον κατάλογο /var/lib/asterisk/sounds. - -
-
-
-Ιστοσελίδα - Αυτή είναι η προσαρμοσμένη διεύθυνση που θα σας κατευθύνει για κλήσεις που έρχονται σε αυτήν την ομάδα. - -
-
-
-Επιτρέπει τους Closers - Εδώ ορίζετε εάν οι χρήστες της εκστρατείας θα έχουν την επιλογή να στείλουν την κλήση σε έναν closer. - -
-
-
-Κατάσταση Κλήσης - Εδώ ορίζετε τις καταστάσεις που θέλετε να κληθούν μέσα στις λίστες, οι οποίες είναι ενεργές για την εκστρατεία παρακάτω - -
-
-
-Ταξινόμηση Λίστας - Σε αυτόν τον κατάλογο επιλογών μπορείτε να επιλέξετε πώς οι οδηγοί, που ταιριάζουν με τις καταστάσεις που επιλέξατε παραπάνω, θα τοποθετηθούν στον hopper: -
  - DOWN: επιλογή των πρώτων οδηγών που εισήχθησαν στον πίνακα vicidial_list -
  - UP: επιλογή των τελευταίων οδηγών που εισήχθησαν στον πίνακα vicidial_list -
  - UP PHONE: επιλογή του υψηλότερου τηλεφωνικού αριθμού και συνεχίζει προς τα κάτω -
  - DOWN PHONE: επιλογή του χαμηλότερου τηλεφωνικού αριθμού και συνεχίζει προς τα πάνω -
  - UP LAST NAME: έναρξη με τα επίθετα να ξεκινάνε με Ζ και συνεχίζει προς τα κάτω -
  - DOWN LAST NAME: έναρξη με τα επίθετα να ξεκινάνε με Α και συνεχίζει προς τα πάνω -
  - UP COUNT: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα κάτω -
  - DOWN COUNT: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει -
  - DOWN COUNT 2nd NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε άλλο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων -
  - DOWN COUNT 3nd NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε τρίτο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων -
  - DOWN COUNT 4th NEW: έναρξη με τους λιγότερους σε κλήση οδηγούς και συνεχίζει προς τα πάνω με την εισαγωγή ενός ΝΕΟΥ οδηγού για κάθε τέταρτο οδηγό - Πρέπει να ΜΗΝ έχει νέα επιλεγμένα στις καταστάσεις κλήσεων - -
-
-
-Επίπεδο Hopper - Αυτό είναι το πόσους οδηγούς η διαδικασία VDhopper, προσπαθεί να διατηρήσει στον πίνακα vicidial_hopper για αυτήν την εκστρατεία. Εάν η διαδικασία VDhopper τρέχει κάθε λεπτό, ρυθμίστε αυτό λίγο περισσότερο από τον αριθμό των οδηγών που περνούν σε ένα λεπτό. - -
-
-
-Φίλτρο Οδηγοιύ - αυτή είναι μία μέθοδος για να δημιουργήτε φίλτρα για την SQL ερώτηση. Χρησιμοποιήστε αυτό το χαρακτηριστικό με προσοχή, είναι εύκολο να σταματήσει το σύστημα με μία μικρή αλλαγή στη δήλωση SQL. Η προεπιλογή είναι ΚΑΜΙΑ. - -
-
-
-Υποχρεωτική Επαναφορά του Hopper - Αυτό σας επιτρέπει καθαρίσετε τα περιεχόμενα κατά την επιβεβαίωση της φόρμας. Αυτό θα συμβεί πάλι όταν η διαδικασία VDhopper θα τρέξει. - -
-
-
-Επίπεδο Αυτόματης Κλήσης - Εδώ είναι που καθορίζεται πόσες γραμμές θα χρησιμοποιούνται ανά ενεργό χρήστη. Μηδέν (0) σημαίνει ότι η αυτόματη κλήση είναι μη ενεργή και οι χρήστες πατούν το πλήκτρο για την κλήση κάθε αριθμού. Διαφορετικά, το σύστημα καλεί γραμμές ίσες με τους ενεργούς χρήστες, πολλαπλασιασμένους με το επίπεδο κλήσης και σύμφωνα με το πόσες γραμμές η εκστρατεία σε κάθε διακομιστή επιτρέπει. - -
-
-
-Επόμενη Κλήση Χρήστη - Αυτό προσδιορίζει ποιος χρήστης λαμβάνει την επόμενη κλήση που είναι διαθέσιμη: -
  - random: ταξινομημένο με τυχαία τιμή ενημέρωσης στον πίνακα vicidial_live_agents -
  - oldest_call_start: ταξινομημένο με την τελευταία φορά που σε ένα χρήστη στάλθηκε μία κλήση. Με αποτέλεσμα, ο χρήστης να λαμβάνει συνολικά το ίδιο αριθό κλήσεων. -
  - oldest_call_finish: ταξινομημένο με την τελευταία φορά που ένας χρήστης τελείωσε μία κλήση. Ο χρήστης που περιμένει περισσότερο λαμβάνει την πρώτη κλήση. -
  - overall_user_level: οι διαταγές από το user_level του χειριστή όπως καθορίζεται στα vicidial_users παρουσιάζουν ένα υψηλότερο user_level θα άβουν περισσότερες κλήσεις. - -
-
-
-Τοπική Ωρα Κλήσης - Εδώ, μπορείτε να ορίσετε τις ώρες που θα θέλατε να γίνουν οι κλήσεις. Αυτό ελέγχετε από τον κωδικό περις και ρυθμίζεται για Daylight Savings εάν είναι εφαρμόσιμο. - -
-
-
-Κλήση Εκτός Χρόνου - Εάν έχει οριστεί, οι κλήσεις που φυσιολογικά θα έκλειναν μετά το χρόνο που έχει οριστεί στο extensions.conf, θα κλείσουν σε αυτόν τον χρόνο εάν είναι μικρότερος του extensions.conf. Αυτό επιτρέπει στην γρήγορη αλλαγή των χρόνων από διακομιστή σε διακομιστή και περιορίζοντας τα αοτελέσματα σε μία εκστρατεία. Εάν έχετε πολλές κλήσεις με Αυτόματους Τηλεφωνητές ή Φωνητικών Ταχυδρομείων, μπορείτε να αλλάξετε αυτή την τιμή μεταξύ 21-26 και να δείτε αν τα αποτελέσματα είναι καλύτερα. - -
-
-
-Πρόθεμα Κλήσης - Αυτό το ο επιτρέπει την πιο εύκολη αλλαγή της διαδρομής της κλήσης να βγει έξω μέσω διαφορετικής μεθόδου, χωρίς να γίνει επαναφόρτωση στο Asterisk. Προκαθορισμένο είναι το 9 βασισμένο σύμφωνα με το 91NXXNXXXXXX στο σχέδιο κλήσεων - extensions.conf. - -
-
-
-CallerID Εκστρατείας - This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID. - -
-
-
-Τηλ.Σύνδεση Εκστρατείας VDAD - Αυτό το πεδίο επιτρέπει γαι μία προσαρμόσιμη VDAD εσωτ.σύνδεση μεταφοράς. Αυτό σας επιτρέπει να χρησιμοποιήσετε διαφορετικές διαδικασίες VDADtransfer.agi, σύμφωνα με την εκστρατεία. Η προκαθορισμένη AGI μεταφορά - εσωτ.σύνδ. 8365 agi VDADtransfer.agi - στέλνει αμέσως τις κλήσεις στον χρήστη, μόλις το σηκώσουν. Ενα πρόσθετο AGI παράεα πολιτικής έρευνας συμπεριλαμβάνεται - 8366 agi - VDADtransferSURVEY.agi - όπου παίζει ένα μήνυμα στο κληθέν πρόσωπο και επιτρέπει να κάνουν επιλογές με τα πλήκτρα. - -
-
-
-Τηλ.Επέκταση εκστρατείας Ηχογρ - αυτό το πεδίο επιτρέπει να ορίσετε μία επέκταση ηχογράφησης που χρησιμοποιείται με το VICIDIAL. Αυτό επιτρέπει να χρησιμοποιήσετε διαφορετικές επεκτάσεις ανάλογα με πόσο χρόνο θέλετε να επιτρέψετε μία ηχογράφηση και ποιο τύπος κωδικοποιητή-αποκωδικοποιητή θα χρησιμοποιηθεί. Η προεπιλογή είναι 8309 και θα καταγράψει με το σχήμα WAV μέχρι μια ώρα. Μια άλλη επιλογή που περιλαμβάνεται στα παραδείγματα είναι 8310 που θα καταγράψουν με το σχήμα GSM για μέχρι μια ώρα. - -
-
-
-Ηχογράφηση εκστρατείας - αυτή η επιλογή επιτρέπει να επιλέξετε το επίπεδο ηχογράφησης σε αυτήν την εκστρατεία. NEVER θα θέσει εκτός λειτουργίας την ηχογράφηση στον πελάτη. ONDEMAND είναι η προεπιλογή και επιτρέπει στον χειριστή να αρχίσει και να σταματήσει όπως απαιτείται. ALLCALLS θα αρχίσει την καταγραφή στον πελάτη όποτε μια κλήση στέλνεται σε έναν χειριστή. - -
-
-
-Όνομα αρχείου ηχογρ εκστρατείας - αυτό το πεδίο επιτρέπει να προσαρμόσετε το όνομα της ηχογράφησης, όταν η ηχογράφηση της εκστρατείας είναι ONDEMAND ή ALLCALLS. Οι μεταβλητές είναι CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. Η προεπιλογή είναι FULLDATE_ΧΕΙΡΙΣΤΗΣκαι θα μοιάζει με το 20051020-103108_6666. Ένα άλλο παράδειγμα είναι CAMPAIGN_TINYDATE_CUSTPHONE που θα μοιάζει με το TESTCAMP_51020103108_3125551212. 50 char max. - -
-
-
-Βοηθός εκστρατείας - αυτές οι επιλογές επιτρέπουν να επιλέξετε τον Βοηθό που θα εμφανιστεί στην οθόνη των χειριστών για αυτήν την εκστρατεία. Επιλέξτε NONE για να μην παρουσιάσετε κανένα χειρόγραφο για αυτήν την εκστρατεία. - -
-
-
-Κατά την έναρξη κλήσης - αυτές οι επιλογές επιτρέπουν να επιλέξετε εάν θέλετε την αυτόματη έναρξη μίας ιστο σελίδας σε ένα διαφορετικό παράθυρο, αυτόματη μετάβαση στον Βοηθό ή τίποτα. - -
-
-
-Μήνυμα αυτόματου τηλεφωνητού - αυτός το πεδίο χρησιμοποιείτε για τις τυφλές κλήσεις μεταφοράς όταν παίρνει ο χειριστής έναν αυτόματο τηλεφωνητή και χτυπά στο πλήκτρο μηνυμάτων αυτόματων τηλεφωνητών στο πλαίσιο διασκέψεων μεταφοράς. Πρέπει το θέσετε αυτό στο dialplan - extensions.conf - και σιγουρευτείτε ότι παίζει ένα αρχείο μουσικής κατόπιν κλείνει το τηλέφωνο. - -
-
-
-AMD στέλνει στο VM - αυτές οι επιλογές επιτρέπουν να καθορίσετε εάν ένα μήνυμα αφήνεται σε έναν αυτόματο τηλεφωνητή όταν ανιχνεύεται ότι η κλήση είναι ένας αυτόματος τηλεφωνητής και εάν το AMD είναι ενεργό. - -
-
-
-Xfer- Συνδ DTMF - αυτά τα τέσσερα πεδία επιτρέπουν να έχετε δύο σύνολα συνδιάσκεψης μεταφοράς και DTMF. Όταν η κλήση ή η εκστρατεία φορτώνεται, ο Βοηθός θα παρουσιάσει δύο πλήκτρα στο πλαίσιο μεταφορά-διασκέψεων και αυτόματα θα παρουσιάσει τα πεδία αριθμό για κλήση και στείλε DTMF όταν πατηθεί. - -
-
-
-Κλήση Εναλ Αρ Χρήστη - Αυτή η επιλογή επιτρέπει στον χειριστή να κάνει χειροκίνητη κλήση του εναλλακτικού αριθμού τηλεφώνου ή το πεδίο address3 μετά την κλήση του κυρίου αριθμού. - -
-
-
-Προγραμματισμένες Επανακλήσεις - Αυτή η επιλογή επιτρέπει στον χειριστή να τερματίσει μία κλήση ως CALLBK και να επιλέξει τα δεδομένα και την ώρα κατά την οποία ο οδηγός θα ξανα-ενεργοποιηθεί. - -
-
-
-Δευτερ. Εγκαταλ. Κλήσης - Ο αριθμός των δευτερολέπτων από την στιγμή που ο πελάτης σηκώνει το τηλ μέχρι η κλήση να θεωρηθεί εγκαταλειμένη. Μόνο για εξερχόμενες κλήσεις . - -
-
-
-Φωνητικό Ταχυδρομείο - Εάν έχει οριστεί, οι κλήσεις που φυσιολογικά θα ΕΓΚΑΤΑΛΕΙΠΟΝΤΑΝ, θα κατευθυνθούν σε αυό το φωνητικό ταχυδρομείο, ώστε να ακούσετε και να αφήσετε ένα μήνυμα. - -
-
-
-Μήνυμα Ασφαλούς Φύλαξης - Εάν είναι Υ θα παίξει ένα μήνυμα στον πελάτη μετά το πέρας των δευτερολέπτων ασφαλούς εγκατάλειψης, χωρίς να μεταφερθεί σε έναν χειριστή. Αυτή η επιλογή υπερβαίνει την αποστολή σε θυρίδα ηχητικού μηνύματος εάν είναι Υ. - -
-
-
-Εσωτ.σύνδεση Ασφαλούς Φύλαξης - Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων, όπου βρίσκεται το ηχητικό αρχείο της Ασφαλής Φύλαξης στον διακομιστή. - -
-
-
-Δευτερ. Τυλίγματος - Ο αριθμός των δευτερολέπτων που αναγκάζει έναν χειριστή να περιμένει πριν του επιτραπεί να λάβει ή να κάνει άλλη κλήση. Ο χρόνος ξεκινάει μόλις τερματίσει μία κλήση. Προκαθορισμένα είναι 0 δευτερ. Αν ο χρόνος περάσει πριν ο χειριστής τερματίσει την κλήση, δεν θα μετακινηθεί στην άλλη κλήση πριν συμβεί αυτό. - -
-
-
-Μήνυμα Τυλίγματος - Αυτό είναι ένα συγκεκριμένο μήνυμα εκστρατείας που εμφανίζεται στην οθόνη τυλίγματος όταν έχει οριστεί ο χρόνος τυλίγματος. - -
-
-
-Μήνυμα Τυλίγματος - Αυτό είναι ένα συγκεκριμένο μήνυμα εκστρατείας που εμφανίζεται στην οθόνη τυλίγματος όταν έχει οριστεί ο χρόνος τυλίγματος. - -
-
-
-Εσωτερικός κατάλογος DNC χρήσης - αυτό καθορίζει εάν αυτή ηεκστρατεία είναι στους μολύβδους φίλτρων ενάντια στον εσωτερικόκατάλογο DNC. Εάν τίθεται το Υ, η χοάνη θα ψάξει κάθετηλεφωνικό αριθμό στον κατάλογο DNC πρίν τοποθετεί τον στηχοάνη. Εάν είναι στον κατάλογο DNC έπειτα θα αλλάξει ότιθέση μολύβδου σε DNCL έτσι που δεν μπορεί να σχηματιστεί. Ηπροεπιλογή είναι ν. - -
-
-
-Εισερχόμενες ομάδες - For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. - - - -



- -VICIDIAL_ΛΙΣΤΕΣ ΠΙΝΑΚΑΣ

-
-
-ID Λίστας - Αυτό είναι το αριθμητικό όνομα της λίστας, δεν μπορεί να διορθωθεί μετά από την αρχική εισαγωγή, πρέπει να περιέχει μόνο αριθμούς και πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες. - -
-
-
-Ονομα Λίστας - Αυτή είναι η περιγραφή της λίστας, πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες. - -
-
-
-Εκστρατεία - Αυτή είναι η εκστρατεία όπου ανήκει η λίστα. Μία λίστα μπορεί μόνο να κληθεί από μία εκστρατεία κάθε φορά. - -
-
-
-Ενεργή - Αυτό ορίζει κατά πόσον η λίστα πρόκειται να κληθεί ή όχι. - -
-
-
-Επαναφορά Κατάστασης-Κλήσης-Καθοδήγησης για την λίστα - Αυτό επαναφέρει τους οδηγούς σε αυτή την λίστα στο Ν σε \"μη κληθέντα από την τελευταία επαναφορά\" και σημαίνει ότι για οποιαδήποτε καθοδήγηση μπορεί να γίνει κλήση εάν είναι η σωστή κατάσταση, όπως ορίσθηκε στην οθόνη τις εκστρατείας. - -
-
-
-Κατάλογος VICIDIAL DNC - αυτό δεν καλεί τον κατάλογοπεριέχει κάθε μόλυβδο που έχει τεθεί μια θέση DNC στοσύστημα. Μέσω των ΚΑΤΑΛΟΓΩΝ - ΠΡΟΣΘΕΣΤΕ τον ΑΡΙΘΜΟ στη σελίδαDNC που είστε σε θέση να προσθέσετε με το χέρι έναν αριθμό σεαυτόν τον κατάλογο έτσι ώστε δεν θα κληθεί από τις εκστρατείεςπου χρησιμοποιούν τον εσωτερικό κατάλογο DNC. - - - -



- -VICIDIAL_INBOUND_GROUPS ΠΙΝΑΚΑΣ

-
-
-ID Ομάδας - Αυτό είναι το σύντομο όνομα της εισερχόμενης ομάδας, δεν μπορεί να διορθωθεί μετά από την αρχική παράδοση, δεν μπορεί να περιέχει κενά και πρέπει να είναι μεταξύ 2 και 20χαρακτήρες. - -
-
-
-Ονομα Ομάδας - Αυτή είναι η περιγραφή της ομάδας, πρέπει να είναι μεταξύ 2 και 30 χαρακτήρες. Δεν μπορεί να συμπεριαμβάνει παύλες, συν ή κενά . - -
-
-
-Χρώμα Ομάδας - Αυτό είναι το χρώμα που εμφανίζεται στην VICIDIAL εφαρμογή όταν η κλήση έρχεται σε αυτή την ομάδα. Πρέπει να είναι μεταξύ 2 και 7 χαρακτήρες. Εάν αυτό είναι ορισμένο ως hex , θα πρέπει να τοποθετήσετε ένα # στην αρχή του κειμένου ή το VICIDIAL δεν θα δουλεύει σωστά. - -
-
-
-Ενεργοποίηση - Αυτό καθορίζει κατά πόσον αυτή η ομάδα εμφανίζεται στο κουτί επιλογής όταν ένας χρήστης συνδέεται. - -
-
-
-Ιστοσελίδα - Αυτή είναι η προσαρμοσμένη διεύθυνση που θα σας κατευθύνει για κλήσεις που έρχονται σε αυ την ομάδα. - -
-
-
-Επόμενη Κλήση Χρήστη - Αυτό προσδιορίζει ποιος χρήστης λαμβάνει την επόμενη κλήση που είναι διαθέσιμη: -
  - random: ταξινομημένο με τυχαία τιμή ενημέρωσης στον πίνακα vicidial_live_agents -
  - oldest_call_start: ταξινομημένο με την τελευταία φορά που σε ένα χρήστη στάλθηκε μία κλήση. Με αποτέλεσμα, ο χρήστης να λαμβάνει συνολικά το ίδιο αριθό κλήσεων. -
  - oldest_call_finish: ταξινομημένο με την τελευταία φορά που ένας χρήστης τελείωσε μία κλήση. Ο χρήστης που περιμένει περισσότερο λαμβάνει την πρώτη κλήση. -
  - overall_user_level: οι διαταγές από το user_level του χειριστή όπως καθορίζεται στα vicidial_users παρουσιάζουν ένα υψηλότερο user_level θα άβουν περισσότερες κλήσεις. - -
-
-
-Οθόνη Μπροστινού - Αυτό το πεδίο καθορίζει κατά πόσον στον VICIDIAL χόμενος χρήστης θα εμφανίζεται το όνομα του μπροστινού - εάν υπάρχει κάποιο - στο πεδίο κατάστασης όταν η κλήση έρχεται στον χρήστη. - -
-
-
-Βοηθός εκστρατείας - αυτές οι επιλογές επιτρέπουν να επιλέξετε τον Βοηθό που θα εμφανιστεί στην οθόνη των χειριστών για αυτήν την εκστρατεία. Επιλέξτε NONE για να μην παρουσιάσετε κανένα χειρόγραφο για αυτήν την εκστρατεία. - -
-
-
-Κατά την έναρξη κλήσης - αυτές οι επιλογές επιτρέπουν να επιλέξετε εάν θέλετε την αυτόματη έναρξη μίας ιστο σελίδας σε ένα διαφορετικό παράθυρο, αυτόματη μετάβαση στον Βοηθό ή τίποτα. - -
-
-
-Xfer- Συνδ DTMF - αυτά τα τέσσερα πεδία επιτρέπουν να έχετε δύο σύνολα συνδιάσκεψης μεταφοράς και DTMF. Όταν η κλήση ή η εκστρατεία φορτώνεται, ο Βοηθός θα παρουσιάσει δύο πλήκτρα στο πλαίσιο μεταφορά-διασκέψεων και αυτόματα θα παρουσιάσει τα πεδία αριθμό για κλήση και στείλε DTMF όταν πατηθεί. - -
-
-
-Δευτερ. Εγκαταλ. Κλήσης - Ο αριθμός των δευτερολέπτων από την στιγμή που ο πελάτης σηκώνει το τηλ μέχρι η κλήση να θεωρηθεί εγκαταλειμένη. Μόνο για εξερχόμενες κλήσεις . - -
-
-
-Φωνητικό Ταχυδρομείο - Εάν έχει οριστεί, οι κλήσεις που φυσιολογικά θα ΕΓΚΑΤΑΛΕΙΠΟΝΤΑΝ, θα κατευθυνθούν σε αυό το φωνητικό ταχυδρομείο, ώστε να ακούσετε και να αφήσετε ένα μήνυμα. - -
-
-
-Μήνυμα Εγκατάλειψης - Εάν είναι Υ θα παίξει ένα μήνυμα στον πελάτη μετά το πέρας των δευτερολέπτων Εγκατάλειψης, χωρίς να μεταφερθεί σε έναν χειριστή. Αυτή η επιλογή υπερβαίνει την αποστολή σε θυρίδα ηχητικού μηνύματος εάν είναι Υ. - -
-
-
-Εσωτ.Σύνδεση Εγκατάλειψης - Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων, όπου βρίσκεται το ηχητικό αρχείο της Εγκατάλειψης στον διακομιστή. - - - -



- -VICIDIAL_REMOTE_AGENTS ΠΙΝΑΚΑΣ

-
-
-Αρχή ID Χρήστη - Αυτό είναι η αρχή του ID Χρήστη που χρησιμοποιείται όταν οι καταχωρήσεις των απομακρυσμένων χρηστών παρεμβάλλονται στο σύστημα. Εάν ο αριθμός των γραμμών είναι μεγαλύτερος από 1, αυτός ο αριθμός αυξάνει κατά ένα μέχρι κάθε γραμμή να έχει μία καταχώρηση. Επιβεβαιώστε, ότι δημιουργήσατε ένα νέο VICIDIAL λογαριασμό η με επίπεδο χρήσης 4 ή μεγαλύτερο, εάν θέλετε να μπορεί να χρησιμοποιήσει την σελίδα vdremote για απομακρυσμένη πρόσβαση του λογαριασμού του. - -
-
-
-Αριθμός Γραμμών - Αυτό ορίζει πόσες καταχωρήσεις απομακρυσμένων χρηστών το σύστημα δημιουρ, και καθορίζει πόσες γραμμές μπορεί με ασφάλεια να στείλει στον αριθμό παρακάτω. - -
-
-
-IP Διακομιστή - Μία καταχώρηση απομακρυσμένου χρήστη είναι μόνο καλό για ένα συγκεκριμένο διακομιστή, εδώ επιλέγετε τον διακομιστή που ανήκει. - -
-
-
-Εξωτερική Τηλ.Σύνδεση - Αυτός είναι ο αριθμός που θέλετε οι κλήσεις να προωθούνται. Επιβεβαιώστε ότι είναι ένας πλήρης αριθμός από το σχέδιο κλήσεων και εάν θέλετε ένα 9 στην αρχή το βάζετε εδώ. Κάντε μία δοκιμή καλώντας αυτόν τον αριθμό από ένα τηλέφωνο του συστήματος. - -
-
-
-Κτάσταση - Εδώ μπορείτε να θέσετε τον απομακρυσμένο χρήστη σε ενεργό και μη ενεργό. Μόλις ο χρήστης γίνει ενεργός το σύστημα μπορεί να στείλει κλήσεις σε αυτόν. Μπορεί να διαρκέσει μέχρι 30 δευτερόλεπτα μετά την αλλαγή της κατάστασης σε μη ενεργός, ώστε να σταματήσει να δέχεται κ. - -
-
-
-Εκστρατεία - Εδώ μπορείτε να επιλέξετε την εκστρατεία όπου οι απομακρυσμένοι χρήστες θα συνδεθούν. Για εισερχόμενες πρέπει να χρησιμοποιηθεί η εκστρατεία CLOSER και επιλέξτε τις εισερχόμενες εκστρατείες παρακάτω, από που θέλετε να λαμβάνεται τις κλήσεις. - -
-
-
-Εισερχόμενες Ομάδες - Εδώ μπορείτε να επιλέξετε τις εισερχόμενες ομάδες που θέλετε να λαμβάνουν τις κλήσεις , εάν έχετε επιλέξει την εκστρατεία CLOSER. - - -



- -VICIDIAL_CAMPAIGN_ΛΙΣΤΕΣ

-
-
-Οι λίστες της εκστρατείας παρουσιάζονται εδώ, και εάν είναι ενεργές (Υ ή Ν) μπορείτε να πάτε στην οθόνη λίστας με το να πατήσετε στο ID λίστας, στην πρώτη στήλη. - - -



- -VICIDIAL_CAMPAIGN_STATUSES ΠΙΝΑΚΑΣ

-
-
-Με την χρήση προσαρμοσμένων καταστάσεων εκστρατείας, μπορείτε να έχετε καταστάσεις μόνο για συγκεκριμένες εκστρατείες. Η κατάσταση πρέπει να είναι 1-8 χαρακτήρες, η περιγραφή 2-30 χαρακτήρες και Επιλέξιμα καθορίζεται αν εμφανίζεται στο VICIDIAL ως τερματισμός. - - - -



- -VICIDIAL_CAMPAIGN_HOTKEYS ΠΙΝΑΚΑΣ

-
-
-Με την χρήση προσαρμοσμένων κλειδιών εκστρατείας, οι χρήστες που χρησιμοποιούν την εφαρμογή vicidial μπορούν να κλείσουν και να τερματίσουν την κλήση, με ένα μόνο πάτημα πλήκτρου. - - - - -



- -VICIDIAL_LEAD_RECYCLE ΠΙΝΑΚΑΣ

-
-
-Μέσω της χρήσης της ανακύκλωσης μολύβδου, μπορείτε να καλέσετετις συγκεκριμένες θέσεις των μολύβδων πάλι σε ένα διευκρινισμένοδιάστημα χωρίς επαναρύθμιση του ολόκληρου καταλόγου. Ηανακύκλωση μολύβδου είναι εκστρατεία-συγκεκριμένη και δεν ειναιαπαραίτητο να είναι μια επιλεγμένη dialable θέση στηνεκστρατεία σας. Ο τομέας καθυστέρησης προσπάθειας είναι οαριθμός δευτερολέπτων έως ότου μπορεί ο μόλυβδος να τοποθετηθείπίσω στη χοάνη, αυτός ο αριθμός πρέπει να είναι τουλάχιστον120 δευτερόλεπτα. Ο μέγιστος τομέας προσπάθειας είναι ομέγιστος αριθμός χρόνων ότι ένας μόλυβδος αυτής της θέσηςμπορεί να προσπαθηθεί προτού να πρέπει να επαναρυθμιστεί οκατάλογος, αυτός ο αριθμός μπορεί να είναι από 1 έως 10.Μπορείτε να ενεργοποιήσετε και να απενεργοποιήσετε μια ανακύκλωσηςείσοδο μολύβδου με τις παρεχόμενες συνδέσεις. Αυτό τοχαρακτηριστικό γνώρισμα λειτουργεί μόνο στον τρόποαυτόματος-πινάκων, όπου το επίπεδο πινάκων είναι μεγαλύτεροαπό 0. - - - - - -



- -VICIDIAL_USER_GROUPS ΠΙΝΑΚΑΣ

-
-
-Ομάδα Χρήστη - Αυτό είναι το σύντομο όνομα της Vicidial ομάδας χρήστη, πρσπαθήστε να μην χρησιμοποιήσετε κενά ή στίξεις για αυτό το πεδίο. Από 2 μέχρι 20 χαρακτήρες. - -
-
-
-Ονομα Ομάδας- Αυτή είναι η περιγραφή της vicidial ομάδας χρήστη μέχρι 40 χαρακτήρες. - - - - - -



- -VICIDIAL_ΒΟΗΘΟΙ ΠΙΝΑΚΑΣ

-
-
-Ταυτότητα Βοηθού - αυτό είναι το σύντομο όνομα ενός Βοπηθού. Πρέπει να είναι ένα μοναδικό προσδιοριστικό. Προσπαθήστε να μην χρησιμοποιήσετε οποιαδήποτε διαστήμα ή στίξη για τους 10 χαρακτήρες αυτού του πεδίου, ελάχιστο 2 χαρακτήρων. - -
-
-Όνομα Βοηθού - αυτός είναι ο τίτλος ενός Βοηθού. Αυτή είναι μια σύντομη περίληψη. 2-50 χαρακτήρες. Δεν πρέπει να υπάρξουν διάστηματα ή στίξεις σε αυτό το πεδίο. - -
-
-Σχόλια Βοηθού - εδώ μπορείτε να τοποθετήσετε τα σχόλια για έναν Βοηθό. 2-255 χαρακτήρες . - -
-
-Κείμενο χειρόγραφου - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today? - -
-
-
-Ενεργός - αυτό καθορίζει εάν αυτός ο οδηγός μπορεί να επιλεχτεί για να χρησιμοποιηθεί από μια εκστρατεία. - - - - - -



- -VICIDIAL_LEAD_ΦΙΛΤΡΑ ΠΙΝΑΚΑΣ

-
-
-ID Φίλτρου - Αυτό είναι το σύντομο όνομα ενός Φίλτρου Οδηγού. Πρέπει να είναι ένας μοναδικός κωδικός. Μην χρησιμοποιήσετε κενά ή στίξη για αυτό το πεδίο. Χαρακτήρες 2 με 10. - -
-
-Ονομα Φίλτρου - Αυτό είναι ένα πιο περιγραφικό όνομα για το Φίλτρο. Είναι μία σύντομη περιγρφή του φίλτρου. Χαρακτήρες 2 με 30. - -
-
-Σχόλια Φίλτρου - Εδώ μπορείτε σχολιάσετε το φίλτρο. Χαρακτήρες 2 με 255. - -
-
-SQL Φίλτρου - Εδώ μπορείτε να ορίσετε SQL ερώτημα για το φίλτρο. Μην ξεκινήσετε ή τελειώσετε με ένα AND, αυτό θα γίνει αυτόματα από τον hopper. Ένα παράδειγμα είναι- called_count > 4 and called_count < 8 -. - - - - - -



- -VICIDIAL_ΧΡΟΝΟΙ ΚΛΗΣΕΩΝ ΠΙΝΑΚΑΣ

-
-
-ID Χρόνου Κλήσης - Αυτό είναι το σύντομο όνομα του Ορισμού Χρόνου Κλήσης. Πρέπει να είναι ένα μοναδικό στοιχείο. Μην χρησιμοποιηθούν διαστήματα ή στίξεις. 2-10 χαρακτήρες. - -
-
-Ονομα Χρόνου Κλήσης - Αυτό είναι ένα πιο περιγραφικό όνομα του Ορισμού Χρόνου Κλήσης. Είναι μία σύντομη περιγραφή. 2-30 χαρακτήρεςΣχόλια Χρόνου Κλήσης - This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters. - -
-
-Σχόλια Χρόνου Κλήσης - This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters. - -
-
-Προκαθορισμένοι Χρόνοι Εκκίνησης και Παύσης - Αυτός είναι ο προκαθορισμένος χρόνος όπου θα επιτρέπετε οι κλήσεις εάν δεν έχει οριστεί ο χρόνος εκκίνησης της ημέρας-της-εβδομάδας. 0 είναι μεσάνυχτα. Εάν δεν θέλετε καμία κλήση θέστε αυτό το πεδίο σε 2400 και το προκαθορισμένο χρόνο Παύσης σε 2400. Για να επιτρέψετε την 24ωρη κλήση την ημέρα θέστε σε 0 τον χρόνο εκκίνησης και σε 2400 τον χρόνο παύσηςWeekday Start and Stop Times -
These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times. - -
-
-Weekday Start and Stop Times - These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times. - -
-
-Ορισμοί Χρόνων Κλήσεων Καταστάσεων - Είναι η λίστα συγκεκριμένων Ορισμών Χρόνων Κλήσεων Καταστάσεων. - -
-
-Κατάσταση Χρόνου Κλήσης Κατάστασης - Αυτό είναι ο δύο γραμμάτων κωδικός για την κατάσταση όπου ο ορισμός χρόνου κλήσης είναι για. Θα πρέπει και οι Οδηγοί της εκστρατείας να έχουν δύο γράμματα κωδικούς κατάστασης για τον χρόνο κλήσης κατάστασης. - - - - -



- -ΛΕΙΤΟΥΡΓΙΑ ΕΙΣΑΓΩΓΗΣ ΛΙΣΤΑΣ

-
-
-Ο VICIDIAL εισαγωγέας οδηγών είναι απλά σχεδιασμένος, ώστε να παίρνει ένα αρχείο - μέχρι 8ΜΒ - που είναι διαχωρισμένο με tab ή pipe και να το φορτώνει στον πίνακα vicidial_list. Υπάρχει επίσης ένας νέος βήτα φορτωτής οδηγών έκδοσης έξοχος που επιτρέπει τον τομέα επιλέγοντας και TXT - σαφές κείμενο, CSV - κόμμα χώρισε τις τιμέ και XLS - σχήματα αρχείων Excel. Ο φορτωτής δεν κάνει εξακρίβωση δεδομένων ή έλεγχο σε διπλές καταχωρήσεις, το οποί είναι κάτι που πρέπει να κάνετε πριν την φόρτωση. Επίσης, διευκρινίστε ότι έχετε δημιουργήσει την λίστα όπου οι οδηγοί θα είναι από κάτω, ώστε να τους χρησιμοποιήστε.Υπάρχει επίσης το θέμα με τις ζώνες κωδικοποίησης χρόνου των οδηγών. Μπορεί να θέλετε να αυξήσετε την συχνότητα όπου το ADMIN_adjust_GMTnow_on_leads.pl τρέχει στον cron, ώστε οποιαδήποτε φόρτωση οδηγών να κωδικοποιείται πιο γρήγορα. Εδώ είναι μία λίστα από πεδία στην πρέπουσα ταξινόμηση για τα αρχεία καθοδήγησης.: -
    -
  1. Κωδικός Οδηγού Προμηθευτού -
  2. Πηγαίος Κώδικας - εσωτερική χρήση μόνο από διαχειριστές και DBAs -
  3. ID λίστας - ο αριθμός λίστας που οι οδηγοί θα παρουσιαστούν κάτω από -
  4. Κωδικός τηλεφώνου - το πρόθεμα του τηλεφωνικού αριθμού (1 για ΗΠΑ, 01144 για Βρετανία κλπ) -
  5. Ο αριθμός τηλεφώνου - πρέπει να είναι τουλάχιστον 8 ψηφία -
  6. Τίτλος - ο τίτλος του πελάτη (κος. κα. κλπ) -
  7. Ονομα -
  8. Μεσαίο Αρχικό -
  9. Επίθετο -
  10. 1 Γραμμή Διεύθυνσης -
  11. 2 Γραμμή Διεύθυνσης -
  12. 3 Γραμμή Διεύθυνσης -
  13. Πόλη -
  14. Κράτος - περιορισμός σε 2 χαρακτήρες -
  15. Επαρχία -
  16. Ταχ.Κωδ. -
  17. Χώρα -
  18. Φύλο -
  19. Ημερ. Γέννησης -
  20. Εναλ. Αριθμός Τηλ. -
  21. Διεύθυνση Ηλεκτρ.Ταχυδρομείου -
  22. Φράση Ασφαλείας -
  23. Σχόλια -
- -
ΣΗΜΕΙΩΣΕΙΣ: Η λειτουργία εισαγωγής οδηγών Excel επιτρέπεται από μια σειρά προγραμμάτων και πρέπει να έχει κατάλληλα διαμορφωμένο ένα αρχείο home/cron/AST_SERVER_conf.pl στον κεντρικό υπολογιστή δικτύου. Επίσης, κάποια υπο-προγράμματα πρέπει να φορτωθούν για να εργαστούν επίσης - OLE- τα Storage_Lite και Spreadsheet-ParseExcel. Μπορείτε να ελέγξετε για λάθη χρόνου εκτέλεσης στο αρχείο error_log του apache σας . - -







-







-ΤΕΛΟΣ -
-\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$dial_status_a = $row[3]; -$dial_status_b = $row[4]; -$dial_status_c = $row[5]; -$dial_status_d = $row[6]; -$dial_status_e = $row[7]; -$local_call_time = $row[16]; -if ($lead_filter_id=='') - { - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') - { - $lead_filter_id='NONE'; - } - } - -$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; -$rslt=mysql_query($stmt, $link); -$lists_to_print = mysql_num_rows($rslt); -$camp_lists=''; -$o=0; -while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; -if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} -} -$camp_lists = eregi_replace(".$","",$camp_lists); - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - -echo "

\n"; -echo "Εμφάνιση Μετρητή Κληθέντων Οδηγών -

\n"; -echo "CAMPAIGN: $campaign_id
\n"; -echo "ΛΙΣΤΕΣ: $camp_lists
\n"; -echo "STATUSES: $dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e
\n"; -echo "FILTER: $lead_filter_id
\n"; -echo "CALL TIME: $local_call_time

\n"; - -### call function to calculate and print dialable leads -dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - -echo "

\n"; -echo "\n"; - -exit; -} - - -###################### -# ADD=7111111 view sample script with test variables -###################### - -if ($ADD==7111111) -{ - ##### TEST VARIABLES ##### - $vendor_lead_code = 'VENDORLEADCODE'; - $list_id = 'LISTID'; - $gmt_offset_now = 'GMTOFFSET'; - $phone_code = '1'; - $phone_number = '7275551212'; - $title = 'Mr.'; - $first_name = 'JOHN'; - $middle_initial = 'Q'; - $last_name = 'PUBLIC'; - $address1 = '1234 Main St.'; - $address2 = 'Apt. 3'; - $address3 = 'ADDRESS3'; - $city = 'CHICAGO'; - $state = 'IL'; - $province = 'PROVINCE'; - $postal_code = '33760'; - $country_code = 'USA'; - $gender = 'M'; - $date_of_birth = '1970-01-01'; - $alt_phone = '3125551212'; - $email = 'test@test.com'; - $security_phrase = 'SECUTIRY'; - $comments = 'COMMENTS FIELD'; - $RGfullname = 'JOE AGENT'; - $RGuser = '6666'; - -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; - -$script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); -$script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); -$script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); -$script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); -$script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); -$script_text = eregi_replace('--A--title--B--',"$title",$script_text); -$script_text = eregi_replace('--A--first_name--B--',"$first_name",$script_text); -$script_text = eregi_replace('--A--middle_initial--B--',"$middle_initial",$script_text); -$script_text = eregi_replace('--A--last_name--B--',"$last_name",$script_text); -$script_text = eregi_replace('--A--address1--B--',"$address1",$script_text); -$script_text = eregi_replace('--A--address2--B--',"$address2",$script_text); -$script_text = eregi_replace('--A--address3--B--',"$address3",$script_text); -$script_text = eregi_replace('--A--city--B--',"$city",$script_text); -$script_text = eregi_replace('--A--state--B--',"$state",$script_text); -$script_text = eregi_replace('--A--province--B--',"$province",$script_text); -$script_text = eregi_replace('--A--postal_code--B--',"$postal_code",$script_text); -$script_text = eregi_replace('--A--country_code--B--',"$country_code",$script_text); -$script_text = eregi_replace('--A--gender--B--',"$gender",$script_text); -$script_text = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$script_text); -$script_text = eregi_replace('--A--alt_phone--B--',"$alt_phone",$script_text); -$script_text = eregi_replace('--A--email--B--',"$email",$script_text); -$script_text = eregi_replace('--A--security_phrase--B--',"$security_phrase",$script_text); -$script_text = eregi_replace('--A--comments--B--',"$comments",$script_text); -$script_text = eregi_replace('--A--fullname--B--',"$RGfullname",$script_text); -$script_text = eregi_replace('--A--user--B--',"$RGuser",$script_text); -$script_text = eregi_replace("\n","
",$script_text); - - -echo ""; - -echo "Προεπισκόπιση Βοηθού: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') {$users_hh='bgcolor ="#FFFF99"'; $users_fc='BLACK';} # yellow - else {$users_hh=''; $users_fc='WHITE';} -if ($hh=='campaigns') {$campaigns_hh='bgcolor ="#FFCC99"'; $campaigns_fc='BLACK';} # orange - else {$campaigns_hh=''; $campaigns_fc='WHITE';} -if ($hh=='lists') {$lists_hh='bgcolor ="#FFCCCC"'; $lists_fc='BLACK';} # red - else {$lists_hh=''; $lists_fc='WHITE';} -if ($hh=='ingroups') {$ingroups_hh='bgcolor ="#CC99FF"'; $ingroups_fc='BLACK';} # purple - else {$ingroups_hh=''; $ingroups_fc='WHITE';} -if ($hh=='remoteagent') {$remoteagent_hh='bgcolor ="#CCFFCC"'; $remoteagent_fc='BLACK';} # green - else {$remoteagent_hh=''; $remoteagent_fc='WHITE';} -if ($hh=='usergroups') {$usergroups_hh='bgcolor ="#CCFFFF"'; $usergroups_fc='BLACK';} # cyan - else {$usergroups_hh=''; $usergroups_fc='WHITE';} -if ($hh=='scripts') {$scripts_hh='bgcolor ="#99FFCC"'; $scripts_fc='BLACK';} # light teal - else {$scripts_hh=''; $scripts_fc='WHITE';} -if ($hh=='filters') {$filters_hh='bgcolor ="#CCCCCC"'; $filters_fc='BLACK';} # grey - else {$filters_hh=''; $filters_fc='WHITE';} -if ($hh=='times') {$times_hh='bgcolor ="#99FF33"'; $times_fc='BLACK';} # hard teal - else {$times_hh=''; $times_fc='WHITE';} - -?> - - - - -\n"; -echo "
English Ελληνικά
- - - - - - - - - - - - - - - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - - - - -
  ΔΙΑΧΕΙΡΙΣΗ - Αποσύνδεση  
> SIZE=1> ΧΡΗΣΤΕΣ > SIZE=1> ΕΚΣΤΡΑΤΕΙΕΣ > SIZE=1> ΛΙΣΤΕΣ > SIZE=1> ΒΟΗΘΟΙ > SIZE=1> ΦΙΛΤΡΑ > SIZE=1> ΕΙΣΕΡΧΟΜΕΝΕΣ ΟΜΑΔΕΣ > SIZE=1> ΧΡΟΝΟΙ ΚΛΗΣΕΩΝ > SIZE=1> ΟΜΑΔΕΣ ΧΡΗΣΤΗ > SIZE=1> ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ > ΑΝΑΦΟΡΕΣ
  ΛΙΣΤΑ ΧΡΗΣΤΩΝ     |     ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΗΣΤΗ     |     ΑΝΑΖΗΤΗΣΗ ΧΡΗΣΤΗ
  ΠΡΟΣΘΗΚΗ ΕΚΣΤΡΑΤΕΙΑΣ     |     ΛΙΣΤΑ ΕΚΣΤΡΑΤΕΙΩΝ
  ΕΜΦΑΝΙΣΗ ΛΙΣΤΩΝ     |     ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΛΙΣΤΑΣ     |     ΑΝΑΖΗΤΗΣΗ ΟΔΗΓΟΥ |     ΠΡΟΣΘΕΣΤΕ ΤΟΝ ΑΡΙΘΜΟ ΣΕ DNC           |     ΕΙΣΑΓΩΓΗ ΝΕΩΝ ΟΔΗΓΩΝ
  ΠΡΟΣΘΕΣΕ ΒΟΗΘΟ     |     ΕΜΦΑΝΙΣΗ ΒΟΗΘΩΝ
  ΠΡΟΣΘΕΣΕ ΦΙΛΤΡΟ     |     ΕΜΦΑΝΙΣΗ ΦΙΛΤΡΩΝ
  ΕΜΦΑΝΙΣΗ ΕΙΣΕΡΧΟΜΕΝΩΝ ΟΜΑΔΩΝ     |     ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΕΙΣΕΡΜΟΜΕΝΗΣ ΟΜΑΔΑΣ
  ΕΜΦΑΝΙΣΗ ΧΡΟΝΩΝ ΚΛΗΣΕΩΝ     |     ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ     |     ΕΜΦΑΝΙΣΗ ΧΡΟΝΩΝ ΚΛΗΣΕΩΝ ΚΑΤΑΣΤΑΣΕΩΝ     |     ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ  
  ΠΡΟΣΘΗΚΗ ΟΜΑΔΑΣ ΧΡΗΣΤΗ     |     ΛΙΣΤΑ ΟΜΑΔΩΝ ΧΡΗΣΤΗ     |     ΩΡΙΑΙΑ ΟΜΔΟΠΟΙΗΣΗ
  ΕΜΦΑΝΙΣΗ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ     |     ΠΡΟΣΘΗΚΗ ΝΕΩΝ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ
 
-
\n"; -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΗΣΤΗ
\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "$NWB#vicidial_users-user_group$NWE\n"; -echo "\n"; -echo "
Αριθμός Χρήστη: $NWB#vicidial_users-user$NWE
Κωδικός:$NWB#vicidial_users-pass$NWE
Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE
Επίπεδο Χρήστη: $NWB#vicidial_users-user_level$NWE
Ομάδα Χρήστη:
Τηλέφωνο Σύνδεσης: $NWB#vicidial_users-phone_login$NWE
Κωδικός Πρόσβασης Τηλεφώνου: $NWB#vicidial_users-phone_pass$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN -###################### - -if ($ADD==11) -{ -echo "
\n"; -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΕΚΣΤΡΑΤΕΙΑΣ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Εκστρατείας: $NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
Ενεργή:$NWB#vicidial_campaigns-active$NWE
Τηλ.σύνδ. Στάθμευσης: $NWB#vicidial_campaigns-park_ext$NWE
Ονομα Αρχείου Στάθμευσης: $NWB#vicidial_campaigns-park_file_name$NWE
Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
Επιτρέπω τους Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
Χρόνος Τοπικής Κλήσης: $NWB#vicidial_campaigns-local_call_time$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_campaigns-voicemail_ext$NWE
Βοηθός: $NWB#vicidial_campaigns-campaign_script$NWE
Κατά την έναρξη κλήσης: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Λίστας: (μόνο αριθμοί)$NWB#vicidial_lists-list_id$NWE
Ονομα Λίστας: $NWB#vicidial_lists-list_name$NWE
Εκστρατεία: $NWB#vicidial_lists-campaign_id$NWE
Ενεργή:$NWB#vicidial_lists-active$NWE
\n"; - -} - - -###################### -# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number -###################### - -if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) - { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC ΠΡΟΣΤΙΘΈΜΕΝΟ - αυτός ο τηλεφωνικός αριθμός είναι ήδη δενκαλεί τον κατάλογο: $phone_number

\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC ΠΡΟΣΤΙΘΈΜΕΝΟ: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); - } - } - } - -echo "
ΠΡΟΣΘΕΣΤΕ έναν ΑΡΙΘΜΟ στον ΚΑΤΑΛΟΓΟ DNC\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Τηλεφωνικός αριθμός: (μόνο αριθμοί)$NWB#vicidial_list-dnc$NWE
\n"; - -} - - -###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN -###################### - -if ($ADD==1111) -{ -echo "
\n"; -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΕΙΣΕΡΧΟΜΕΝΗΣ ΟΜΑΔΑΣ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Ομάδας: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
Χρώμα Ομάδας: $NWB#vicidial_inbound_groups-group_color$NWE
Ενεργή:$NWB#vicidial_inbound_groups-active$NWE
Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Μπροστινή Οθόνη: $NWB#vicidial_inbound_groups-fronter_display$NWE
Βοηθός: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Κατά την έναρξη κλήσης: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN -###################### - -if ($ADD==11111) -{ -echo "
\n"; -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΝΕΩΝ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Χρήστη Ξεκινά: (μόνο αριθμοί, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Αριθμός Γραμμών: (μόνο αριθμοί)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Διακομιστή: $NWB#vicidial_remote_agents-server_ip$NWE
Εξωτερική Τηλ. Σύνδεση: (ο αριθμός που κλήθηκε από το πλάνο κλήσεων για να καλέσει τους χειριστές)$NWB#vicidial_remote_agents-conf_exten$NWE
Κατάσταση:$NWB#vicidial_remote_agents-status$NWE
Εκστρατεία: $NWB#vicidial_remote_agents-campaign_id$NWE
Εισερχόμενες Ομάδες: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "ΣΗΜΕΙΩΣΗ: Μπορεί να διαρκέσει και 30 δευτερόλεπτα για να καταχωρηθούν οι αλλαγές της οθόνης\n"; - -} - - -###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN -###################### - -if ($ADD==111111) -{ -echo "
\n"; -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Ομάδα: (όχι κενά ή στίξη)$NWB#vicidial_user_groups-user_group$NWE
Περιγραφή: (περιγραφή ομάδας)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -} - - -###################### -# ADD=1111111 display the ADD NEW SCRIPT SCREEN -###################### - -if ($ADD==1111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW SCRIPT\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Ταυτότητα χειρογράφων:: (όχι κενά ή στίξη)$NWB#vicidial_scripts-script_id$NWE
Όνομα χειρογράφων: (τίτλος του βοηθού)$NWB#vicidial_scripts-script_name$NWE
Σχόλια χειρόγραφου: $NWB#vicidial_scripts-script_comments$NWE
Ενεργή:$NWB#vicidial_scripts-active$NWE
Κείμενο χειρόγραφου: $NWB#vicidial_scripts-script_text$NWE
\n"; - -} - - -###################### -# ADD=11111111 display the ADD NEW FILTER SCREEN -###################### - -if ($ADD==11111111) -{ -echo "
\n"; -echo ""; - -echo "
ΠΡΟΣΘΕΣΕ ΦΙΛΤΡΟ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Φίλτρου: (όχι κενά ή στίξη)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Όνομα Φίλτρου: (σύντομη περιγραφή του φίλτρου)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Σχόλια Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
SQL Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; -} - - -###################### -# ADD=111111111 display the ADD NEW CALL TIME SCREEN -###################### - -if ($ADD==111111111) -{ -echo "
\n"; -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
ID Χρόνου Κλήσης: (όχι κενά ή στίξη)$NWB#vicidial_call_times-call_time_id$NWE
Ονομα Χρόνου Κλήσης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
Σχόλια Χρόνου Κλήσης: $NWB#vicidial_call_times-call_time_comments$NWE
Οι επιλογές Ημέρας και ώρας θα εμφανιστούν όταν θα δημιουργήσετε τον Ορισμό Χρόνου Κλήσης
\n"; -} - - -###################### -# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN -###################### - -if ($ADD==1111111111) -{ -echo "
\n"; -echo ""; - -echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
ID Χρόνου Κλήσης Κατάστασης: (όχι κενά ή στίξη)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (όχι κενά ή στίξη)$NWB#vicidial_call_times-state_call_time_state$NWE
Ονομα Χρόνου Κλήσης Κατάτασης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
Σχόλια Χρόνου Κλήσης Κατάστασης: $NWB#vicidial_call_times-call_time_comments$NWE
Οι επιλογές Ημέρας και ώρας θα εμφανιστούν όταν θα δημιουργήσετε τον Ορισμό Χρόνου Κλήσης
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 2 series, validates form data and inserts the new record into the database -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=2 adds the new user to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένας χρήστης με αυτό τον αριθμό\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το id χρήστη πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες\n"; - echo "
το πλήρες όνομα και κωδικός πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - echo "
ΧΡΗΣΤΗΣ ΠΡΟΣΤΕΘΗΚΕ: $user\n"; - - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); - } - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new campaign to the system -###################### - -if ($ADD==21) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Η ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη μία εκστρατεία με αυτό το ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) ) - { - echo "
Η ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το ID της εκστρατείας πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες\n"; - echo "
το όνομα της εκστρατείας πρέπει να είναι μεταξύ 6 και 40 χαρακτήρες\n"; - } - else - { - echo "
ΕΚΣΤΡΑΤΕΙΑ ΠΡΟΣΤΕΘΗΚΕ: $campaign_id\n"; - - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch) values('$campaign_id','$campaign_name','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΕΚΣΤΡΑΤΕΙΑΣ |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - } - } -$ADD=31; -} - -###################### -# ADD=22 adds the new campaign status to the system -###################### - -if ($ADD==22) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Η ΚΑΤΑΣΤΑΣΗ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη κατάσταση-εκστρατείας με αυτό το όνομα\n";} - else - { - $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Η ΚΑΤΑΣΤΑΣΗ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη μία καθολική-κατάσταση με αυτό το όνομα\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
Η ΚΑΤΑΣΤΑΣΗ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 8 χαρακτήρρες\n"; - echo "
το όνομα της κατάστασης πρέπει να είναι μεταξύ 2 και 30 χαρακτήρρες\n"; - } - else - { - echo "
ΚΑΤΑΣΤΑΣΗ ΕΚΣΤΡΑΤΕΙΑΣ ΠΡΟΣΤΕΘΗΚΕ: $campaign_id - $status\n"; - - $stmt="INSERT INTO vicidial_campaign_statuses values('$status','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΕΚΣΤΡΑΤΕΙΑΣ STATUS |$PHP_AUTH_USER|$ip|'$status','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } - } -$ADD=31; -} - - -###################### -# ADD=23 adds the new campaign hotkey to the system -###################### - -if ($ADD==23) -{ - $HKstatus_data = explode('-----',$HKstatus); - $status = $HKstatus_data[0]; - $status_name = $HKstatus_data[1]; - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ΤΟ ΚΛΕΙΔΙ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένα κλειδί-εκστρατείας με αυτό το κλειδί\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
ΤΟ ΚΛΕΙΔΙ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το κλειδί πρέπει να είναι ένας χαρακτηράς μεταξύ 1 και 9 \n"; - echo "
η κατάσταση πρέπει να είναι μεταξύ 1 και 8 χαρακτήρρες\n"; - } - else - { - echo "
ΚΛΕΙΔΙ ΕΚΣΤΡΑΤΕΙΑΣ ΠΡΟΣΤΕΘΗΚΕ: $campaign_id - $status - $hotkey\n"; - - $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΕΚΣΤΡΑΤΕΙΑΣ HOTKEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=25 adds the new campaign lead recycle entry to the system -###################### - -if ($ADD==25) -{ - $status = eregi_replace("-----.*",'',$status); - echo ""; - $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ΑΝΑΚΥΚΛΩΣΗΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ ΠΡΟΣΤΙΘΕΜΕΝΟΣ - υπάρχει ήδη έναςμόλυβδος-ανακύκλωσης για αυτήν την εκστρατεία με αυτήν την θέση\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
ΑΝΑΚΥΚΛΩΣΗΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ ΠΡΟΣΤΙΘΕΜΕΝΟΣ - παρακαλώ επιστρέψτεκαι εξετάστε τα στοιχεία που εισαγάγατε\n"; - echo "
η θέση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; - echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα\n"; - echo "
οι μέγιστες προσπάθειες πρέπει να είναι από 1 έως 10\n"; - } - else - { - echo "
ΑΝΑΚΥΚΛΩΣΗΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ ΠΡΟΣΤΙΘΕΜΕΝΟΣ: $campaign_id - $status - $attempt_delay\n"; - - $stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new list to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Η ΛΙΣΤΑ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη μία λίστα με αυτό το ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or (strlen($list_id) < 2) or (strlen($list_id) > 8) ) - { - echo "
Η ΛΙΣΤΑ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Το ID λίστας πρέπει να είναι μεταξύ 2 και 8 χαρακτήρες\n"; - echo "
Το όνομα λίστας πρέπει να είναι 2 χαρακτήρες\n"; - } - else - { - echo "
ΛΙΣΤΑ ΠΡΟΣΤΕΘΗΚΕ: $list_id\n"; - - $stmt="INSERT INTO vicidial_lists values('$list_id','$list_name','$campaign_id','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|'$list_id','$list_name','$campaign_id','$active'|\n"); - fclose($fp); - } - } - } -$ADD=311; -} - - - -###################### -# ADD=2111 adds the new inbound group to the system -###################### - -if ($ADD==2111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Η ΟΜΑΔΑ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη μία ομάδα με αυτό το ID\n";} - else - { - if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) ) - { - echo "
Η ΟΜΑΔΑ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Το ID ομάδας πρέπει να είναι μεταξύ 2 και 20 χαρακτήρες ' -+'.\n"; - echo "
Το όνομα και χρώμα ομάδας πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - echo "
ΟΜΑΔΑ ΠΡΟΣΤΕΘΗΚΕ: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000; -} - - -###################### -# ADD=21111 adds new remote agents to the system -###################### - -if ($ADD==21111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ΟΙ ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΑΝ - υπάρχει ήδη καταχώρηση απομακρυσμένων χειριστών που ξεκινάει με αυτό το ID χρήστη\n";} - else - { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
ΟΙ ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΑΝ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Το ID χρήστη και η εξωτερική εσωτ.σύνδεση πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; - $rslt=mysql_query($stmt, $link); - - echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΠΡΟΣΤΕΘΗΚΑΝ: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } - } - } -$ADD=10000; -} - -###################### -# ADD=211111 adds new user group to the system -###################### - -if ($ADD==211111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ Η ΟΜΑΔΑ ΧΡΗΣΤΗ - υπάρχει ήδη μία καταχώρηση ομάδας χρήστη με αυτό το όνομα\n";} - else - { - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ Η ΟΜΑΔΑ ΧΡΗΣΤΗ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Η ομάδα και η περιγραφή πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="INSERT INTO vicidial_user_groups values('$user_group','$group_name');"; - $rslt=mysql_query($stmt, $link); - - echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΠΡΟΣΤΕΘΗΚΕ: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΧΡΗΣΤΗ GROUP ENTRY |$PHP_AUTH_USER|$ip|'$user_group','$group_name'|\n"); - fclose($fp); - } - } - } -$ADD=100000; -} - -###################### -# ADD=2111111 adds new script to the system -###################### - -if ($ADD==2111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Ο ΒΟΗΘΟΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη μια είσοδος χειρογράφων με αυτό το όνομα\n";} - else - { - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
Ο ΒΟΗΘΟΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το όνομα, η περιγραφή και το κείμενο χειρογράφων πρέπει να είναι τουλάχιστον 2 χαρακτήρες στο μήκος\n"; - } - else - { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; - $rslt=mysql_query($stmt, $link); - - echo "
Ο ΒΟΗΘΟΣ ΠΡΟΣΤΕΘΗΚΕ: $script_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000000; -} - - -###################### -# ADD=21111111 adds new filter to the system -###################### - -if ($ADD==21111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ΤΟ ΦΙΛΤΡΟ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη ένα φίλτρο με αυτό το ID\n";} - else - { - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
ΤΟ ΦΙΛΤΡΟ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
ID φίλτρου, όνομα και SQL πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='$lead_filter_sql';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΤΟ ΦΙΛΤΡΟ ΠΡΟΣΤΕΘΗΚΕ: $lead_filter_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=10000000; -} - - -###################### -# ADD=211111111 adds new call time definition to the system -###################### - -if ($ADD==211111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Ο ΟΡΙΣΜΟΣ ΧΡΟΝΟΥ ΚΛΗΣΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - υπάρχει ήδη μία εγγραφή χρόνου κλήσης με αυτό το ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
Ο ΟΡΙΣΜΟΣ ΧΡΟΝΟΥ ΚΛΗΣΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID Χρόνου Κλήσης και το όνομα πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΠΡΟΣΘΗΚΗ ΧΡΟΝΟΥ ΚΛΗΣΗΣ: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - } -$ADD=311111111; -} - - -###################### -# ADD=2111111111 adds new state call time definition to the system -###################### - -if ($ADD==2111111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
Ο ΟΡΙΣΜΟΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - υπάρχει ήδη μία εγγραφή χρόνου κλήσης με αυτό το ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
Ο ΟΡΙΣΜΟΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ ΔΕΝ ΠΡΟΣΤΕΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID Χρόνου Κλήσης Κατάστασης, το όνομα και η κατάσταση πρέπει να είναι τουλάχιστον 2 χαρακτήρες \n"; - } - else - { - $stmt="INSERT INTO vicidial_state_call_times SET state_call_time_id='$call_time_id',state_call_time_name='$call_time_name',state_call_time_comments='$call_time_comments',state_call_time_state='$state_call_time_state';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΠΡΟΣΘΗΚΗ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=3111111111; -} - - - - -###################################################################################################### -###################################################################################################### -####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below -###################################################################################################### -###################################################################################################### - - - -###################### -# ADD=4A submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4A") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Ο κωδικός και το πλήρες όνομα πρέπει να είναι τουλάχιστον 2 χαρακτήρες το κάθε ένα\n"; - } - else - { - echo "
ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - -###################### -# ADD=4B submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4B") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Ο κωδικός και το πλήρες όνομα πρέπει να είναι τουλάχιστον 2 χαρακτήρες το κάθε ένα\n"; - } - else - { - echo "
ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - - -###################### -# ADD=4 submit user modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
Ο ΧΡΗΣΤΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Ο κωδικός και το πλήρες όνομα πρέπει να είναι τουλάχιστον 2 χαρακτήρες το κάθε ένα\n"; - } - else - { - echo "
ΧΡΗΣΤΗΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - -###################### -# ADD=41 submit campaign modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
Η ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το όνομα της εκστρατείας πρέπει να είναι τουλάχιστον 6 χαρακτήρες\n"; - } - else - { - echo "
ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
ΕΠΑΝΑΦΟΡΑ ΚΑΘΟΘΗΓΗΤΗ ΕΚΣΤΡΑΤΕΙΑΣ HOPPER\n"; - echo "
- Αναμονή 1 λεπτού πριν την κλήση του επόμενου αριθμού\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=42 delete campaign status in the system -###################### - -if ($ADD==42) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
Η ΚΑΤΑΣΤΑΣΗ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το ID της εκστρατείας πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - echo "
η κατάσταση της εκστρατείας πρέπει να είναι τουλάχιστον 1 χαρακτήρας\n"; - } - else - { - echo "
ΔΙΑΓΡΑΦΗΚΕ Η ΠΡΟΣΑΡΜΟΣΜΕΝΗ ΚΑΤΑΣΤΑΣΗ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ: $campaign_id - $status\n"; - - $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=43 delete campaign hotkey in the system -###################### - -if ($ADD==43) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
ΤΟ ΚΛΕΙΔΙ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το ID της εκστρατείας πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - echo "
η κατάσταση της εκστρατείας πρέπει να είναι τουλάχιστον 1 χαρακτήρας\n"; - echo "
το κλειδί της εκστρατείας πρέπει να είναι τουλάχιστον 1 χαρακτήρας\n"; - } - else - { - echo "
ΔΙΑΦΡΑΦΗΚΕ ΤΟ ΠΡΟΣΑΡΜΟΣΜΕΝΟ ΚΛΕΙΔΙ ΤΗΣ ΕΚΣΤΡΑΤΕΙΑΣ: $campaign_id - $status - $hotkey\n"; - - $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=44 submit campaign modifications to the system - Basic View -###################### - -if ($ADD==44) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
Η ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το όνομα της εκστρατείας πρέπει να είναι τουλάχιστον 6 χαρακτήρες\n"; - } - else - { - echo "
ΕΣΤΡΑΤΕΙΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
ΕΠΑΝΑΦΟΡΑ ΚΑΘΟΘΗΓΗΤΗ ΕΚΣΤΡΑΤΕΙΑΣ HOPPER\n"; - echo "
- Αναμονή 1 λεπτού πριν την κλήση του επόμενου αριθμού\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=34; # go to campaign modification form below -} - -###################### -# ADD=45 modify campaign lead recycle in the system -###################### - -if ($ADD==45) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η θέση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; - echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα\n"; - echo "
οι μέγιστες προσπάθειες πρέπει να είναι από 1 έως 10\n"; - } - else - { - echo "
CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=411 submit list modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) - { - echo "
Η ΛΙΣΤΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
η λίστα πρέπει να είναι τουλαχιστον 2 χαρακτήρες\n"; - } - else - { - echo "
ΛΙΣΤΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $list_id\n"; - - $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') - { - echo "
ΕΠΑΝΑΦΟΡΑ ΚΑΤΑΣΤΑΣΗΣ ΚΛΗΣΗΣ ΛΙΣΤΑΣ\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } - } - if ($campaign_id != "$old_campaign_id") - { - echo "
ΑΠΟΜΑΚΡΥΝΣΗ ΚΑΘΟΔΗΓΗΤΩΝ ΛΙΣΤΑΣ HOPPER ΑΠΟ ΠΑΛΑΙΑ HOPPER ΕΚΣΤΡΑΤΕΙΑ ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id'|\n"); - fclose($fp); - } - } - -$ADD=311; # go to list modification form below -} - - -###################### -# ADD=4111 modify in-group info in the system -###################### - -if ($ADD==4111) -{ - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) - { - echo "
Η ΟΜΑΔΑ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
το όνομα και χρώμα ομάδας πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - echo "
ΟΜΑΔΑ ΤΡΟΠΟΠΟΙΗΘΗΚΕ: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_message='$drop_message',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111; # go to in-group modification form below -} - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Το ID του χρήστη και η εξωτερική εσωτ.σύνδεση πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ENTRY |$PHP_AUTH_USER|$ip|set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - } - -$ADD=31111; # go to remote agents modification form below -} - - - -###################### -# ADD=411111 modify user group info in the system -###################### - -if ($ADD==411111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
Η ΟΜΑΔΑ ΧΡΗΣΤΗ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n"; - echo "
Η ομάδα και η περιγραφή πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group'|\n"); - fclose($fp); - } - } - -$ADD=311111; # go to user group modification form below -} - -###################### -# ADD=4111111 modify script in the system -###################### - -if ($ADD==4111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
Ο ΒΟΗΘΟΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το όνομα, η περιγραφή και το κείμενο χειρογράφων πρέπει να είναι τουλάχιστον 2 χαρακτήρες στο μήκος\n"; - } - else - { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
Ο ΒΟΗΘΟΣ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111; # go to script modification form below -} - - -###################### -# ADD=41111111 modify filter in the system -###################### - -if ($ADD==41111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
ΤΟ ΦΙΛΤΡΟ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
ID φίλτρου, όνομα και SQL πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='$lead_filter_sql' where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΤΟ ΦΙΛΤΡΟ ΤΡΟΠΟΠΟΙΗΘΗΚΕ\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31111111; # go to filter modification form below -} - - -###################### -# ADD=411111111 modify call time in the system -###################### - -if ($ADD==411111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
ΧΟΝΟΣ ΚΛΗΣΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID Χρόνου Κλήσης και το όνομα πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΤΡΟΠΟΠΟΙΗΘΗΚΕ ΧΡΟΝΟΣ ΚΛΗΣΗΣ\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - -$ADD=311111111; # go to call time modification form below -} - - -###################### -# ADD=4111111111 modify state call time in the system -###################### - -if ($ADD==4111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID Χρόνου Κλήσης Κατάστασης, το όνομα και η κατάσταση πρέπει να είναι τουλάχιστον 2 χαρακτήρες \n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΤΡΟΠΟΠΟΙΗΘΗΚΕ ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111111; # go to state call time modification form below -} - - - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of user -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) - { - echo "
ΧΡΗΣΤΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΗΣΤΗ: $user\n"; - echo "

Χτυπήστε εδώ για να διαγράψετε το χρήστη $user


\n"; - } - -$ADD='3'; # go to user modification below -} - -###################### -# ADD=51 confirmation before deletion of campaign -###################### - -if ($ADD==51) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) ) - { - echo "
ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Εκστρατεία_id be at least 2 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΕΚΣΤΡΑΤΕΙΑΣ: $campaign_id\n"; - echo "

Χτυπήστε εδώ για να διαγράψετε την εκστρατεία $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=52 confirmation before logging all agents out of campaign of campaign -###################### - -if ($ADD==52) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
ΧΕΙΡΙΣΤΕΣ ΠΟΥ ΔΕΝ ΕΙΝΑΙ ΑΠΟΣΥΝΔΕΜΕΝΟΙ ΑΠΟ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Εκστρατεία_id be at least 2 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΑΠΟΣΥΝΔΕΣΗΣ ΧΕΙΡΙΣΤΩΝ: $campaign_id\n"; - echo "

Επιλέξτε εδώ για να αποσυνδέσετε όλους τους χειριστές από $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=511 confirmation before deletion of list -###################### - -if ($ADD==511) -{ - echo ""; - - if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) ) - { - echo "
ΛΙΣΤΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΛΙΣΤΑΣ: $list_id\n"; - echo "

Χτυπήστε εδώ για να διαγράψετε τον κατάλογο και όλους τους οδηγούς του $list_id


\n"; - } - -$ADD='311'; # go to campaign modification below -} - -###################### -# ADD=5111 confirmation before deletion of in-group -###################### - -if ($ADD==5111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) ) - { - echo "
ΕΙΣ-ΟΜΑΔΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΕΙΣ-ΟΜΑΔΑΣ: $group_id\n"; - echo "

Χτυπήστε εδώ για να διαγράψετε την-ΟΜΑΔΑ $group_id


\n"; - } - -$ADD='3111'; # go to in-group modification below -} - -###################### -# ADD=51111 confirmation before deletion of remote agent record -###################### - -if ($ADD==51111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) ) - { - echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΣ ΧΕΙΡΙΣΤΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ : $remote_agent_id\n"; - echo "

Επιλέξτε εδώ για να διαγράψετε τον απομακρυσμένο χειριστή $remote_agent_id


\n"; - } - -$ADD='31111'; # go to remote agent modification below -} - -###################### -# ADD=511111 confirmation before deletion of user group record -###################### - -if ($ADD==511111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) - { - echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ: $user_group\n"; - echo "

Χτυπήστε εδώ για να διαγράψετε την ομάδα χρηστών $user_group


\n"; - } - -$ADD='311111'; # go to user group modification below -} - -###################### -# ADD=5111111 confirmation before deletion of script record -###################### - -if ($ADD==5111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) ) - { - echo "
ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ Ο ΒΟΗΘΟΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Script_id must be at least 2 characters in length\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΒΟΗΘΟΥ: $script_id\n"; - echo "

επιλέξτε εδώ για να διαγράψετε τον βοηθό $script_id


\n"; - } - -$ADD='3111111'; # go to script modification below -} - -###################### -# ADD=51111111 confirmation before deletion of filter record -###################### - -if ($ADD==51111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) ) - { - echo "
ΤΟ ΦΙΛΤΡΟ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
To ID φίλτρου πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; - echo "

Πατήστε εδώ για διαγραφή του φίλτρου$lead_filter_id


\n"; - } - -$ADD='31111111'; # go to filter modification below -} - -###################### -# ADD=511111111 confirmation before deletion of call time record -###################### - -if ($ADD==511111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
Ο ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID χρόνου κλήσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; - } - -$ADD='311111111'; # go to call time modification below -} - -###################### -# ADD=5111111111 confirmation before deletion of call time record -###################### - -if ($ADD==5111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
Ο ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID χρόνου κλήσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - echo "
ΕΠΙΒΕΒΑΙΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; - } - -$ADD='3111111111'; # go to state call time modification below -} - - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete user record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) - { - echo "
ΧΡΗΣΤΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|user='$user'|\n"); - fclose($fp); - } - echo "
ΔΙΑΓΡΑΦΗ ΧΡΗΣΤΗ ΟΛΟΚΛΗΡΩΘΗΚΕ: $user\n"; - echo "

\n"; - } - -$ADD='0'; # go to user list -} - -###################### -# ADD=61 delete campaign record -###################### - -if ($ADD==61) -{ - echo ""; - - if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) - { - echo "
ΕΚΣΤΡΑΤΕΙΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Εκστρατεία_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
ΑΠΟΜΑΚΡΥΝΣΗ ΚΑΘΟΔΗΓΗΤΩΝ ΛΙΣΤΑΣ HOPPER ΑΠΟ ΠΑΛΑΙΑ HOPPER ΕΚΣΤΡΑΤΕΙΑ ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
ΔΙΑΓΡΑΦΗ ΕΚΣΤΡΑΤΕΙΑΣ ΟΛΟΚΛΗΡΩΘΗΚΕ: $campaign_id\n"; - echo "

\n"; - } - -$ADD='10'; # go to campaigns list -} - -###################### -# ADD=62 Logout all agents fro a campaign -###################### - -if ($ADD==62) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
ΧΕΙΡΙΣΤΕΣ ΠΟΥ ΔΕΝ ΕΙΝΑΙ ΑΠΟΣΥΝΔΕΜΕΝΟΙ ΑΠΟ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Εκστρατεία_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!ΧΕΙΡΙΣΤΗΣLOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
ΑΠΟΣΥΝΔΕΣΗ ΧΕΙΡΙΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $campaign_id\n"; - echo "

\n"; - } - -$ADD='31'; # go to campaign modification below -} - - -###################### -# ADD=65 delete campaign lead recycle in the system -###################### - -if ($ADD==65) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
ΑΝΑΚΥΚΛΩΣΗΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ ΠΟΥ ΔΕΝ ΔΙΑΓΡΑΦΕΤΑΙ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
η θέση πρέπει να είναι μεταξύ 1 και 6 χαρακτήρων στο μήκος\n"; - echo "
η καθυστέρηση προσπάθειας πρέπει να είναι τουλάχιστον 120δευτερόλεπτα\n"; - echo "
οι μέγιστες προσπάθειες πρέπει να είναι από 1 έως 10\n"; - } - else - { - echo "
ΑΝΑΚΥΚΛΩΣΗΣ ΜΟΛΥΒΔΟΥ ΕΚΣΤΡΑΤΕΙΑΣ ΠΟΥ ΔΙΑΓΡΑΦΕΤΑΙ: $campaign_id - $status - $attempt_delay\n"; - - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=611 delete list record and all leads within it -###################### - -if ($ADD==611) -{ - echo ""; - - if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) - { - echo "
ΛΙΣΤΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
ΑΠΟΜΑΚΡΥΝΣΗ ΚΑΘΟΔΗΓΗΤΩΝ ΛΙΣΤΑΣ HOPPER ΑΠΟ ΠΑΛΑΙΑ HOPPER ΕΚΣΤΡΑΤΕΙΑ ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
ΑΦΑΙΡΕΣΗ ΤΩΝ ΜΟΛΥΒΔΩΝ ΚΑΤΑΛΟΓΩΝ ΑΠΟ ΤΟΝ ΠΊΝΑΚΑ VICIDIAL_LIST\n"; - $stmt="DELETE from vicidial_list where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } - echo "
ΔΙΑΓΡΑΦΗ ΛΙΣΤΑΣ ΟΛΟΚΛΗΡΩΘΗΚΕ: $list_id\n"; - echo "

\n"; - } - -$ADD='100'; # go to lists list -} - -###################### -# ADD=6111 delete in-group record -###################### - -if ($ADD==6111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) - { - echo "
ΕΙΣ-ΟΜΑΔΑ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } - echo "
ΔΙΑΓΡΑΦΗ ΕΙΣ-ΟΜΑΔΑΣ ΟΛΟΚΛΗΡΩΘΗΚΕ: $group_id\n"; - echo "

\n"; - } - -$ADD='1000'; # go to in-group list -} - -###################### -# ADD=61111 delete remote agent record -###################### - -if ($ADD==61111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) - { - echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΣ ΧΕΙΡΙΣΤΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - echo "
ΔΙΑΓΡΑΦΗ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $remote_agent_id\n"; - echo "

\n"; - } - -$ADD='10000'; # go to remote agents list -} - -###################### -# ADD=611111 delete user group record -###################### - -if ($ADD==611111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) - { - echo "
ΟΜΑΔΑ ΧΡΗΣΤΗ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } - echo "
ΔΙΑΓΡΑΦΗ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ ΟΛΟΚΛΗΡΩΘΗΚΕ: $user_group\n"; - echo "

\n"; - } - -$ADD='100000'; # go to user group list -} - -###################### -# ADD=6111111 delete script record -###################### - -if ($ADD==6111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) - { - echo "
ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ Ο ΒΟΗΘΟΣ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Script_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } - echo "
ΔΙΑΓΡΑΦΗ ΒΟΗΘΟΥ ΟΛΟΚΛΗΡΩΘΗΚΕ: $script_id\n"; - echo "

\n"; - } - -$ADD='1000000'; # go to script list -} - - -###################### -# ADD=61111111 delete filter record -###################### - -if ($ADD==61111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) - { - echo "
ΤΟ ΦΙΛΤΡΟ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
To ID φίλτρου πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } - echo "
Η ΔΙΑΓΡΑΦΗ ΤΟΥ ΦΙΛΤΡΟΥ ΟΛΟΚΛΗΡΩΘΗΚΕ: $lead_filter_id\n"; - echo "

\n"; - } - -$ADD='10000000'; # go to filter list -} - - -###################### -# ADD=611111111 delete call times record -###################### - -if ($ADD==611111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
Ο ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID χρόνου κλήσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
ΟΛΟΚΛΗΡΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ: $call_time_id\n"; - echo "

\n"; - } - -$ADD='100000000'; # go to call times list -} - - -###################### -# ADD=6111111111 delete call times record -###################### - -if ($ADD==6111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
Ο ΧΡΟΝΟΣ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣΔΕΝ ΔΙΑΓΡΑΦΗΚΕ - Παρακαλώ επιστρέψτε πίσω και κάνετε έλεγχο των δεδομένων που καταχωρήσατε\n"; - echo "
Το ID χρόνου κλήσης πρέπει να είναι τουλάχιστον 2 χαρακτήρες\n"; - } - else - { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; - $rslt=mysql_query($stmt, $link); - $sct_to_print = mysql_num_rows($rslt); - $sct_list=''; - - $o=0; - while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_ids[$o] = "$rowx[0]"; - $sct_states[$o] = "$rowx[1]"; - $o++; - } - $o=0; - - while ($sct_to_print > $o) { - $sct_states[$o] = eregi_replace("\|$call_time_id\|",'|',$sct_states[$o]); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$sct_states[$o]' where call_time_id='$sct_ids[$o]';"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - echo "Απομάκρυνση Κανόνα Κατάστασης: $sct_ids[$o]
\n"; - $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
ΟΛΟΚΛΗΡΩΣΗ ΔΙΑΓΡΑΦΗΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ: $call_time_id\n"; - echo "

\n"; - } - -$ADD='1000000000'; # go to call times list -} - - - - - - -###################################################################################################### -###################################################################################################### -####### 3 series, record modification forms -###################################################################################################### -###################################################################################################### - - - - -###################### -# ADD=3 modify user info in the system -###################### - -if ($ADD==3) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_level = $row[4]; - $user_group = $row[5]; - $phone_login = $row[6]; - $phone_pass = $row[7]; - $delete_users = $row[8]; - $delete_user_groups = $row[9]; - $delete_lists = $row[10]; - $delete_campaigns = $row[11]; - $delete_ingroups = $row[12]; - $delete_remote_agents = $row[13]; - $load_leads = $row[14]; - $campaign_detail = $row[15]; - $ast_admin_access = $row[16]; - $ast_delete_phones = $row[17]; - $delete_scripts = $row[18]; - $modify_leads = $row[19]; - $hotkeys_active = $row[20]; - $change_agent_campaign =$row[21]; - $agent_choose_ingroups =$row[22]; - $scheduled_callbacks = $row[24]; - $agentonly_callbacks = $row[25]; - $agentcall_manual = $row[26]; - $vicidial_recording = $row[27]; - $vicidial_transfers = $row[28]; - $delete_filters = $row[29]; - $alter_agent_interface_options =$row[30]; - $closer_default_blended = $row[31]; - $delete_call_times = $row[32]; - $modify_call_times = $row[33]; - -if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) - { - echo "
Δεν έχετε τις άδειες να τροποποιήσετε αυτόν τον χρήστη: $row[1]\n"; - } -else - { - echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΧΡΗΣΤΩΝ: $row[1]\n"; - if ($LOGuser_level > 8) - {echo "\n";} - else - { - if ($LOGalter_agent_interface == "1") - {echo "\n";} - else - {echo "\n";} - } - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - if ($LOGuser_level > 8) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
Αριθμός Χρήστη: $row[1]$NWB#vicidial_users-user$NWE
Κωδικός:$NWB#vicidial_users-pass$NWE
Πλήρες Ονομα: $NWB#vicidial_users-full_name$NWE
Επίπεδο Χρήστη: $NWB#vicidial_users-user_level$NWE
Ομάδα Χρήστη: $NWB#vicidial_users-user_group$NWE
Τηλέφωνο Σύνδεσης: $NWB#vicidial_users-phone_login$NWE
Κωδικός Πρόσβασης Τηλεφώνου: $NWB#vicidial_users-phone_pass$NWE
ΕΠΙΛΟΓΕΣ ΕΠΙΦΑΝΕΙΑΣ ΕΡΓΑΣΙΑΣ ΧΕΙΡΙΣΤΩΝ:
Ο χειριστής επιλέγει Εισ.Ομάδες: $NWB#vicidial_users-agent_choose_ingroups$NWE
Ενεργά Κλειδιά: $NWB#vicidial_users-hotkeys_active$NWE
Προγραμματισμένες Επανακλήσεις: $NWB#vicidial_users-scheduled_callbacks$NWE
Μόνο του Χειριστή Επανακλήσεις: $NWB#vicidial_users-agentonly_callbacks$NWE
Εγχειρίδιο κλήσεων Χειριστή: $NWB#vicidial_users-agentcall_manual$NWE
Καταγραφή: $NWB#vicidial_users-vicidial_recording$NWE
Μεταφορές: $NWB#vicidial_users-vicidial_transfers$NWE
Η πιό στενή προεπιλογή συνδύασε: $NWB#vicidial_users-closer_default_blended$NWE
Εισερχόμενες Ομάδες: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_users-closer_campaigns$NWE
ΕΠΙΛΟΓΈΣ ΕΠΙΦΑΝΕΙΑΣ ΕΡΓΑΣΙΑΣ ΔΙΑΧ:
Αλλάξτε τις επιλογές επιφάνειας εργασίας των χειριστών: $NWB#vicidial_users-alter_agent_interface_options$NWE
Διάγραψε τους χρήστες: $NWB#vicidial_users-delete_users$NWE
Διάγραψε τις ομάδες χρηστών: $NWB#vicidial_users-delete_user_groups$NWE
Διάγραψε τις Λίστες: $NWB#vicidial_users-delete_lists$NWE
Διάγραψε τις εκστρατείες: $NWB#vicidial_users-delete_campaigns$NWE
Διάγραψε τις Εισ-ΟΜΑΔΕΣ: $NWB#vicidial_users-delete_ingroups$NWE
Διάγραψε τους Απομακρυσμένους Χειριστές: $NWB#vicidial_users-delete_remote_agents$NWE
Διάγραψε τον Βοηθόs: $NWB#vicidial_users-delete_scripts$NWE
Εισαγωγή Οδηγών: $NWB#vicidial_users-load_leads$NWE
Λεπτομέρειες εκστρατείας: $NWB#vicidial_users-campaign_detail$NWE
Πρόσβαση AGC Admin: $NWB#vicidial_users-ast_admin_access$NWE
Το AGC διαγράφει τα τηλέφωνα: $NWB#vicidial_users-ast_delete_phones$NWE
Τροποποίηση Οδηγών: $NWB#vicidial_users-modify_leads$NWE
Αλλαγή Εκστρατείας Χειριστή: $NWB#vicidial_users-change_agent_campaign$NWE
Διαγραφή Φίλτρουs: $NWB#vicidial_users-delete_filters$NWE
Διαγραφή Χρόνου Κλήσηςs: $NWB#vicidial_users-delete_call_times$NWE
Τροποποίηση Χρόνου Κλήσηςs: $NWB#vicidial_users-modify_call_times$NWE
\n"; - - if ($LOGdelete_users > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΟΝ ΤΟΝ ΧΡΗΣΤΗ\n"; - } - echo "

Επιλέξτε εδώ για την σελίδα με τους χρόνους χρήσης\n"; - echo "

Επιλέξτε εδώ για τη κατάσταση του χρήστη\n"; - echo "

Πατήστε εδώ για στατιστικά χρήστη\n"; - echo "

Επιλέξτε εδώ για τις Επανακλήσεις του χρήστη που κρατήθηκαν\n"; - } - -} - - -###################### -# ADD=31 modify campaign info in the system - Detail view -###################### - -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed - -if ($ADD==31) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $campaign_rec_exten = $row[22]; - $campaign_recording = $row[23]; - $campaign_rec_filename = $row[24]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $am_message_exten = $row[27]; - $amd_send_to_vmx = $row[28]; - $xferconf_a_dtmf = $row[29]; - $xferconf_a_number = $row[30]; - $xferconf_b_dtmf = $row[31]; - $xferconf_b_number = $row[32]; - $alt_number_dialing = $row[33]; - $scheduled_callbacks = $row[34]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; - $safe_harbor_exten = $row[38]; - $display_dialable_count = $row[39]; - $wrapup_seconds = $row[40]; - $wrapup_message = $row[41]; -# $closer_campaigns = $row[42]; - $use_internal_dnc = $row[43]; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΕΚΣΤΡΑΤΕΙΩΝ: $row[0] - Βασική Επισκόπηση"; -echo " | Αναλυτική Επισκόπηση | "; -echo "Πραγματικού Χρόνου Οθόνη\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -if (eregi("CLOSER", $campaign_id)) - { - echo "\n"; - } - - - -echo "\n"; -echo "
ID Εκστρατείας: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
Ενεργή:$NWB#vicidial_campaigns-active$NWE
Τηλ.σύνδ. Στάθμευσης: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Ιστο-σελίδα: $NWB#vicidial_campaigns-web_form_address$NWE
Επιτρέπω τους Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Κατάσταση κλήσης1: $NWB#vicidial_campaigns-dial_status$NWE
Κατάσταση κλήσης2: $NWB#vicidial_campaigns-dial_status$NWE
Κατάσταση κλήσης3: $NWB#vicidial_campaigns-dial_status$NWE
Κατάσταση κλήσης4: $NWB#vicidial_campaigns-dial_status$NWE
Κατάσταση κλήσης5: $NWB#vicidial_campaigns-dial_status$NWE
Σειρά Λίστας: $NWB#vicidial_campaigns-lead_order$NWE
Φίλτρο Οδηγού: $NWB#vicidial_campaigns-lead_filter_id$NWE
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_campaigns-next_agent_call$NWE
Χρόνος Τοπικής Κλήσης: $NWB#vicidial_campaigns-local_call_time$NWE
Κλήση εκτός χρόνου: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Πρόθεμα Κλήσης: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
CallerID Εκστρατείας: $NWB#vicidial_campaigns-campaign_cid$NWE
Εκστρατείας VDAD εσωτ.σύνδεση: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Επέκταση εκστρατείας Ηχογρ: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Ηχογράφηση εκστρατείας: $NWB#vicidial_campaigns-campaign_recording$NWE
Όνομα αρχείου εκστρατείας Ηχογρ: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Κατά την έναρξη κλήσης: $NWB#vicidial_campaigns-get_call_launch$NWE
Μήνυμα Αυτόματου Τηλεφωνητή: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD στέλνει στο VM: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
DTMF Μεταφοράς-Συνδ 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Αριθμός Μεταφοράς-Συνδ 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
DTMF Μεταφοράς-Συνδ 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Αριθμός Μεταφοράς-Συνδ 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Κλήση Εναλ Αριθμού: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Προγραμματισμένες Επανακλήσεις: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Δευτερ. Εγκαταλ. Κλήσης: $NWB#vicidial_campaigns-drop_call_seconds$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_campaigns-voicemail_ext$NWE
Χρήση μηνύματος Ασφαλούς Φιλοξενίας: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Εσωτ.Σύνδεση Ασφαλούς Φιλοξενίας: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Δευτερ Τυλίγματος: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Μήνυμα Τυλίγματος: $NWB#vicidial_campaigns-wrapup_message$NWE
Εσωτερικός κατάλογος DNC χρήσης: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Εισερχόμενες ομάδες:
"; - echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; - echo "$groups_list"; - echo "
\n"; - -echo "
\n"; -echo "
ΛΙΣΤΕΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΕΝΕΡΓΑ
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Αυτή η εκστρατεία έχει$active_lists ενεργές λίστες και$inactive_lists Μη ενεργές λίστες

\n"; - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - ΑΠΟΚΡΥΨΗ

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - ΕΜΦΑΝΙΣΗ

"; - } - - - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "Αυτή η εκστρατεία έχει$hopper_leads >οδηγοί στον hopper κλήσεων<

\n"; -echo "Πατήστε εδώ για να δείτε ποιοι οδηγοί είναι στον hopper τώρα

\n"; -echo "Επιλέξτε εδώ για να δείτε τις κρατειμένες Επανακλήσεις σε αυτήν την εκστρατεία

\n"; -echo "
\n"; - - - - -echo "
\n"; -echo "
ΠΡΟΣΑΡΜΟΣΜΕΝΕΣ ΚΑΤΑΣΤΑΣΕΙΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_statuses$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ΚΑΤΑΣΤΑΣΗΠΕΡΙΓΡΑΦΗΕΠΙΛΕΞΙΜΟΔΙΑΓΡΑΦΗ
$rowx[0]$rowx[1]$rowx[2]ΔΙΑΓΡΑΦΗ
\n"; - -echo "
ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΠΡΟΣΑΡΜΟΣΜΕΝΗΣ ΚΑΤΑΣΤΑΣΗΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ
\n"; -echo "\n"; -echo "\n"; -echo "Κατάσταση:   \n"; -echo "Περιγραφή:   \n"; -echo "Επιλέξιμο:   \n"; -echo "
\n"; - -echo "

\n"; - - - -echo "
ΠΡΟΣΑΡΜΟΣΜΕΝΑ ΚΛΕΙΔΙΑ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ΚΛΕΙΔΙΚΑΤΑΣΤΑΣΗΠΕΡΙΓΡΑΦΗΔΙΑΓΡΑΦΗ
$rowx[1]$rowx[0]$rowx[2]ΔΙΑΓΡΑΦΗ
\n"; - -echo "
ΠΡΟΣΘΗΚΗ ΝΕΟΥ ΠΡΟΣΑΡΜΟΣΜΕΝΟΥ ΚΛΕΙΔΙΟΥ ΕΚΣΤΡΑΤΕΙΑΣ
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Κλειδί:   \n"; -echo "Κατάσταση:   \n"; -echo "
\n"; -echo "

\n"; - - - -echo "

ΑΝΑΚΥΚΛΩΣΗ ΜΟΛΥΒΔΟΥ ΜΕΣΑ ΣΕ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_lead_recycle$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $recycle_to_print = mysql_num_rows($rslt); - $o=0; - while ($recycle_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - -echo "
ΚΑΤΑΣΤΑΣΗΚΑΘΥΣΤΕΡΗΣΗ ΠΡΟΣΠΑΘΕΙΑΣΜΕΓΙΣΤΟ ΠΡΟΣΠΑΘΕΙΑΣΕΝΕΡΓΑ ΔΙΑΓΡΑΦΗ
$rowx[2]
\n"; - echo "\n"; - echo "\n"; - echo "
ΔΙΑΓΡΑΦΗ
\n"; - -echo "
ΠΡΟΣΘΕΣΤΕ ΤΟ ΝΕΟ ΜΟΛΥΒΔΟ ΕΚΣΤΡΑΤΕΙΑΣ ΑΝΑΚΥΚΛΩΣΗΣ
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Κατάσταση:   \n"; -echo "Καθυστέρηση προσπάθειας: \n"; -echo "Μέγιστο προσπάθειας: \n"; -echo "
\n"; - -echo "

\n"; - -echo "ΑΠΟΣΥΝΔΕΣΗ ΟΛΩΝ ΤΩΝ ΧΕΙΡΙΣΤΩΝ ΑΠΟ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ

\n"; - -if ($LOGdelete_campaigns > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ\n"; - } - -} - - -###################### -# ADD=34 modify campaign info in the system - Basic View -###################### - -if ($ADD==34) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $display_dialable_count = $row[39]; - -echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Βασική Επισκόπηση | "; -echo "Αναλυτική Επισκόπηση | "; -echo "Πραγματικού Χρόνου Οθόνη\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; -echo "
ID Εκστρατείας: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Ονομα Εκστρατείας: $NWB#vicidial_campaigns-campaign_name$NWE
Ενεργή:$NWB#vicidial_campaigns-active$NWE
Τηλ.σύνδ. Στάθμευσης: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Ιστο-σελίδα: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Επιτρέπω τους Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Κατάσταση κλήσης1: $NWB#vicidial_campaigns-dial_status$NWE
Κατάσταση κλήσης2: $NWB#vicidial_campaigns-dial_status$NWE
Κατάσταση κλήσης3: $NWB#vicidial_campaigns-dial_status$NWE
Κατάσταση κλήσης4: $NWB#vicidial_campaigns-dial_status$NWE
Κατάσταση κλήσης5: $NWB#vicidial_campaigns-dial_status$NWE
Σειρά Λίστας: $NWB#vicidial_campaigns-lead_order$NWE
Φίλτρο Οδηγού: $NWB#vicidial_campaigns-lead_filter_id$NWE
Επίπεδο Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Αναγκαστική Επαναφορά του Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
ΕΠΙΠΕΔΟ ΑΥΤΟΜΑΤΗΣ ΚΛΗΣΗΣ: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Script: $script_id
Κατά την έναρξη κλήσης: $get_call_launch
\n"; - -echo "
\n"; -echo "
ΛΙΣΤΕΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ID ΛΙΣΤΑΣΟΝΟΜΑ ΛΙΣΤΑΣΕΝΕΡΓΑ
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Αυτή η εκστρατεία έχει$active_lists ενεργές λίστες και$inactive_lists Μη ενεργές λίστες

\n"; - - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - ΑΠΟΚΡΥΨΗ

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - ΕΜΦΑΝΙΣΗ

"; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "Αυτή η εκστρατεία έχει$hopper_leads >οδηγοί στον hopper κλήσεων<

\n"; -echo "Πατήστε εδώ για να δείτε ποιοι οδηγοί είναι στον hopper τώρα

\n"; -echo "Επιλέξτε εδώ για να δείτε τις κρατειμένες Επανακλήσεις σε αυτήν την εκστρατεία

\n"; -echo "
\n"; - -echo "
\n"; - -echo "ΑΠΟΣΥΝΔΕΣΗ ΟΛΩΝ ΤΩΝ ΧΕΙΡΙΣΤΩΝ ΑΠΟ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ

\n"; - - -if ($LOGdelete_campaigns > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΕΚΣΤΡΑΤΕΙΑ\n"; - } - - -} - - -###################### -# ADD=311 modify list info in the system -###################### - -if ($ADD==311) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $Cstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($Cstatuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - # end grab status names - - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΛΙΣΤΑΣ: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Λίστας: $row[0]$NWB#vicidial_lists-list_id$NWE
Ονομα Λίστας: $NWB#vicidial_lists-list_name$NWE
Εκστρατεία: $NWB#vicidial_lists-campaign_id$NWE
Ενεργή:$NWB#vicidial_lists-active$NWE
ΕΠΑΝΑΦΟΡΑ ΚΑΤΑΣΤΑΣΗΣ ΚΛΗΣΗΣ ΟΔΗΓΟΥ ΓΙΑ ΤΗΝ ΛΙΣΤΑ: $NWB#vicidial_lists-reset_list$NWE
\n"; - -echo "
\n"; -echo "
ΚΑΤΑΣΤΑΣΕΙΣ ΣΤΗΝ ΛΙΣΤΑ:
\n"; -echo "\n"; -echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $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($rslt); - - $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]] = ($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; - if ($lead_list['count'] > 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 ($dispo == 'CBHOLD') - { - $CLB=""; - $CLE=""; - } - else - { - $CLB=''; - $CLE=''; - } - - echo "\n"; - $o++; - } - } - -echo "\n"; -echo "\n"; - -echo "
ΚΑΤΑΣΤΑΣΗΟΝΟΜΑ ΚΑΤΑΣΤΑΣΗΣΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑ
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
ΣΥΝΟΛΙΚΑ$lead_list[count]

\n"; -unset($lead_list); - - - - - -echo "
\n"; -echo "
ΖΩΝΕΣ ΩΡΑΣ ΣΤΗΝ ΛΙΣΤΑ:
\n"; -echo "\n"; -echo "\n"; - - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - $plus='+'; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $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]] = ($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++; - } - - if ($lead_list['count'] > 0) - { - while (list($tzone,) = each($lead_list[$since_reset])) - { - $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - - if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} - else {$DISPtzone = "$tzone";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - } - } - -echo "\n"; -echo "\n"; - -echo "
GMT OFFSET (τοπικός χρόνος)ΚΛΗΘΕΝΤΑΜΗ ΚΛΗΘΕΝΤΑ
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
ΥΠΟΣΥΝΟΛΑ$lead_list[Y_count]$lead_list[N_count]
ΣΥΝΟΛΙΚΑ$lead_list[count]

\n"; -unset($lead_list); - - - - - - - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; - $rslt=mysql_query($stmt, $link); - $status_called_to_print = mysql_num_rows($rslt); - - $o=0; - $sts=0; - $first_row=1; - $all_called_first=1000; - $all_called_last=0; - while ($status_called_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $leads_in_list = ($leads_in_list + $rowx[2]); - $count_statuses[$o] = "$rowx[0]"; - $count_called[$o] = "$rowx[1]"; - $count_count[$o] = "$rowx[2]"; - $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); - - if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) - { - if ($first_row) {$first_row=0;} - else {$sts++;} - $status[$sts] = "$rowx[0]"; - $status_called_first[$sts] = "$rowx[1]"; - if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} - } - $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); - $status_called_last[$sts] = "$rowx[1]"; - if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} - - $o++; - } - - - - -echo "
\n"; -echo "
ΜΕΤΡΗΣΗ ΚΛΗΣΕΩΝ ΣΤΗΝ ΛΙΣΤΑ:
\n"; -echo "\n"; -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - - $sts=0; - $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 ""; - - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $sts)) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - else - { - if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - - $called_printed=0; - $o=0; - while ($status_called_to_print > $o) - { - if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) - { - $called_printed++; - echo ""; - } - - - $o++; - } - if (!$called_printed) - {echo "";} - $first++; - } - echo "\n\n"; - - $sts++; - } - -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - -echo "
ΚΑΤΑΣΤΑΣΗΟΝΟΜΑ ΚΑΤΑΣΤΑΣΗΣ$firstΥΠΟΣΥΝΟΛΟ
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
ΣΥΝΟΛΙΚΑ$all_called_count[$first]$leads_in_list

\n"; - - - - - -echo "
\n"; - -if ($LOGdelete_lists > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΗ ΤΗΝ ΛΙΣΤΑ\n"; - } - -} - - - -###################### -# ADD=3111 modify in-group info in the system -###################### - -if ($ADD==3111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $group_name = $row[1]; - $group_color = $row[2]; - $active = $row[3]; - $web_form_address = $row[4]; - $voicemail_ext = $row[5]; - $next_agent_call = $row[6]; - $fronter_display = $row[7]; - $script_id = $row[8]; - $get_call_launch = $row[9]; - $xferconf_a_dtmf = $row[10]; - $xferconf_a_number = $row[11]; - $xferconf_b_dtmf = $row[12]; - $xferconf_b_number = $row[13]; - $drop_call_seconds = $row[14]; - $drop_message = $row[15]; - $drop_exten = $row[16]; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΓΓΡΑΦΗΣ ΟΜΑΔΩΝ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -echo "\n"; -echo "
ID Ομάδας: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Ονομα Ομάδας: $NWB#vicidial_inbound_groups-group_name$NWE
Χρώμα Ομάδας: $NWB#vicidial_inbound_groups-group_color$NWE
Ενεργή:$NWB#vicidial_inbound_groups-active$NWE
Ιστο-σελίδα: $NWB#vicidial_inbound_groups-web_form_address$NWE
Επόμενη Κλήση Χειριστή: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Μπροστινή Οθόνη: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Κατά την έναρξη κλήσης: $NWB#vicidial_inbound_groups-get_call_launch$NWE
DTMF Μεταφοράς-Συνδ 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Αριθμός Μεταφοράς-Συνδ 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
DTMF Μεταφοράς-Συνδ 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Αριθμός Μεταφοράς-Συνδ 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Δευτερ. Εγκαταλ. Κλήσης: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Χρήση μηνύματος Εγκατάλειψης: $NWB#vicidial_inbound_groups-drop_message$NWE
Εσωτ. Σύνδεση Εγκατάλειψης: $NWB#vicidial_inbound_groups-drop_exten$NWE
\n"; - -echo "

\n"; - -echo "
\n"; - -if ($LOGdelete_ingroups > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΕΙΣ-ΟΜΑΔΑ\n"; - } - -} - - - -###################### -# ADD=31111 modify remote agents info in the system -###################### - -if ($ADD==31111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΚΑΤΑΧΩΡΗΣΗΣ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Χρήστη Ξεκινά: (μόνο αριθμοί, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Αριθμός Γραμμών: (μόνο αριθμοί)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Διακομιστή: $NWB#vicidial_remote_agents-server_ip$NWE
Εξωτερική Τηλ. Σύνδεση: (ο αριθμός που κλήθηκε από το πλάνο κλήσεων για να καλέσει τους χειριστές)$NWB#vicidial_remote_agents-conf_exten$NWE
Κατάσταση:$NWB#vicidial_remote_agents-status$NWE
Εκστρατεία: $NWB#vicidial_remote_agents-campaign_id$NWE
Εισερχόμενες Ομάδες: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "ΣΗΜΕΙΩΣΗ: Μπορεί να διαρκέσει και 30 δευτερόλεπτα για να καταχωρηθούν οι αλλαγές της οθόνης\n"; - - -if ($LOGdelete_remote_agents > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΟΝ ΤΟΝ ΑΠΟΜΑΚΡΥΣΜΕΝΟ ΧΕΙΡΙΣΤΗ\n"; - } - -} - - -###################### -# ADD=311111 modify user group info in the system -###################### - -if ($ADD==311111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; -echo ""; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΚΑΤΑΧΩΡΗΣΗΣ ΟΜΑΔΑΣ ΧΡΗΣΤΩΝ\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Ομάδα: (όχι κενά ή στίξη)$NWB#vicidial_user_groups-user_group$NWE
Περιγραφή: (περιγραφή ομάδας)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -if ($LOGdelete_user_groups > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΗΝ ΤΗΝ ΟΜΑΔΑ ΧΡΗΣΤΩΝ\n"; - } - -} - - -###################### -# ADD=3111111 modify script info in the system -###################### - -if ($ADD==3111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $script_name = $row[1]; - $script_comments = $row[2]; - $script_text = $row[3]; - $active = $row[4]; -echo ""; - -echo "
ΤΡΟΠΟΠΟΙΗΣΤΕ ΕΝΑΝ ΒΟΗΘΟ\n"; -echo "\n"; -echo "\n"; -echo "
Ταυτότητα χειρογράφων:: $script_id$NWB#vicidial_scripts-script_name$NWE
Όνομα χειρογράφων: (τίτλος του βοηθού)$NWB#vicidial_scripts-script_name$NWE
Σχόλια χειρόγραφου: $NWB#vicidial_scripts-script_comments$NWE
Ενεργή:$NWB#vicidial_scripts-active$NWE
Κείμενο χειρόγραφου:

Προεπισκόπιση Βοηθού
$NWB#vicidial_scripts-script_text$NWE
\n"; - -if ($LOGdelete_scripts > 0) - { - echo "

ΔΙΑΓΡΑΨΕ ΑΥΤΟΝ ΤΟΝ ΒΟΗΘΟ\n"; - } - -} - - -###################### -# ADD=31111111 modify filter info in the system -###################### - -if ($ADD==31111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $lead_filter_name = $row[1]; - $lead_filter_comments = $row[2]; - $lead_filter_sql = $row[3]; -echo ""; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΕΝΟΣ ΦΙΛΤΡΟΥ\n"; -echo "\n"; -echo "\n"; -echo "
ID Φίλτρου: $lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Όνομα Φίλτρου: (σύντομη περιγραφή του φίλτρου)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Σχόλια Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
SQL Φίλτρου: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - -echo "

"; -echo "
ΕΛΕΓΧΟΣ ΣΤΗΝ ΕΚΣΤΡΑΤΕΙΑ:
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -if ($LOGdelete_filters > 0) - { - echo "

ΔΙΑΓΡΑΦΗ ΤΟΥ ΦΙΛΤΡΟΥ\n"; - } - -} - - -###################### -# ADD=321111111 modify call time definition info in the system -###################### - -if ($ADD==321111111) -{ -if ($LOGmodify_call_times==1) -{ - -if ( ($stage=="ADD") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - if (eregi("\|$",$ct_state_call_times)) - {$ct_state_call_times = "$ct_state_call_times$state_rule\|";} - else - {$ct_state_call_times = "$ct_state_call_times\|$state_rule\|";} - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "Προσθήκη Κανόνα Κατάστασης: $state_rule
\n"; - } -if ( ($stage=="REMOVE") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - $ct_state_call_times = eregi_replace("\|$state_rule\|",'|',$ct_state_call_times); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "Απομάκρυνση Κανόνα Κατάστασης: $state_rule
\n"; - } - -$ADD=311111111; -} -else -{ -echo "Δεν έχετε το δικαίωμα για να δείτε την σελίδα. Παρακαλώ επιστρέψτε."; -} - -} - - -###################### -# ADD=311111111 modify call time definition info in the system -###################### - -if ($ADD==311111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -$ct_srs=1; -$b=0; -$srs_SQL =''; -if (strlen($ct_state_call_times)>2) - { - $state_rules = explode('|',$ct_state_call_times); - $ct_srs = ((count($state_rules)) - 1); - } -echo "\n"; -echo "\n"; -while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>0) - { - $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - echo "\n"; - $srs_SQL .= "'$state_rules[$b]',"; - $srs_state_SQL .= "'$row[0]',"; - } - $b++; - } -if (strlen($srs_SQL)>2) - { - $srs_SQL = "$srs_SQL''"; - $srs_state_SQL = "$srs_state_SQL''"; - $srs_SQL = "where state_call_time_id NOT IN($srs_SQL) and state_call_time_state NOT IN($srs_state_SQL)"; - } -else - {$srs_SQL='';} -$stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;"; -$rslt=mysql_query($stmt, $link); -$sct_to_print = mysql_num_rows($rslt); -$sct_list=''; - -$o=0; -while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_list .= "\n"; - $o++; -} -echo "\n"; -echo "\n"; - -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $call_time_name = $row[1]; - $call_time_comments = $row[2]; - $ct_default_start = $row[3]; - $ct_default_stop = $row[4]; - $ct_sunday_start = $row[5]; - $ct_sunday_stop = $row[6]; - $ct_monday_start = $row[7]; - $ct_monday_stop = $row[8]; - $ct_tuesday_start = $row[9]; - $ct_tuesday_stop = $row[10]; - $ct_wednesday_start = $row[11]; - $ct_wednesday_stop = $row[12]; - $ct_thursday_start = $row[13]; - $ct_thursday_stop = $row[14]; - $ct_friday_start = $row[15]; - $ct_friday_stop = $row[16]; - $ct_saturday_start = $row[17]; - $ct_saturday_stop = $row[18]; - $ct_state_call_times = $row[19]; - -echo ""; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΧΡΟΝΟΥ ΚΛΗΣΗΣ\n"; -echo "\n"; -echo "\n"; -echo "
ID Χρόνου Κλήσης: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Ονομα Χρόνου Κλήσης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
Σχόλια Χρόνου Κλήσης: $NWB#vicidial_call_times-call_time_comments$NWE
Προκαθορσμένη Εκκίνηση Προκαθορσμένη Παύση: $NWB#vicidial_call_times-ct_default_start$NWE
Κυριακή Εκκίνηση: Κυριακή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Δευτέρα Εκκίνηση: Δευτέρα Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Τρίτη Εκκίνηση: Τρίτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Τετάρτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Πέμπτη Εκκίνηση: Πέμπτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Παρασκευή Εκκίνηση: Παρασκευή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Σάββατο Εκκίνηση: Σάββατο Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Ενεργοί Ορισμοί Χρόνου Κλήσης Κατάστασης για αυτή την Εγγραφή:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Add state call time rule:


\n"; -echo "ΕΚΣΤΑΤΕΙΕΣ ΠΟΥ ΧΡΗΣΙΜΟΠΟΙΟΥΝ ΑΥΤΟ ΤΟΝ ΧΡΟΝΟ ΚΛΗΣΗΣ:
\n"; -echo "\n"; - - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - $CT_camp_id = $row[1]; - $CT_camp_name = $row[2]; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

ΔΙΑΓΡΑΦΗ ΟΡΙΣΜΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ\n"; - } -} -else -{ -echo "Δεν έχετε το δικαίωμα για να δείτε την σελίδα. Παρακαλώ επιστρέψτε."; -} - -} - - -###################### -# ADD=3111111111 modify state call time definition info in the system -###################### - -if ($ADD==3111111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $state_call_time_state =$row[1]; - $call_time_name = $row[2]; - $call_time_comments = $row[3]; - $ct_default_start = $row[4]; - $ct_default_stop = $row[5]; - $ct_sunday_start = $row[6]; - $ct_sunday_stop = $row[7]; - $ct_monday_start = $row[8]; - $ct_monday_stop = $row[9]; - $ct_tuesday_start = $row[10]; - $ct_tuesday_stop = $row[11]; - $ct_wednesday_start = $row[12]; - $ct_wednesday_stop = $row[13]; - $ct_thursday_start = $row[14]; - $ct_thursday_stop = $row[15]; - $ct_friday_start = $row[16]; - $ct_friday_stop = $row[17]; - $ct_saturday_start = $row[18]; - $ct_saturday_stop = $row[19]; - -echo ""; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ
\n"; -echo "\n"; -echo "\n"; -echo "
ID Χρόνου Κλήσης: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
Ονομα Χρόνου Κλήσης Κατάτασης: (σύντομη περιγραφή του χρόνου κλήσης)$NWB#vicidial_call_times-call_time_name$NWE
Σχόλια Χρόνου Κλήσης Κατάστασης: $NWB#vicidial_call_times-call_time_comments$NWE
Προκαθορσμένη Εκκίνηση Προκαθορσμένη Παύση: $NWB#vicidial_call_times-ct_default_start$NWE
Κυριακή Εκκίνηση: Κυριακή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Δευτέρα Εκκίνηση: Δευτέρα Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Τρίτη Εκκίνηση: Τρίτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Τετάρτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Πέμπτη Εκκίνηση: Πέμπτη Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Παρασκευή Εκκίνηση: Παρασκευή Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE
Σάββατο Εκκίνηση: Σάββατο Παύση: $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; -echo "ΧΡΟΝΟΙ ΚΛΗΣΕΩΝ ΠΟΥ ΧΡΗΣΙΜΟΠΟΙΟΥΝ ΑΥΤΟ ΤΟΝ ΧΡΟΝΟ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ:
\n"; -echo "\n"; - - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

ΔΙΑΓΡΑΦΗ ΟΡΙΣΜΟΥ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ\n"; - } - -} -else -{ -echo "Δεν έχετε το δικαίωμα για να δείτε την σελίδα. Παρακαλώ επιστρέψτε."; -} - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo "
\n"; -echo ""; - -echo "
ΑΝΑΖΗΤΗΣΗ ΧΡΗΣΤΗ\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
Αριθμός Χρήστη:
Πλήρες Ονομα:
Επίπεδο Χρήστη:
Ομάδα Χρήστη:
\n"; - -} - -###################### -# ADD=66 user search results -###################### - -if ($ADD==66) -{ -echo "
\n"; - echo ""; - - $SQL = ''; - if ($user) {$SQL .= " user LIKE \"%$user%\" and";} - if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";} - if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";} - if ($user_group) {$SQL .= " user_group = '$user_group' and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ΑΝΑΖΗΤΗΣΗ ΑΠΟΤΕΛΕΣΜΑΤΩΝ:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ | ΚΑΤΑΣΤΑΣΗ | TIME
\n"; - -} - - -###################################################################################################### -###################################################################################################### -####### 8 series, Callback lists -###################################################################################################### -###################################################################################################### - -###################### -# ADD=8 find all callbacks on hold by a User -###################### -if ($ADD==8) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user='$user' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
USER CALLBACK HOLD LISTINGS: $user\n"; -$ADD='82'; -} - -###################### -# ADD=81 find all callbacks on hold within a Campaign -###################### -if ($ADD==81) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and campaign_id='$campaign_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN CALLBACK HOLD LISTINGS: $campaign_id\n"; -$ADD='82'; -} - -###################### -# ADD=811 find all callbacks on hold within a List -###################### -if ($ADD==811) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and list_id='$list_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; -$ADD='82'; -} - -###################### -# ADD=82 display all callbacks on hold -###################### -if ($ADD==82) -{ -echo "
\n"; -echo "
\n"; -echo "\n"; - - $o=0; - while ($cb_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
LEADLISTCAMPAIGNENTRY ΗΜΕΡΑCALLBACK ΗΜΕΡΑUSERRECIPIENTΚΑΤΑΣΤΑΣΗ
$row[1]$row[2]$row[3]$row[5]$row[6]$row[8]$row[9]$row[4]
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 0 series, displays and searches -###################################################################################################### -###################################################################################################### - -###################### -# ADD=0 display all active users -###################### -if ($ADD==0) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users order by full_name"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ΛΙΣΤΕΣ ΧΡΗΣΤΗ:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ | ΚΑΤΑΣΤΑΣΗ | TIME
\n"; -} - -###################### -# ADD=10 display all campaigns -###################### -if ($ADD==10) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ΕΝΤΑΓΜΕΝΕΣ ΕΚΣΤΡΑΤΕΙΕΣ:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - -###################### -# ADD=100 display all lists -###################### -if ($ADD==100) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists order by list_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ΕΝΤΑΓΜΕΝΕΣ ΛΙΣΤΕΣ:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]  ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - - -###################### -# ADD=1000 display all inbound groups -###################### -if ($ADD==1000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ΕΝΤΑΓΜΕΝΕΣ ΕΙΣΕΡΧΟΜΕΝΕΣ ΟΜΑΔΕΣ:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[5]  ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - -###################### -# ADD=10000 display all remote agents -###################### -if ($ADD==10000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ΕΝΤΑΓΜΕΝΟΙ ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - -###################### -# ADD=100000 display all user groups -###################### -if ($ADD==100000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ΕΝΤΑΓΜΕΝΕΣ ΟΜΑΔΕΣ ΧΡΗΣΤΗ:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - -###################### -# ADD=1000000 display all scripts -###################### -if ($ADD==1000000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ΛΙΣΤΕΣ ΒΟΗΘΩΝ:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - -###################### -# ADD=10000000 display all filters -###################### -if ($ADD==10000000) -{ -echo "\n";echo "\n";?> -
-
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
ΛΙΣΤΕΣ ΟΔΗΓΟΥ ΦΙΛΤΡΟΥ:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - -###################### -# ADD=100000000 display all call times -###################### -if ($ADD==100000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
ΛΙΣΤΕΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[4] ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - -###################### -# ADD=1000000000 display all state call times -###################### -if ($ADD==1000000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
ΛΙΣΤΕΣ ΧΡΟΝΟΥ ΚΛΗΣΗΣ ΚΑΤΑΣΤΑΣΗΣ:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] ΤΡΟΠΟΠΟΙΗΣΗ
\n"; -} - - - - - -echo "
\n"; - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds"; -echo "             ΕΚΔΟΣΗ: $version"; -echo "             ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - - -?> - - -
- - - -1) - { - $g=0; - $p='13'; - $GMT_gmt[0] = ''; - $GMT_hour[0] = ''; - $GMT_day[0] = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $pmin=(gmdate("i", time() + $pzone)); - $phour=( (gmdate("G", time() + $pzone)) * 100); - $pday=gmdate("w", time() + $pzone); - $tz = sprintf("%.2f", $p); - $GMT_gmt[$g] = "$tz"; - $GMT_day[$g] = "$pday"; - $GMT_hour[$g] = ($phour + $pmin); - $p = ($p - 0.25); - $g++; - } - - $stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $Gct_default_start = "$rowx[3]"; - $Gct_default_stop = "$rowx[4]"; - $Gct_sunday_start = "$rowx[5]"; - $Gct_sunday_stop = "$rowx[6]"; - $Gct_monday_start = "$rowx[7]"; - $Gct_monday_stop = "$rowx[8]"; - $Gct_tuesday_start = "$rowx[9]"; - $Gct_tuesday_stop = "$rowx[10]"; - $Gct_wednesday_start = "$rowx[11]"; - $Gct_wednesday_stop = "$rowx[12]"; - $Gct_thursday_start = "$rowx[13]"; - $Gct_thursday_stop = "$rowx[14]"; - $Gct_friday_start = "$rowx[15]"; - $Gct_friday_stop = "$rowx[16]"; - $Gct_saturday_start = "$rowx[17]"; - $Gct_saturday_stop = "$rowx[18]"; - $Gct_state_call_times = "$rowx[19]"; - - $ct_states = ''; - $ct_state_gmt_SQL = ''; - $ct_srs=0; - $b=0; - if (strlen($Gct_state_call_times)>2) - { - $state_rules = explode('|',$Gct_state_call_times); - $ct_srs = ((count($state_rules)) - 2); - } - while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>1) - { - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Gstate_call_time_id = "$row[0]"; - $Gstate_call_time_state = "$row[1]"; - $Gsct_default_start = "$row[4]"; - $Gsct_default_stop = "$row[5]"; - $Gsct_sunday_start = "$row[6]"; - $Gsct_sunday_stop = "$row[7]"; - $Gsct_monday_start = "$row[8]"; - $Gsct_monday_stop = "$row[9]"; - $Gsct_tuesday_start = "$row[10]"; - $Gsct_tuesday_stop = "$row[11]"; - $Gsct_wednesday_start = "$row[12]"; - $Gsct_wednesday_stop = "$row[13]"; - $Gsct_thursday_start = "$row[14]"; - $Gsct_thursday_stop = "$row[15]"; - $Gsct_friday_start = "$row[16]"; - $Gsct_friday_stop = "$row[17]"; - $Gsct_saturday_start = "$row[18]"; - $Gsct_saturday_stop = "$row[19]"; - - $ct_states .="'$Gstate_call_time_state',"; - - $r=0; - $state_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday τοπικός χρόνος - { - if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday τοπικός χρόνος - { - if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday τοπικός χρόνος - { - if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday τοπικός χρόνος - { - if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday τοπικός χρόνος - { - if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday τοπικός χρόνος - { - if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday τοπικός χρόνος - { - if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - $state_gmt = "$state_gmt'99'"; - $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; - } - - $b++; - } - if (strlen($ct_states)>2) - { - $ct_states = eregi_replace(",$",'',$ct_states); - $ct_statesSQL = "and state NOT IN($ct_states)"; - } - else - { - $ct_statesSQL = ""; - } - - $r=0; - $default_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday τοπικός χρόνος - { - if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday τοπικός χρόνος - { - if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday τοπικός χρόνος - { - if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday τοπικός χρόνος - { - if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday τοπικός χρόνος - { - if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday τοπικός χρόνος - { - if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday τοπικός χρόνος - { - if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - - $default_gmt = "$default_gmt'99'"; - $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; - - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL"; - #$DB=1; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rslt_rows = mysql_num_rows($rslt); - if ($rslt_rows) - { - $rowx=mysql_fetch_row($rslt); - $active_leads = "$rowx[0]"; - } - else {$active_leads = '0';} - - echo "Αυτή η εκστρατεία έχει$active_leads οδηγοί που καλούντε στις λίστες\n"; - } - else - { - echo "δεν έχουν επιλεχθεί ενεργές λίστες για την εκστρατεία\n"; - } - } -else - { - echo "δεν έχουν επιλεχθεί ενεργές λίστες για την εκστρατεία\n"; - } -##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### -} -?> diff --git a/LANG_admin/vicidial_el/admin_modify_lead.php b/LANG_admin/vicidial_el/admin_modify_lead.php deleted file mode 100644 index 73160d10..00000000 --- a/LANG_admin/vicidial_el/admin_modify_lead.php +++ /dev/null @@ -1,476 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} -if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} - elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} -if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} - elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} -if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} - elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} - elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead - -# CHANGES -# -# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user -# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60609-1112 - Added DNC list addition if status changed to DNC -# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat -# - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -ΔΙΑΧΕΙΡΙΣΗ: Τροποποίηση οδηγού - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "οι πληροφορίες τροποποιήθηκαν

\n"; - echo "\n"; - - if ( ($dispo != $status) and ($dispo == 'CBHOLD') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - - if ( ($dispo != $status) and ($status == 'DNC') ) - { - ### add lead to the internal DNC list - $stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; - } - -} -else -{ - - if ($CBchangeUSERtoANY == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to ANYONE
\n"; - } - if ($CBchangeUSERtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record user changed to $CBuser
\n"; - } - if ($CBchangeANYtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; - } - - - - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Πληροφορίες Κλήσης: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID Λίστας: $list_id
Ονομα:   \n"; - echo " Επίθετο:
Διεύθυνση 1 :
Διεύθυνση 2 :
Διεύθυνση 3 :
Πόλη :
Κράτος:   \n"; - echo "Ταχ.Κωδ.
Χώρα :
Εναλ Τηλέφωνο :
Ασφάλεια :
Σχόλια :
Τερματισμός:
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select * from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } - - - - - - - } - else - { - echo "ΑΠΟΤΥΧΙΑ ψαξίματος καθοδήγησης για lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - -echo "

\n"; - -echo "
\n"; - -echo "Κλήσεις για αυτόν τον οδηγό:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD
$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial_el/admin_search_lead.php b/LANG_admin/vicidial_el/admin_search_lead.php deleted file mode 100644 index c1903336..00000000 --- a/LANG_admin/vicidial_el/admin_search_lead.php +++ /dev/null @@ -1,224 +0,0 @@ - LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php -# -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead -# -# changes: -# 60620-1055 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - Changed results to multi-record -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -ΔΙΑΧΕΙΡΙΣΗ: Αναζήτηση Οδηγού - -Ψάξιμο Καθοδήγησης - - - -
\n"; - echo "
\n"; - echo "\n"; - echo "Παρακαλώ καταχωρήστε:
Vendor ID(αυτόματος κωδικός καθοδήγησης): or \n"; - echo "
ένας αριθμός τηλεφώνου σπιτιού or\n"; - echo "
ID οδηγού

\n"; - echo "
\n"; - echo "\n
\n"; - echo "\n"; - exit; - } - -else - { - - if ($vendor_id) - { - $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000"; - } - else - { - if ($phone) - { - $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000"; - } - else - { - if ($lead_id) - { - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000"; - } - else - { - print "ERROR: you must search for something! Go back and search for something"; - exit; - } - } - } - if ($DB) - { - echo "\n\n$stmt\n\n"; - } - - $rslt=mysql_query($stmt, $link); - $results_to_print = mysql_num_rows($rslt); - if ($results_to_print < 1) - { - echo date("l F j, Y G:i:s A"); - echo "\n

\n"; - echo "Οι μεταβλητές αναζήτησης που καταχωρήσατε δεν είναι ενεργές στο σύστημα

\n"; - echo "Παρακαλώ, επιστρέψτε πίσω και ελέγξτε τις πληροφορίες που καταχωρήσατε και προσπαθήστε πάλι\n"; - echo "
\n"; - echo "\n"; - exit; - } - else - { - echo "RESULTS: $results_to_print

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $o=0; - while ($results_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $o++; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "
#LEAD IDΚΑΤΑΣΤΑΣΗVENDOR IDLAST AGENTID ΛΙΣΤΑΣPHONEΟΝΟΜΑCITYSECURITYLAST CALL
$o$row[0]$row[3]$row[5]$row[4]$row[7]$row[11]$row[13] $row[15]$row[19]$row[28]$row[2]
\n"; - } - } - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\nΝΕΑ ΑΝΑΖΗΤΗΣΗ"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds"; - - -?> - - - - - diff --git a/LANG_admin/vicidial_el/count.htm b/LANG_admin/vicidial_el/count.htm deleted file mode 100644 index 51f8a361..00000000 --- a/LANG_admin/vicidial_el/count.htm +++ /dev/null @@ -1 +0,0 @@ - diff --git a/LANG_admin/vicidial_el/dbconnect.php b/LANG_admin/vicidial_el/dbconnect.php deleted file mode 100644 index fb6d5917..00000000 --- a/LANG_admin/vicidial_el/dbconnect.php +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/LANG_admin/vicidial_el/group_hourly_stats.php b/LANG_admin/vicidial_el/group_hourly_stats.php deleted file mode 100644 index fa64248e..00000000 --- a/LANG_admin/vicidial_el/group_hourly_stats.php +++ /dev/null @@ -1,252 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1014 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];} - elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$date_with_hour_default = date("Y-m-d H"); -$date_no_hour_default = $TODAY; - -if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} - $date_no_hour = $date_with_hour; - $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - -# $stmt="SELECT full_name from vicidial_users where user='$user';"; -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# $full_name = $row[0]; - - } - - - - -?> - - -ΔΙΑΧΕΙΡΙΣΗ: Ομαδοποιημένα Ωριαία Στατιστικά -\n"; -?> - - -
- - - - - -= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDtotal[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDday[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDcount[$o] = "$row[0]"; - $o++; - } - -echo "
  ΔΙΑΧΕΙΡΙΣΗ: Ομαδοποιημένα Ωριαία Στατιστικά  
\n"; - -echo "
\n"; - -echo "ΜΕΤΡΗΣΗ ΩΡΩΝ TSR: $group | $status | $date_with_hour | $date_no_hour\n"; - -echo "
\n"; -echo "\n"; - - $day_calls=0; - $hour_calls=0; - $total_calls=0; - $o=0; - while($o < $tsrs_to_print) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $VDtotal[$o]); - $hour_calls = ($hour_calls + $VDcount[$o]); - $day_calls = ($day_calls + $VDday[$o]); - - $o++; - } - -echo "\n"; - - -} - -echo "
TSR ID   $status   ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ   $status DAY    
$VDuser[$o] $VDname[$o] $VDcount[$o] $VDtotal[$o] $VDday[$o]ΤΡΟΠΟΠΟΙΗΣΗ | ΣΤΑΤΙΣΤΙΚΑ
TOTAL $status $hour_calls $total_calls $day_calls
\n"; -echo "

\n"; - - - echo "
Παρακαλώ, καταχωρήστε την ομάδα για την οποία θέλετε στατιστικά ανά ώρα:
\n"; - echo "\n"; - echo "group:
\n"; - echo "status:   (example: XFER)
\n"; - echo "date with hour:   (example: 2004-06-25 14)
\n"; - echo "\n"; - echo "


\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_el/help.gif b/LANG_admin/vicidial_el/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/vicidial_el/help.gif and /dev/null differ diff --git a/LANG_admin/vicidial_el/htglobalize.php b/LANG_admin/vicidial_el/htglobalize.php deleted file mode 100644 index 72a10e1f..00000000 --- a/LANG_admin/vicidial_el/htglobalize.php +++ /dev/null @@ -1,23 +0,0 @@ - $value){ - ${$key} = $value; - global ${$key};// = $value; - } - -} -array_conv($_GET); -array_conv($_POST); -array_conv($_SERVER); - -?> \ No newline at end of file diff --git a/LANG_admin/vicidial_el/listloader.php b/LANG_admin/vicidial_el/listloader.php deleted file mode 100644 index 2005942c..00000000 --- a/LANG_admin/vicidial_el/listloader.php +++ /dev/null @@ -1,698 +0,0 @@ - LICENSE: GPLv2 -# -# AST Web GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1006 - added listID override and gmt_offset lookup while loading -# 60619-1652 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -# - -$version = '1.1.12'; -$build = '60619-1652'; - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];} -$list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]; if (!$ΕΠΙΒΕΒΑΙΩΣΗ) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - - -#$DB=1; -#$DBX=1; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('listloader.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"ΒΟΗΘΕΙΑ\""; - - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -?> - - - - - - method=post enctype="multipart/form-data"> -
- - - - - - - - - - - - - -
Εισαγωγή οδηγών από αυτό το αρχείο:
ID Λίστας Override: (μόνο αριθμοί or leave blank for values in the file)
ΕΠΙΛΕΞΤΕ ΕΔΩ ΓΙΑ ΝΑ ΠΑΤΕ ΣΤΟΝ ΠΡΟΗΓΜΕΝΟ ΕΙΣΑΓΩΓΕΑ ΟΔΗΓΩΝ (BETA ΕΚΔΟΣΗ)     ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ
- -document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - $pulldate=date("Y-m-d H:i:s"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("./vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Επεξεργασία$delim_name-delimited file... ($tab_count|$pipe_count)\n"; - - if (strlen($list_id_override)>0) - { - print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city = $row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) - { - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $gmt_offset = '0'; - $called_since_last_reset='N'; - - if (strlen($list_id_override)>0) - { - # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =='1') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### MEXICO ### - if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### AUSTRALIA ### - if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
Λάθος: Το αρχείο δεν έχει τον απαιτούμενο αριθμό πεδίων.
"; - } - print ""; -} else if (filesize($leadfile)>8388608) { - print "
Λάθος: Το αρχείο ξεπέρασε το όριο των 8ΜΒ.
"; -} -?> - - diff --git a/LANG_admin/vicidial_el/listloaderMAIN.php b/LANG_admin/vicidial_el/listloaderMAIN.php deleted file mode 100644 index 6960cfa6..00000000 --- a/LANG_admin/vicidial_el/listloaderMAIN.php +++ /dev/null @@ -1,79 +0,0 @@ - LICENSE: GPLv2 -# -# this is the main frame page for the lead loading section. This is where you -# would upload a file and have it inserted into vicidial_list -# -# changes: -# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - -VICIDIAL: Υπομονάδα εισαγωγής οδηγών - - - - - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/listloader_stmts.txt b/LANG_admin/vicidial_el/listloader_stmts.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/LANG_admin/vicidial_el/new_listloader_superL.php b/LANG_admin/vicidial_el/new_listloader_superL.php deleted file mode 100644 index 4796e269..00000000 --- a/LANG_admin/vicidial_el/new_listloader_superL.php +++ /dev/null @@ -1,1364 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60113-1603 - Fixed a few bugs in Excel import -# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1240 - added listID override -# 60616-1604 - added gmt lookup for each lead -# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. - -$version = '1.1.12-1'; -$build = '60619-1651'; - - -require("dbconnect.php"); - -### links used for testing -#$link=mysql_connect("10.10.10.15", "cron", "1234"); -#mysql_select_db("asterisk"); -#$WeBServeRRooT = '/home/www/htdocs'; - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} - elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} -if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} - elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} -if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} - elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} -if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} - elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} -if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} - elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} -if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} - elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} -if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} - elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} -if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} - elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} -if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} - elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} -if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} - elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} -if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} - elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} -if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} - elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} -if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} - elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} -if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} - elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} -if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} - elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} -if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} - elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} -if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} - elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} -if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} - elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} -if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} - elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} -if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} - elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} -if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} - elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} -if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} - elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} -if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} - elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} -if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} - elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} -if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} - elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} -if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} - elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} -if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} - elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} -if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} - elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); - -# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"ΒΟΗΘΕΙΑ\""; - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -function macfontfix($fontsize) { - - $browser = getenv("HTTP_USER_AGENT"); - $pctype = explode("(", $browser); - if (ereg("Mac",$pctype[1])) { - /* Browser is a Mac. If not Netscape 6, raise fonts */ - - $blownbrowser = explode('/', $browser); - $ver = explode(' ', $blownbrowser[1]); - $ver = $ver[0]; - if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); - - } else return $fontsize; /* Browser is not a Mac - don't touch fonts */ -} - -echo "\n"; - -?> - - - -ΔΙΑΧΕΙΡΙΣΗ: Super Lead Loader - - -
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - - - - - - - - - - - - - - - - - - - - -
Εισαγωγή οδηγών από αυτό το αρχείο:
ID Λίστας Override: (μόνο αριθμοί or leave blank for values in the file)
Μορφή αρχείων για χρήση:Τυποποιημένο VICIDIAL    Εμφάνιση συνήθειας
        
ΕΠΙΛΕΞΤΕ ΕΔΩ ΓΙΑ ΝΑ ΠΑΤΕ ΣΤΟ ΒΑΣΙΚΟ ΕΙΣΑΓΩΓΕΑ ΟΔΗΓΩΝ         ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ
ΠΡΟΗΓΜΕΝΟΣ ΕΙΣΑΓΩΓΕΑΣ ΛΙΣΤΩΝ-     ΕΚΔΟΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:
- - -document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - $total=0; $good=0; $bad=0; - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Επεξεργασία$delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - - if (strlen($list_id_override)>0) - { - # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
Λάθος: Το αρχείο δεν έχει τον απαιτούμενο αριθμό πεδίων.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - print "
ΕπεξεργασίαExcel file... \n"; - if (strlen($list_id_override)>0) - { - print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

\n"; - } - # print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override"); - } else { - # copy($leadfile, "./vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
ΕπεξεργασίαCSV file... \n"; - if (strlen($list_id_override)>0) - { - print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - } - print ""; - } - -if ($leadfile && filesize($LF_path)<=8388608) { - $total=0; $good=0; $bad=0; - if ($file_layout=="standard") { - - print ""; - flush(); - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Επεξεργασία$delim_name-delimited file... ($tab_count|$pipe_count)\n"; - if (strlen($list_id_override)>0) - { - print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - } - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
Λάθος: Το αρχείο δεν έχει τον απαιτούμενο αριθμό πεδίων.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
ΕπεξεργασίαCSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } - print ""; - - } else { - print "
"; - flush(); - print "\r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Επεξεργασία$delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - } - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
ΕπεξεργασίαCSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - $total=0; $good=0; $bad=0; - $row=fgetcsv($file, 1000, ","); - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print "
VICIDIAL ΣτήληΑρχεία δεδομένων
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
        
\r\n"; - # } - print ""; - } -} else if (filesize($leadfile)>8388608) { - print "
Λάθος: Το αρχείο ξεπέρασε το όριο των 8ΜΒ.
"; -} -?> - - - - - - - - - 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### MEXICO ### -if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### AUSTRALIA ### -if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### ALL OTHER COUNTRY CODES ### -if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - -### Find out if DST to raise the gmt offset ### -$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); -$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - -$AC_processed=0; -if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # τοπικός χρόνος calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } -if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - -return $gmt_offset; -} \ No newline at end of file diff --git a/LANG_admin/vicidial_el/project_auth_entries.txt b/LANG_admin/vicidial_el/project_auth_entries.txt deleted file mode 100644 index 805a9ec1..00000000 --- a/LANG_admin/vicidial_el/project_auth_entries.txt +++ /dev/null @@ -1,114 +0,0 @@ -VICIDIAL|GOOD|Tue, 22 Nov 2005 14:58:40 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:02:51 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:03:00 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:03:10 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:03:12 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:05:07 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:05:10 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:28:49 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:30:11 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:30:15 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:06:49 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:07:13 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:07:17 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:07:21 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Fri, 23 Dec 2005 14:39:30 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:43 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:45 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:46 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 03 Mar 2006 16:14:21 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:03:10 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:03:15 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:03:33 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:04:19 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:04:24 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:04:28 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:11:04 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:11:08 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:11:45 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:11:49 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:15:54 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:15:56 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -LIST_LOAD|GOOD|Thu, 27 Apr 2006 17:18:51 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:18:56 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:19:07 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:19:49 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:21:55 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:23:16 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:23:21 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:23:23 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:23:29 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:24:23 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:24:25 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:25:31 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:25:41 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:25:43 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:25:45 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:25:46 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:26:49 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:26:50 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:26:52 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:32 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:38 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:39 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:41 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:43 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:48 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:49 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:54 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:55 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:57 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:33:58 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:00:48 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:00:50 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:00:58 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:03 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:17 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:19 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:29 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:42 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:43 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:47 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:49 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:52 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:54 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:01:59 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:01 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:03 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:05 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:11 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:12 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:15 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:16 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:26 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:28 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:02:32 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:07:52 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:08:13 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:08:17 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:08:20 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:08:22 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:08:24 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:08:25 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:08:27 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:08:28 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:33 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:35 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:37 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:44 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:46 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:47 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:49 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:51 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:21:00 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:21:17 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:21:23 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -LIST_LOAD|GOOD|Thu, 27 Apr 2006 22:22:17 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|| -LIST_LOAD|GOOD|Thu, 27 Apr 2006 22:25:37 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|| -LIST_LOAD|GOOD|Thu, 27 Apr 2006 22:27:54 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|| -LIST_LOAD|GOOD|Thu, 27 Apr 2006 22:34:07 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:40:50 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:35:20 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:35:23 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:35:26 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:35:31 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| diff --git a/LANG_admin/vicidial_el/remote_dispo.php b/LANG_admin/vicidial_el/remote_dispo.php deleted file mode 100644 index 3f45251b..00000000 --- a/LANG_admin/vicidial_el/remote_dispo.php +++ /dev/null @@ -1,327 +0,0 @@ - LICENSE: GPLv2 -### -# this is the remote agent disposition screen for calls sent to remote agents. This allows the remote agent to modify customer information and disposition the call - -# CHANGES -# -# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat -# - - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -Απομακρυσμένο: Τερματισμός Κλήσης -\n"; -?> - - -
- -"; - -if ($end_call > 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Η κλήση έχει τερματίσει       $NOW_TIME\n

\n"; - - echo "
\n"; - -} -else -{ - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Πληροφορίες Κλήσης: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     ID Εκστρατείας: $campaign_id
Fronter: $tsr     ID Λίστας: $list_id
Ονομα:   \n"; - echo " Επίθετο:
Διεύθυνση 1 :
Διεύθυνση 2 :
Διεύθυνση 3 :
Πόλη :
Κράτος:   \n"; - echo "Ταχ.Κωδ.
Χώρα :
Εναλ Τηλέφωνο :
Ασφάλεια :
Σχόλια :
Τερματισμός:
\n"; - echo "


\n"; - - } - else - { - echo "ΑΠΟΤΥΧΙΑ ψαξίματος καθοδήγησης για lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial_el/server_stats.php b/LANG_admin/vicidial_el/server_stats.php deleted file mode 100644 index d08bccbb..00000000 --- a/LANG_admin/vicidial_el/server_stats.php +++ /dev/null @@ -1,96 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: Στατιστικά Διακομιστή and Reports -VICIDIAL: Στατιστικά Διακομιστή and Reports                           -ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ

- - -

-
- $o)
-	{
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	$o++;
-	}
-
-?>
-
SERVERΠΕΡΙΓΡΑΦΗIP ADDRESSΕΝΕΡΓΑVDAD timeVDcall timePARK timeCLOSER/INBOUND time
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_el/user_stats.php b/LANG_admin/vicidial_el/user_stats.php deleted file mode 100644 index a48b56fd..00000000 --- a/LANG_admin/vicidial_el/user_stats.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -ΔΙΑΧΕΙΡΙΣΗ: User Stats -\n"; -?> - - -
- - - - - -\n"; -echo "
  ΔΙΑΧΕΙΡΙΣΗ: User Stats for  
  \n"; - -echo "
\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - -echo "
\n"; - -echo "ΧΡΟΝΟΣ ΟΜΙΛΙΑΣ ΚΑΙ ΚΑΤΑΣΤΑΣΗ:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - -echo "\n"; -echo "
ΚΑΤΑΣΤΑΣΗΚΑΤΑΜΕΤΡΗΣΗΩΡΕΣ:ΛΕΠΤΑ
$row[1] $row[0] $call_hours_int:$call_minutes_int
ΣΥΝΟΛΙΚΕΣ ΚΛΗΣΕΙΣ $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo " ΧΡΟΝΟΣ ΣYΝΔΕΣΗΣ/ΑΠΟΣΥΝΔΕΣΗΣ:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); - $event_minutes = ($event_hours - $event_hours_int); - $event_minutes = ($event_minutes * 60); - $event_minutes_int = round($event_minutes, 0); - if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - } - - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - -$total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); -$total_login_minutes = ($total_login_hours - $total_login_hours_int); -$total_login_minutes = ($total_login_minutes * 60); -$total_login_minutes_int = round($total_login_minutes, 0); -if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} - -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "
ΣΥΜΒΑΝ ΗΜΕΡΑΕΚΣΤΡΑΤΕΙΑΩΡΕΣ:ΛΕΠΤΑ
$row[0] $row[2] $row[3]
$row[0] $row[2] $row[3] $event_hours_int:$event_minutes_int
$row[0] $row[2] $row[3]
ΣΥΝΟΛΙΚΑ $total_login_hours_int:$total_login_minutes_int
\n"; - - -echo "

\n"; - -echo "
\n"; - -echo "Τελευταίες 50 Κλήσεις:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS PHONEΕΚΣΤΡΑΤΕΙΑ LIST LEAD
$row[4] $row[7] $row[8] $row[10] $row[3] $row[2] $row[1]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_el/user_status.php b/LANG_admin/vicidial_el/user_status.php deleted file mode 100644 index 6b8aaaa8..00000000 --- a/LANG_admin/vicidial_el/user_status.php +++ /dev/null @@ -1,238 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $change_agent_campaign=$row[1]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - $stmt="SELECT * from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $agents_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $agents_to_print) - { - $row=mysql_fetch_row($rslt); - $Aserver_ip = $row[2]; - $Asession_id = $row[3]; - $Aextension = $row[4]; - $Astatus = $row[5]; - $Acampaign = $row[7]; - $Alast_call = $row[14]; - $Acl_campaigns = $row[15]; - $i++; - } - - } - -$stmt="select * from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - - - -?> - - -ΔΙΑΧΕΙΡΙΣΗ: User Status -\n"; -?> - - -
-
- - - - -\n"; -echo "
  ΔΙΑΧΕΙΡΙΣΗ: User Status for  
  \n"; - -if ($stage == "live_campaign_change") -{ - $stmt="UPDATE vicidial_live_agents set campaign_id='" . mysql_real_escape_string($group) . "' where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name changed to $group campaign
\n"; - - exit; -} - -if ($stage == "log_agent_out") -{ - $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser
\n"; - - exit; -} - -if ($agents_to_print > 0) -{ - echo "
";
-	echo "Agent Logged in at server:  $Aserver_ip\n";
-	echo "               in session:  $Asession_id\n";
-	echo "               from phone:  $Aextension\n";
-	echo "Agent is in campaign:       $Acampaign\n";
-	echo "              status:       $Astatus\n";
-	echo " hungup last call at:       $Alast_call\n";
-	echo "       Closer groups:       $Acl_campaigns\n\n";
-
-	echo "
"; - - - if ($change_agent_campaign > 0) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "Current Εκστρατεία: \n"; - echo "
\n"; - - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - } -} - -else -{ - echo "Agent is not logged in\n
"; - -} - - -echo "           $user - $full_name - \n"; - -echo "VICIDIAL Time Sheet\n"; - -echo "
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - -echo "|$stage|$group|"; - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_el/vdremote.php b/LANG_admin/vicidial_el/vdremote.php deleted file mode 100644 index 0061a097..00000000 --- a/LANG_admin/vicidial_el/vdremote.php +++ /dev/null @@ -1,602 +0,0 @@ - LICENSE: GPLv2 -# -# Changes -# 50307-1721 - First version -# 51123-1502 - removed requirement of PHP Globals=on -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time - -$version = '1.1.12'; -$build = '60619-1603'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} - elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];} - -if (!isset($force_logout)) {$force_logout = 0;} - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Έχετε αποσυνδεθεί. Σας ευχαριστούμε\n"; - exit; -} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$popup_page = './closer_popup.php'; -$STARTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Ακυρο Ονομα Χρήστη/Κωδικός Πρόσβασης: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - $stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $authx=$row[0]; - - if($authx>0) - { - $stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id=$row[0]; - $server_ip=$row[1]; - if (!$number_of_lines) {$number_of_lines=$row[2];} - - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; - exit; - } - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -if ($ADD==61111) - { - echo"\n"; - } -echo "\n"; -?> - -ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ: $LOGfullname - $PHP_AUTH_USER "; - -if (!$ADD) {$ADD="31111";} -if ($ADD==31111) {echo "Τροποποίηση Απομακρυσμένων Χειριστών";} -if ($ADD==41111) {echo "Τροποποίηση Απομακρυσμένων Χειριστών";} -if ($ADD==61111) {echo "Remote Agent Status";} -if ($ADD==71111) {echo "Remote Agent Closer Stats";} - - -if (strlen($ADD)>4) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "2) {$groups_value .= " -";} - } - -?> - - - -
-
- - - -
  ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ:   Αποσύνδεση  
  ΤΡΟΠΟΠΟΙΗΣΗ | ">ΚΑΤΑΣΤΑΣΗ | ">ΣΤΑΤΙΣΤΙΚΑ ΕΙΣΕΡΧΟΜΕΝΩΝ
-"; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΚΑΤΑΧΩΡΗΣΗΣ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Χρήστη Ξεκινά: $user_start
Αριθμός Γραμμών: (μόνο αριθμοί)
IP Διακομιστή: $row[3]
Εξωτερική Τηλ. Σύνδεση: (number dialed to reach agents [i.e. 913125551212])
Κατάσταση:
Εκστρατεία: $campaign_id
Εισερχόμενες Ομάδες: \n"; -echo "$groups_list"; -echo "
\n"; -echo "ΣΗΜΕΙΩΣΗ: Μπορεί να διαρκέσει και 30 δευτερόλεπτα για να καταχωρηθούν οι αλλαγές της οθόνης\n"; - -} - - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) - {echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΔΕΝ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ - Παρακαλώ ελέγξτε τα δεδομένα που καταχωρήσατε\n";} - else - { - $stmt="UPDATE vicidial_remote_agents set number_of_lines='" . mysql_real_escape_string($number_of_lines) . "', conf_exten='" . mysql_real_escape_string($conf_exten) . "', status='" . mysql_real_escape_string($status) . "', closer_campaigns='" . mysql_real_escape_string($groups_value) . "' where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - -# echo "$stmt\n"; - echo "
ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ΤΡΟΠΟΠΟΙΗΘΗΚΑΝ\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY ΑΠΟΜΑΚΡΥΣΜΕΝΟΙ ΧΕΙΡΙΣΤΕΣ ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - - } - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
ΤΡΟΠΟΠΟΙΗΣΗ ΚΑΤΑΧΩΡΗΣΗΣ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID Χρήστη Ξεκινά: $user_start
Αριθμός Γραμμών: (μόνο αριθμοί)
IP Διακομιστή: $row[3]
Εξωτερική Τηλ. Σύνδεση: (number dialed to reach agents [i.e. 913125551212])
Κατάσταση:
Εκστρατεία: $campaign_id
Εισερχόμενες Ομάδες: \n"; -echo "$groups_list"; -echo "
\n"; -echo "ΣΗΜΕΙΩΣΗ: Μπορεί να διαρκέσει και 30 δευτερόλεπτα για να καταχωρηθούν οι αλλαγές της οθόνης\n"; - -} - - - - -###################### -# ADD=61111 status of remote agent in the system and active calls and queue -###################### - -if ($ADD==61111) -{ - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
ΛΑΘΟΣ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'" . mysql_real_escape_string($nextuser) . "',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - echo "VICIDIAL: Remote Agent Time On Calls $NOW_TIME\n\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $leadlink=0; - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[3]=''; - $row[5]='- ΑΝΑΜΟΝΗ -'; - $row[6]=$row[7]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $leadid = sprintf("%-12s", $row[2]); - if ($row[2] > 0) - { - $leadidLINK=$row[2]; - $leadlink++; - if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;} - $leadid = "$leadid"; - } - $channel = sprintf("%-10s", $row[3]); - $cc=0; - while ( (strlen($channel) > 10) and ($cc < 100) ) - { - $channel = eregi_replace(".$","",$channel); - $cc++; - if (strlen($channel) <= 10) {$cc=101;} - } - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = ($STARTtime - $row[6]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} - if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo " $i Χειριστές συνδεμένοι στον διακομιστή $server_ip\n\n"; - - echo " - 5 λεπτά ή παραπάνω σε κλήση\n"; - echo " - Πάνω από 10 λεπτά σε κλήση\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "********************************* ΚΑΝΕΝΑΣ ΧΕΙΡΙΣΤΗΣ ΣΕ ΚΛΗΣΕΙΣ*********************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - -###################### -# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log) -###################### - -if ($ADD==71111) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
ΛΑΘΟΣ ΑΠΟΜΑΚΡΥΣΜΕΝΩΝ ΧΕΙΡΙΣΤΩΝ\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'$nextuser',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $in_calls = $row[0]; - $in_time = $row[1]; - $in_time_M = ($in_time / 60); - $in_time_M = round($in_time_M, 2); - $in_time_M_int = intval("$in_time_M"); - $in_time_SEC = ($in_time_M - $in_time_M_int); - $in_time_SEC = ($in_time_SEC * 60); - $in_time_SEC = round($in_time_SEC, 0); - if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";} - $in_time_MS = "$in_time_M_int:$in_time_SEC"; - $in_time_MS = sprintf("%7s", $in_time_MS); - - echo "VICIDIAL: Στατιστικά εισερχομένων απομακρυσμένου χειριστή $NOW_TIME\n\n"; - echo "\n"; - echo "Συνολικές κλήσεις που διακομίστηκαν$query_date: $in_calls\n"; - echo "Συνολικός χρόνος ομιλίας σε$query_date: $in_time_MS (minutes:seconds)\n"; - echo "\n"; - echo "\n"; - echo "Λίστα Κλήσεων για$query_date:\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - $user = sprintf("%-8s", $row[0]); - $leadid = sprintf("%-10s", $row[1]); - $group = sprintf("%-14s", $row[2]); - $phone = sprintf("%-10s", $row[3]); - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = $row[6]; - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - # if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - # echo " $i Χειριστές συνδεμένοι στον διακομιστή $server_ip\n\n"; - - # echo " - 5 λεπτά ή παραπάνω σε κλήση\n"; - # echo " - Πάνω από 10 λεπτά σε κλήση\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "*********************************ΔΕΝ ΥΠΑΡΧΟΥΝ ΚΛΗΣΕΙΣ ΓΙΑ ΑΥΤΗ ΤΗΝ ΗΜΕΡΑ*******************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nχρόνος εκτέλεσης διαδικασίας: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_en/AST_CLOSERstats.php b/LANG_admin/vicidial_en/AST_CLOSERstats.php deleted file mode 100644 index b7a7bb8c..00000000 --- a/LANG_admin/vicidial_en/AST_CLOSERstats.php +++ /dev/null @@ -1,396 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select group_id from vicidial_inbound_groups;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Closer Stats\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Closer Stats                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls placed from this Campaign:        $TOTALcalls\n";
-echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total DROP Calls:                             $DROPcalls  $DROPpercent%\n";
-echo "Average Length for DROP Calls in seconds:     $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/AST_VDADstats.php b/LANG_admin/vicidial_en/AST_VDADstats.php deleted file mode 100644 index 9ac17006..00000000 --- a/LANG_admin/vicidial_en/AST_VDADstats.php +++ /dev/null @@ -1,417 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls placed from this Campaign:        $TOTALcalls\n";
-echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total DROP Calls:                             $DROPcalls  $DROPpercent%\n";
-echo "Average Length for DROP Calls in seconds:     $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- AUTO-DIAL NO ANSWERS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='NA' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$NAcalls =	sprintf("%10s", $row[0]);
-$NApercent = (($NAcalls / $TOTALcalls) * 100);
-$NApercent = round($NApercent, 0);
-
-$average_na_seconds = ($row[1] / $row[0]);
-$average_na_seconds = round($average_na_seconds, 0);
-$average_na_seconds =	sprintf("%10s", $average_na_seconds);
-
-echo "Total NA calls -Busy,Disconnect,BTvoicemail:  $NAcalls  $NApercent%\n";
-echo "Average Call Length for NA Calls in seconds:  $average_na_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/AST_VICIDIAL_hopperlist.php b/LANG_admin/vicidial_en/AST_VICIDIAL_hopperlist.php deleted file mode 100644 index 1824a939..00000000 --- a/LANG_admin/vicidial_en/AST_VICIDIAL_hopperlist.php +++ /dev/null @@ -1,161 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.10.15';} - -$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $campaign_id[$i] =$row[0]; - $campaign_name[$i] =$row[1]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Hopper List\n"; -echo "
\n"; -#echo "\n"; -#echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Live Current Hopper List                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-
-echo "Total leads in hopper right now:       $TOTALcalls\n";
-
-
-##############################
-#########  LEAD STATS
-
-echo "\n";
-echo "---------- LEADS IN HOPPER\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-echo "|      | LEAD_ID   | PHONE NUM  | STATE | STATUS | COUNT | GMT    |\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$FMT_i =		sprintf("%-4s", $i);
-	$lead_id =		sprintf("%-9s", $row[0]);
-	$phone_number =	sprintf("%-10s", $row[1]);
-	$state =		sprintf("%-5s", $row[2]);
-	$status =		sprintf("%-6s", $row[3]);
-	$count =		sprintf("%-5s", $row[4]);
-	$gmt =			sprintf("%-6s", $row[5]);
-
-	echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt |\n";
-
-	$i++;
-	}
-
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/AST_admin_log_display.php b/LANG_admin/vicidial_en/AST_admin_log_display.php deleted file mode 100644 index b5286873..00000000 --- a/LANG_admin/vicidial_en/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
-
-#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
-passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/AST_agent_performance.php b/LANG_admin/vicidial_en/AST_agent_performance.php deleted file mode 100644 index a489bc7d..00000000 --- a/LANG_admin/vicidial_en/AST_agent_performance.php +++ /dev/null @@ -1,232 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Agent Performance\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:33:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:33:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:33:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:33:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_en/AST_agent_performance_detail.php b/LANG_admin/vicidial_en/AST_agent_performance_detail.php
deleted file mode 100644
index 2dd3dc5e..00000000
--- a/LANG_admin/vicidial_en/AST_agent_performance_detail.php
+++ /dev/null
@@ -1,406 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($group)) {$group = '';}
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-$stmt="select campaign_id from vicidial_campaigns;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$campaigns_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $campaigns_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 03:45:00";   
-	$query_date_END = "$query_date 15:15:00";
-	$time_BEGIN = "03:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:15:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$TOTtotWAIT=($TOTtotWAIT + $row[7]);
-	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
-	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-	$USERtotPAUSE =	$row[5];
-	$USERavgPAUSE =	$row[6];
-	$USERtotWAIT =	$row[7];
-	$USERavgWAIT =	$row[8];
-	$USERtotDISPO =	$row[9];
-	$USERavgDISPO =	$row[10];
-
-	$USERtime_M = ($USERtime / 60);
-	$USERtime_M = round($USERtime_M, 2);
-	$USERtime_M_int = intval("$USERtime_M");
-	$USERtime_S = ($USERtime_M - $USERtime_M_int);
-	$USERtime_S = ($USERtime_S * 60);
-	$USERtime_S = round($USERtime_S, 0);
-	if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
-	$USERtime_MS = "$USERtime_M_int:$USERtime_S";
-	$pfUSERtime_MS[$i] =		sprintf("%7s", $USERtime_MS);
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-
-	$USERtotPAUSE_M = ($USERtotPAUSE / 60);
-	$USERtotPAUSE_M = round($USERtotPAUSE_M, 2);
-	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M");
-	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
-	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
-	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
-	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
-	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
-	$pfUSERtotPAUSE_MS[$i] =		sprintf("%6s", $USERtotPAUSE_MS);
-
-	$USERavgPAUSE_M = ($USERavgPAUSE / 60);
-	$USERavgPAUSE_M = round($USERavgPAUSE_M, 2);
-	$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M");
-	$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
-	$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
-	$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
-	if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
-	$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
-	$pfUSERavgPAUSE_MS[$i] =		sprintf("%6s", $USERavgPAUSE_MS);
-
-	$USERtotWAIT_M = ($USERtotWAIT / 60);
-	$USERtotWAIT_M = round($USERtotWAIT_M, 2);
-	$USERtotWAIT_M_int = intval("$USERtotWAIT_M");
-	$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
-	$USERtotWAIT_S = ($USERtotWAIT_S * 60);
-	$USERtotWAIT_S = round($USERtotWAIT_S, 0);
-	if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
-	$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
-	$pfUSERtotWAIT_MS[$i] =		sprintf("%6s", $USERtotWAIT_MS);
-
-	$USERavgWAIT_M = ($USERavgWAIT / 60);
-	$USERavgWAIT_M = round($USERavgWAIT_M, 2);
-	$USERavgWAIT_M_int = intval("$USERavgWAIT_M");
-	$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
-	$USERavgWAIT_S = ($USERavgWAIT_S * 60);
-	$USERavgWAIT_S = round($USERavgWAIT_S, 0);
-	if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
-	$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
-	$pfUSERavgWAIT_MS[$i] =		sprintf("%6s", $USERavgWAIT_MS);
-	
-	$USERtotDISPO_M = ($USERtotDISPO / 60);
-	$USERtotDISPO_M = round($USERtotDISPO_M, 2);
-	$USERtotDISPO_M_int = intval("$USERtotDISPO_M");
-	$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
-	$USERtotDISPO_S = ($USERtotDISPO_S * 60);
-	$USERtotDISPO_S = round($USERtotDISPO_S, 0);
-	if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
-	$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
-	$pfUSERtotDISPO_MS[$i] =		sprintf("%6s", $USERtotDISPO_MS);
-
-	$USERavgDISPO_M = ($USERavgDISPO / 60);
-	$USERavgDISPO_M = round($USERavgDISPO_M, 2);
-	$USERavgDISPO_M_int = intval("$USERavgDISPO_M");
-	$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
-	$USERavgDISPO_S = ($USERavgDISPO_S * 60);
-	$USERavgDISPO_S = round($USERavgDISPO_S, 0);
-	if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
-	$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
-	$pfUSERavgDISPO_MS[$i] =		sprintf("%6s", $USERavgDISPO_MS);
-
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]);	$TOT_CB = ($TOT_CB + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtime_M = ($TOTtime / 60);
-	$TOTtime_M = round($TOTtime_M, 2);
-	$TOTtime_M_int = intval("$TOTtime_M");
-	$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
-	$TOTtime_S = ($TOTtime_S * 60);
-	$TOTtime_S = round($TOTtime_S, 0);
-	if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
-	$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
-	$TOTtime_MS =		sprintf("%7s", $TOTtime_MS);
-		while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOTtotDISPO_M = ($TOTtotDISPO / 60);
-	$TOTtotDISPO_M = round($TOTtotDISPO_M, 2);
-	$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M");
-	$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
-	$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
-	$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
-	if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
-	$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
-	$TOTtotDISPO_MS =		sprintf("%7s", $TOTtotDISPO_MS);
-		while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
-
-	$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
-	$TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2);
-	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M");
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
-	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
-	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
-	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
-	$TOTtotPAUSE_MS =		sprintf("%7s", $TOTtotPAUSE_MS);
-		while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
-
-	$TOTtotWAIT_M = ($TOTtotWAIT / 60);
-	$TOTtotWAIT_M = round($TOTtotWAIT_M, 2);
-	$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M");
-	$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
-	$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
-	$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
-	if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
-	$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
-	$TOTtotWAIT_MS =		sprintf("%7s", $TOTtotWAIT_MS);
-		while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
-
-
-	$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);
-	$TOTavgTALK_M = round($TOTavgTALK_M, 2);
-	$TOTavgTALK_M_int = intval("$TOTavgTALK_M");
-	$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
-	$TOTavgTALK_S = ($TOTavgTALK_S * 60);
-	$TOTavgTALK_S = round($TOTavgTALK_S, 0);
-	if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
-	$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
-	$TOTavgTALK_MS =		sprintf("%6s", $TOTavgTALK_MS);
-		while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
-
-	$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);
-	$TOTavgDISPO_M = round($TOTavgDISPO_M, 2);
-	$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M");
-	$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
-	$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
-	$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
-	if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
-	$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
-	$TOTavgDISPO_MS =		sprintf("%6s", $TOTavgDISPO_MS);
-		while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
-
-	$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);
-	$TOTavgPAUSE_M = round($TOTavgPAUSE_M, 2);
-	$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M");
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
-	$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
-	if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
-	$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
-	$TOTavgPAUSE_MS =		sprintf("%6s", $TOTavgPAUSE_MS);
-		while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
-
-	$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);
-	$TOTavgWAIT_M = round($TOTavgWAIT_M, 2);
-	$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M");
-	$TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int);
-	$TOTavgWAIT_S = ($TOTavgWAIT_S * 60);
-	$TOTavgWAIT_S = round($TOTavgWAIT_S, 0);
-	if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";}
-	$TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S";
-	$TOTavgWAIT_MS =		sprintf("%6s", $TOTavgWAIT_MS);
-		while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
-
-	
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_CB = sprintf("%-5s", $TOT_CB);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_en/AST_agent_time_sheet.php b/LANG_admin/vicidial_en/AST_agent_time_sheet.php
deleted file mode 100644
index 46659eb6..00000000
--- a/LANG_admin/vicidial_en/AST_agent_time_sheet.php
+++ /dev/null
@@ -1,281 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
-	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["calls_summary"]))				{$calls_summary=$_GET["calls_summary"];}
-	elseif (isset($_POST["calls_summary"]))		{$calls_summary=$_POST["calls_summary"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from available agent log data\n";
-}
-
-else
-{
-$query_date_BEGIN = "$query_date 00:00:00";   
-$query_date_END = "$query_date 23:59:59";
-$time_BEGIN = "00:00:00";   
-$time_END = "23:59:59";
-
-$stmt="select full_name from vicidial_users where user='$agent';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$full_name = $row[0];
-
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n";
-
-if ($calls_summary)
-	{
-	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
-
-		$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "TOTAL CALLS TAKEN: $row[0]\n";
-	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
-	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
-	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
-	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
-	echo "----------------------------------------------------------------\n";
-	echo "TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_en/AST_server_performance.php b/LANG_admin/vicidial_en/AST_server_performance.php
deleted file mode 100644
index fdedb9d9..00000000
--- a/LANG_admin/vicidial_en/AST_server_performance.php
+++ /dev/null
@@ -1,310 +0,0 @@
-    LICENSE: GPLv2
-#
-# CHANGES
-#
-# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))	{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-# path from root to where ploticus files will be stored
-$DOCroot = "$WeBServeRRooT/vicidial/ploticus/";
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-if (!isset($group)) {$group = '';}
-
-$stmt="select server_ip from servers;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$servers_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $servers_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Server Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "             REPORTS \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:32:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:32:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- TOTALS, PEAKS and AVERAGES\n";
-
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGload =	sprintf("%10s", $row[0]);
-$AVGchannels =	sprintf("%10s", $row[1]);
-
-$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGcpuUSER =	sprintf("%10s", $row[0]);
-$AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
-$AVGcpuIDLE =	sprintf("%10s", $row[2]);
-
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-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','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
-
-
-echo "Total Calls in/out on this server:        $TOTALcalls\n";
-echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
-echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
-echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
-echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
-
-echo "\n";
-echo "---------- LINE GRAPH:\n";
-
-
-
-##############################
-#########  Graph stats
-
-$DAT = '.dat';
-$HTM = '.htm';
-$PNG = '.png';
-$filedate = date("Y-m-d_His");
-$DATfile = "$group$query_date$shift$filedate$DAT";
-$HTMfile = "$group$query_date$shift$filedate$HTM";
-$PNGfile = "$group$query_date$shift$filedate$PNG";
-
-$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
-$DATfp = fopen ("$DOCroot/$DATfile", "a");
-
-$stmt="select DATE_FORMAT(start_time,'%H:%i:%s') as timex,sysload,processes,channels_total,live_recordings,cpu_user_percent,cpu_system_percent from server_performance where server_ip='" . mysql_real_escape_string($group) . "' and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' order by timex;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$row[5] = intval(($row[5] + $row[6]) * $HIGHmulti);
-	$row[6] = intval($row[6] * $HIGHmulti);
-	fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
-	$i++;
-	}
-fclose($DATfp);
-
-$rows_to_max = ($rows_to_print + 100);
-
-
-
-$HTMcontent  = '';
-$HTMcontent .= "#proc page\n";
-$HTMcontent .= "#if @DEVICE in png,gif\n";
-$HTMcontent .= "   scale: 0.6\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#endif\n";
-$HTMcontent .= "#proc getdata\n";
-$HTMcontent .= "file: $DOCroot/$DATfile\n";
-$HTMcontent .= "fieldnames: userproc sysproc time load processes channels\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc areadef\n";
-$HTMcontent .= "title: Server $group   $query_date_BEGIN to $query_date_END\n";
-$HTMcontent .= "titledetails: size=14  align=C\n";
-$HTMcontent .= "rectangle: 1 1 14 7\n";
-$HTMcontent .= "xscaletype: time hh:mm:ss\n";
-$HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
-$HTMcontent .= "stubformat: hh:mm:ssa\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc yaxis\n";
-$HTMcontent .= "stubs: inc 50\n";
-$HTMcontent .= "grid: color=yellow\n";
-$HTMcontent .= "gridskip: min\n";
-$HTMcontent .= "ticincrement: 100 1000\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: userproc\n";
-$HTMcontent .= "linedetails: color=purple width=.5\n";
-$HTMcontent .= "fill: lavender\n";
-$HTMcontent .= "legendlabel: user proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: sysproc\n";
-$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
-$HTMcontent .= "fill: dullyellow\n";
-$HTMcontent .= "legendlabel: system proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: load\n";
-$HTMcontent .= "linedetails: color=blue width=.5\n";
-$HTMcontent .= "legendlabel: load\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: processes\n";
-$HTMcontent .= "linedetails: color=red width=.5\n";
-$HTMcontent .= "legendlabel: processes\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: channels\n";
-$HTMcontent .= "linedetails: color=green width=.5\n";
-$HTMcontent .= "legendlabel: channels\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc legend\n";
-$HTMcontent .= "location: max-2 max\n";
-$HTMcontent .= "seglen: 0.2\n";
-$HTMcontent .= "\n";
-
-fwrite ($HTMfp, "$HTMcontent");
-fclose($HTMfp);
-
-
-passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
-
-sleep(1);
-
-echo "
\n"; -echo "\n"; -echo "\n"; - - -echo ""; - -} - - - -?> - - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/AST_timeonVDAD.php b/LANG_admin/vicidial_en/AST_timeonVDAD.php deleted file mode 100644 index 52efd9cc..00000000 --- a/LANG_admin/vicidial_en/AST_timeonVDAD.php +++ /dev/null @@ -1,255 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 60620-1040 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Agents Time On Calls                         $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL    | STATUS | START TIME          | MINUTES |\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	$agentcount=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED",$row[4]))
-			{
-			$row[3]='';
-			$row[5]=' - WAITING - ';
-			$row[6]=$row[7];
-			}
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$sessionid =		sprintf("%-9s", $row[2]);
-		$channel =			sprintf("%-10s", $row[3]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[4]);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 5) {$G=''; $EG='';}
-		if ($call_time_M_int >= 10) {$G=''; $EG='';}
-		if (eregi("PAUSED",$row[4])) 
-			{
-			if ($call_time_M_int >= 1) 
-				{$i++; continue;} 
-			else
-				{$G=''; $EG='';}
-			}
-
-		$agentcount++;
-		echo "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-		echo "  $agentcount agents logged in on server $server_ip\n\n";
-
-		echo "             - Paused agents\n";
-		echo "             - 5 minutes or more on call\n";
-		echo "             - Over 10 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-echo "| CHANNEL    | STATUS | CAMPAIGN | PHONE NUMBER       | START TIME          | MINUTES |\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-8s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-		echo "  $i calls being placed on server $server_ip\n\n";
-
-		echo "             - LIVE CALL WAITING\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "******************************* NO LIVE CALLS WAITING *********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - diff --git a/LANG_admin/vicidial_en/AST_timeonVDAD_closer.php b/LANG_admin/vicidial_en/AST_timeonVDAD_closer.php deleted file mode 100644 index eb7d3c39..00000000 --- a/LANG_admin/vicidial_en/AST_timeonVDAD_closer.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# CHANGES -# -# 60620-1037 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - -\n"; -echo " - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Agents Time On Calls                         $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
-			}
-		$extension[$i] =		sprintf("%-10s", $row[0]);
-		$user[$i] =				sprintf("%-6s", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
-			$cc[$i]=0;
-		while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
-			{
-			$channel[$i] = eregi_replace(".$","",$channel[$i]);   
-			$cc[$i]++;
-			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
-			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
-			$cd[$i]=0;
-		while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
-			{
-			$start_time[$i] = eregi_replace("^.","",$start_time[$i]);   
-			$cd[$i]++;
-			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
-			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
-
-		$call_time_M[$i] = ($call_time_S[$i] / 60);
-		$call_time_M[$i] = round($call_time_M[$i], 2);
-		$call_time_M_int[$i] = intval("$call_time_M[$i]");
-		$call_time_SEC[$i] = ($call_time_M[$i] - $call_time_M_int[$i]);
-		$call_time_SEC[$i] = ($call_time_SEC[$i] * 60);
-		$call_time_SEC[$i] = round($call_time_SEC[$i], 0);
-		if ($call_time_SEC[$i] < 10) {$call_time_SEC[$i] = "0$call_time_SEC[$i]";}
-		$call_time_MS[$i] = "$call_time_M_int[$i]:$call_time_SEC[$i]";
-		$call_time_MS[$i] =		sprintf("%7s", $call_time_MS[$i]);
-		$i++;
-		}
-		$ext_count = $i;
-		$i=0;
-	while ($i < $ext_count)
-		{
-
-		$stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$camp_to_print = mysql_num_rows($rslt);
-		if ($camp_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$campaign = sprintf("%-12s", $row[0]);
-			$camp_color = $row[0];
-			}
-		else
-			{$campaign = 'DEAD        ';   	$camp_color = 'DEAD';}
-		if (eregi("READY|PAUSED|CLOSER",$status[$i]))
-			{$campaign = '            ';   	$camp_color = '';}
-
-		$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$xfer_to_print = mysql_num_rows($rslt);
-		if ($xfer_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$fronter = sprintf("%-6s", $row[0]);
-			}
-		else
-			{$fronter = '      ';}
-
-		$G = '';		$EG = '';
-		$G=""; $EG='';
-	#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
-	#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-
-		echo "| $G$extension[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-		echo "  $i agents logged in on server $server_ip\n\n";
-
-	#	echo "             - 5 minutes or more on call\n";
-	#	echo "             - Over 10 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-#echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-echo "| CHANNEL             | STATUS | CAMPAIGN     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-19s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 19) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 19) {$cc=101;}
-			}
-		$start_time =		sprintf("%-8s", $row[5]);
-			$cd=0;
-		while ( (strlen($start_time) > 8) and ($cd < 100) )
-			{
-			$start_time = eregi_replace("^.","",$start_time);   
-			$cd++;
-			if (strlen($start_time) <= 8) {$cd=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-12s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-		echo "  $i calls being placed on server $server_ip\n\n";
-
-		echo "             - LIVE CALL WAITING\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "******************************* NO LIVE CALLS WAITING *********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/AST_timeonVDADall.php b/LANG_admin/vicidial_en/AST_timeonVDADall.php deleted file mode 100644 index 540a5eb6..00000000 --- a/LANG_admin/vicidial_en/AST_timeonVDADall.php +++ /dev/null @@ -1,349 +0,0 @@ - LICENSE: GPLv2 -# -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60511-1343 - Added leads and drop info at the top of the screen -# 60608-1539 - Fixed CLOSER tallies for active calls -# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($group)) {$group='';} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -$rslt=mysql_query($stmt, $link); -if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!isset($RR)) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if (!isset($reset_counter)) {$reset_counter=0;} -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VICIDIAL: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$HOPlev = $row[8]; - -echo "
"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$VDhop = $row[0]; - -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
DIAL LEVEL:  $row[0]    STATUSES:  $row[1], $row[2], $row[3], $row[4], $row[5]     ORDER:  $row[6]     FILTER:  $row[7]    
HOPPER LEVEL:  $HOPlev     LEADS IN HOPPER:  $VDhop     DIALABLE LEADS:  $DAleads       TIME:
CALLS TODAY:  $callsTODAY     CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
"; - - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; - } -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - diff --git a/LANG_admin/vicidial_en/AST_timeonVDADall_SIPmonitor.php b/LANG_admin/vicidial_en/AST_timeonVDADall_SIPmonitor.php deleted file mode 100644 index 0b24f82e..00000000 --- a/LANG_admin/vicidial_en/AST_timeonVDADall_SIPmonitor.php +++ /dev/null @@ -1,301 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTERN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - - - - - - diff --git a/LANG_admin/vicidial_en/AST_timeoncall.php b/LANG_admin/vicidial_en/AST_timeoncall.php deleted file mode 100644 index 4227f836..00000000 --- a/LANG_admin/vicidial_en/AST_timeoncall.php +++ /dev/null @@ -1,180 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Call\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Call                                          $NOW_TIME\n\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-echo "| STATION    | SESSIONID | CHANNEL   | NUMBER DIALED    | START TIME          | MINUTES |\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-
-$stmt="SELECT count(*) from live_sip_channels where server_ip='$server_ip';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="select extension from live_channels where server_ip='$server_ip';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$ext_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_zap_counter=0;
-	$sessions = '';
-	while ($i < $ext_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if (preg_match("/^8600/i",$row[0]))
-			{
-			$sessions .= "$row[0]|";
-			}
-		$i++;
-		}
-	$sessions = preg_replace("/\|$/",'',$sessions);
-
-	if ($DB) {echo "SESSIONS: -$sessions-\n";}
-
-	$stmt="select * from live_sip_channels where server_ip='$server_ip' order by channel;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_calls_counter=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ( (preg_match("/Zap\/|internal|ring/i",$row[3])) or (preg_match("/Local\//i",$row[0])) )
-			{
-			if ($DB) {echo "NOT STATION |$row[0]|$row[3]|\n";}
-			$session_id = '';
-			}
-		else 
-			{
-			if (preg_match("/$row[3]/i",$sessions))
-				{
-				if ($DB) {echo "LIVE STATION|$row[0]|$row[3]|\n";}
-				$session_id = $row[3];
-				$station = preg_replace("/SIP\//",'',$row[0]);
-				$station = preg_replace("/-.*/",'',$station);
-			
-				$LIVE_sessions[$live_calls_counter] =			"$session_id";
-				$LIVE_sessions_FORMAT[$live_calls_counter] =	sprintf("%-9s", $session_id);
-				$LIVE_stations[$live_calls_counter] =			"$station";
-				$LIVE_stations_FORMAT[$live_calls_counter] =	sprintf("%-10s", $station);
-
-		#		echo "| $station | $session_id | \n";
-
-				$live_calls_counter++;
-				}
-			else
-				{
-				if ($DB) {echo "NOT STATIONZ|$row[0]|$row[3]|\n";}
-				$session_id = '';
-				}
-			}
-
-		$i++;
-		}
-
-		if ($live_calls_counter > 0)
-		{
-		$i=0;
-		$LC_counter = $live_calls_counter;
-
-		while ($i < $live_calls_counter)
-			{
-			$stmt="select channel,extension,number_dialed,start_time,start_epoch from call_log where extension='$LIVE_stations[$i]' and server_ip='$server_ip' order by uniqueid desc LIMIT 1;";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$parked_to_print = mysql_num_rows($rslt);
-			$row=mysql_fetch_row($rslt);
-
-			$channel =			sprintf("%-9s", $row[0]);
-			$number_dialed =	sprintf("%-16s", $row[2]);
-			$start_time =		sprintf("%-19s", $row[3]);
-			$call_time_S = ($STARTtime - $row[4]);
-
-			$call_time_M = ($call_time_S / 60);
-			$call_time_M = round($call_time_M, 2);
-			$call_time_M_int = intval("$call_time_M");
-			$call_time_SEC = ($call_time_M - $call_time_M_int);
-			$call_time_SEC = ($call_time_SEC * 60);
-			$call_time_SEC = round($call_time_SEC, 0);
-			if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-			$call_time_MS = "$call_time_M_int:$call_time_SEC";
-			$call_time_MS =		sprintf("%7s", $call_time_MS);
-			$G = '';		$EG = '';
-			if ($call_time_M_int >= 12) {$G=''; $EG='';}
-			if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-			echo "| $G$LIVE_stations_FORMAT[$i]$EG | $G$LIVE_sessions_FORMAT[$i]$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-			$i++;
-			}
-
-		echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-		echo "  $i stations on live calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on live call\n";
-		echo "             - Over 30 minutes on live call\n";
-
-		}
-		else
-		{
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*************************************** NO LIVE STATIONS ********************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		}
-
-	}
-	else
-	{
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*************************************** NO LIVE STATIONS ********************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	}
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/AST_timeonpark.php b/LANG_admin/vicidial_en/AST_timeonpark.php deleted file mode 100644 index 78caf4dc..00000000 --- a/LANG_admin/vicidial_en/AST_timeonpark.php +++ /dev/null @@ -1,197 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$timeONEhoursAGO = ($STARTtime - 3600); -$epochHALFhoursAGO = ($STARTtime - 1860); -$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO); -$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - $stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Park\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Park                       $NOW_TIME\n\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 1) {$G=''; $EG='';}
-		if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+-----------------+---------------------+---------+\n";
-		echo "  $i callers waiting on server $server_ip\n\n";
-
-		echo "             - 1 minute or more on hold\n";
-		echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	echo "******************** NO LIVE CALLS WAITING *********************\n";
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	}
-
-###################################################################################
-###### TIME ON INBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Agents Time On Inbound Calls                             $NOW_TIME\n\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-echo "| STATION    | USER   | CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 12) {$G=''; $EG='';}
-		if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-		echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-		echo "  $i agents on calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on call\n";
-		echo "             - Over 30 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/admin.php b/LANG_admin/vicidial_en/admin.php deleted file mode 100644 index 85bf7eae..00000000 --- a/LANG_admin/vicidial_en/admin.php +++ /dev/null @@ -1,6514 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["user_level"])) {$user_level=$_GET["user_level"];} - elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];} -if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} - elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["campaign_name"])) {$campaign_name=$_GET["campaign_name"];} - elseif (isset($_POST["campaign_name"])) {$campaign_name=$_POST["campaign_name"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["park_ext"])) {$park_ext=$_GET["park_ext"];} - elseif (isset($_POST["park_ext"])) {$park_ext=$_POST["park_ext"];} -if (isset($_GET["park_file_name"])) {$park_file_name=$_GET["park_file_name"];} - elseif (isset($_POST["park_file_name"])) {$park_file_name=$_POST["park_file_name"];} -if (isset($_GET["web_form_address"])) {$web_form_address=$_GET["web_form_address"];} - elseif (isset($_POST["web_form_address"])) {$web_form_address=$_POST["web_form_address"];} -if (isset($_GET["allow_closers"])) {$allow_closers=$_GET["allow_closers"];} - elseif (isset($_POST["allow_closers"])) {$allow_closers=$_POST["allow_closers"];} -if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} - elseif (isset($_POST["hopper_level"])) {$hopper_level=$_POST["hopper_level"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["next_agent_call"])) {$next_agent_call=$_GET["next_agent_call"];} - elseif (isset($_POST["next_agent_call"])) {$next_agent_call=$_POST["next_agent_call"];} -if (isset($_GET["local_call_time"])) {$local_call_time=$_GET["local_call_time"];} - elseif (isset($_POST["local_call_time"])) {$local_call_time=$_POST["local_call_time"];} -if (isset($_GET["voicemail_ext"])) {$voicemail_ext=$_GET["voicemail_ext"];} - elseif (isset($_POST["voicemail_ext"])) {$voicemail_ext=$_POST["voicemail_ext"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} - elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} -if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} - elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["group_color"])) {$group_color=$_GET["group_color"];} - elseif (isset($_POST["group_color"])) {$group_color=$_POST["group_color"];} -if (isset($_GET["fronter_display"])) {$fronter_display=$_GET["fronter_display"];} - elseif (isset($_POST["fronter_display"])) {$fronter_display=$_POST["fronter_display"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["dial_status_a"])) {$dial_status_a=$_GET["dial_status_a"];} - elseif (isset($_POST["dial_status_a"])) {$dial_status_a=$_POST["dial_status_a"];} -if (isset($_GET["dial_status_b"])) {$dial_status_b=$_GET["dial_status_b"];} - elseif (isset($_POST["dial_status_b"])) {$dial_status_b=$_POST["dial_status_b"];} -if (isset($_GET["dial_status_c"])) {$dial_status_c=$_GET["dial_status_c"];} - elseif (isset($_POST["dial_status_c"])) {$dial_status_c=$_POST["dial_status_c"];} -if (isset($_GET["dial_status_d"])) {$dial_status_d=$_GET["dial_status_d"];} - elseif (isset($_POST["dial_status_d"])) {$dial_status_d=$_POST["dial_status_d"];} -if (isset($_GET["dial_status_e"])) {$dial_status_e=$_GET["dial_status_e"];} - elseif (isset($_POST["dial_status_e"])) {$dial_status_e=$_POST["dial_status_e"];} -if (isset($_GET["lead_order"])) {$lead_order=$_GET["lead_order"];} - elseif (isset($_POST["lead_order"])) {$lead_order=$_POST["lead_order"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["campaign_vdad_exten"])) {$campaign_vdad_exten=$_GET["campaign_vdad_exten"];} - elseif (isset($_POST["campaign_vdad_exten"])) {$campaign_vdad_exten=$_POST["campaign_vdad_exten"];} -if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec_exten"];} - elseif (isset($_POST["campaign_rec_exten"])) {$campaign_rec_exten=$_POST["campaign_rec_exten"];} -if (isset($_GET["campaign_recording"])) {$campaign_recording=$_GET["campaign_recording"];} - elseif (isset($_POST["campaign_recording"])) {$campaign_recording=$_POST["campaign_recording"];} -if (isset($_GET["campaign_rec_filename"])) {$campaign_rec_filename=$_GET["campaign_rec_filename"];} - elseif (isset($_POST["campaign_rec_filename"])) {$campaign_rec_filename=$_POST["campaign_rec_filename"];} -if (isset($_GET["hotkey"])) {$hotkey=$_GET["hotkey"];} - elseif (isset($_POST["hotkey"])) {$hotkey=$_POST["hotkey"];} -if (isset($_GET["reset_list"])) {$reset_list=$_GET["reset_list"];} - elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} -if (isset($_GET["old_campaign_id"])) {$old_campaign_id=$_GET["old_campaign_id"];} - elseif (isset($_POST["old_campaign_id"])) {$old_campaign_id=$_POST["old_campaign_id"];} -if (isset($_GET["OLDuser_group"])) {$OLDuser_group=$_GET["OLDuser_group"];} - elseif (isset($_POST["OLDuser_group"])) {$OLDuser_group=$_POST["OLDuser_group"];} -if (isset($_GET["status_name"])) {$status_name=$_GET["status_name"];} - elseif (isset($_POST["status_name"])) {$status_name=$_POST["status_name"];} -if (isset($_GET["selectable"])) {$selectable=$_GET["selectable"];} - elseif (isset($_POST["selectable"])) {$selectable=$_POST["selectable"];} -if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} - elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["delete_users"])) {$delete_users=$_GET["delete_users"];} - elseif (isset($_POST["delete_users"])) {$delete_users=$_POST["delete_users"];} -if (isset($_GET["delete_user_groups"])) {$delete_user_groups=$_GET["delete_user_groups"];} - elseif (isset($_POST["delete_user_groups"])) {$delete_user_groups=$_POST["delete_user_groups"];} -if (isset($_GET["delete_lists"])) {$delete_lists=$_GET["delete_lists"];} - elseif (isset($_POST["delete_lists"])) {$delete_lists=$_POST["delete_lists"];} -if (isset($_GET["delete_campaigns"])) {$delete_campaigns=$_GET["delete_campaigns"];} - elseif (isset($_POST["delete_campaigns"])) {$delete_campaigns=$_POST["delete_campaigns"];} -if (isset($_GET["delete_ingroups"])) {$delete_ingroups=$_GET["delete_ingroups"];} - elseif (isset($_POST["delete_ingroups"])) {$delete_ingroups=$_POST["delete_ingroups"];} -if (isset($_GET["delete_remote_agents"])) {$delete_remote_agents=$_GET["delete_remote_agents"];} - elseif (isset($_POST["delete_remote_agents"])) {$delete_remote_agents=$_POST["delete_remote_agents"];} -if (isset($_GET["load_leads"])) {$load_leads=$_GET["load_leads"];} - elseif (isset($_POST["load_leads"])) {$load_leads=$_POST["load_leads"];} -if (isset($_GET["campaign_detail"])) {$campaign_detail=$_GET["campaign_detail"];} - elseif (isset($_POST["campaign_detail"])) {$campaign_detail=$_POST["campaign_detail"];} -if (isset($_GET["ast_admin_access"])) {$ast_admin_access=$_GET["ast_admin_access"];} - elseif (isset($_POST["ast_admin_access"])) {$ast_admin_access=$_POST["ast_admin_access"];} -if (isset($_GET["ast_delete_phones"])) {$ast_delete_phones=$_GET["ast_delete_phones"];} - elseif (isset($_POST["ast_delete_phones"])) {$ast_delete_phones=$_POST["ast_delete_phones"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} -if (isset($_GET["delete_scripts"])) {$delete_scripts=$_GET["delete_scripts"];} - elseif (isset($_POST["delete_scripts"])) {$delete_scripts=$_POST["delete_scripts"];} -if (isset($_GET["script_id"])) {$script_id=$_GET["script_id"];} - elseif (isset($_POST["script_id"])) {$script_id=$_POST["script_id"];} -if (isset($_GET["script_name"])) {$script_name=$_GET["script_name"];} - elseif (isset($_POST["script_name"])) {$script_name=$_POST["script_name"];} -if (isset($_GET["script_comments"])) {$script_comments=$_GET["script_comments"];} - elseif (isset($_POST["script_comments"])) {$script_comments=$_POST["script_comments"];} -if (isset($_GET["script_text"])) {$script_text=$_GET["script_text"];} - elseif (isset($_POST["script_text"])) {$script_text=$_POST["script_text"];} -if (isset($_GET["reset_hopper"])) {$reset_hopper=$_GET["reset_hopper"];} - elseif (isset($_POST["reset_hopper"])) {$reset_hopper=$_POST["reset_hopper"];} -if (isset($_GET["get_call_launch"])) {$get_call_launch=$_GET["get_call_launch"];} - elseif (isset($_POST["get_call_launch"])) {$get_call_launch=$_POST["get_call_launch"];} -if (isset($_GET["am_message_exten"])) {$am_message_exten=$_GET["am_message_exten"];} - elseif (isset($_POST["am_message_exten"])) {$am_message_exten=$_POST["am_message_exten"];} -if (isset($_GET["amd_send_to_vmx"])) {$amd_send_to_vmx=$_GET["amd_send_to_vmx"];} - elseif (isset($_POST["amd_send_to_vmx"])) {$amd_send_to_vmx=$_POST["amd_send_to_vmx"];} -if (isset($_GET["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_GET["xferconf_a_dtmf"];} - elseif (isset($_POST["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_POST["xferconf_a_dtmf"];} -if (isset($_GET["xferconf_a_number"])) {$xferconf_a_number=$_GET["xferconf_a_number"];} - elseif (isset($_POST["xferconf_a_number"])) {$xferconf_a_number=$_POST["xferconf_a_number"];} -if (isset($_GET["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_GET["xferconf_b_dtmf"];} - elseif (isset($_POST["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_POST["xferconf_b_dtmf"];} -if (isset($_GET["xferconf_b_number"])) {$xferconf_b_number=$_GET["xferconf_b_number"];} - elseif (isset($_POST["xferconf_b_number"])) {$xferconf_b_number=$_POST["xferconf_b_number"];} -if (isset($_GET["modify_leads"])) {$modify_leads=$_GET["modify_leads"];} - elseif (isset($_POST["modify_leads"])) {$modify_leads=$_POST["modify_leads"];} -if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} - elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} -if (isset($_GET["change_agent_campaign"])) {$change_agent_campaign=$_GET["change_agent_campaign"];} - elseif (isset($_POST["change_agent_campaign"])) {$change_agent_campaign=$_POST["change_agent_campaign"];} -if (isset($_GET["agent_choose_ingroups"])) {$agent_choose_ingroups=$_GET["agent_choose_ingroups"];} - elseif (isset($_POST["agent_choose_ingroups"])) {$agent_choose_ingroups=$_POST["agent_choose_ingroups"];} -if (isset($_GET["alt_number_dialing"])) {$alt_number_dialing=$_GET["alt_number_dialing"];} - elseif (isset($_POST["alt_number_dialing"])) {$alt_number_dialing=$_POST["alt_number_dialing"];} -if (isset($_GET["scheduled_callbacks"])) {$scheduled_callbacks=$_GET["scheduled_callbacks"];} - elseif (isset($_POST["scheduled_callbacks"])) {$scheduled_callbacks=$_POST["scheduled_callbacks"];} -if (isset($_GET["lead_filter_id"])) {$lead_filter_id=$_GET["lead_filter_id"];} - elseif (isset($_POST["lead_filter_id"])) {$lead_filter_id=$_POST["lead_filter_id"];} -if (isset($_GET["lead_filter_name"])) {$lead_filter_name=$_GET["lead_filter_name"];} - elseif (isset($_POST["lead_filter_name"])) {$lead_filter_name=$_POST["lead_filter_name"];} -if (isset($_GET["lead_filter_comments"])) {$lead_filter_comments=$_GET["lead_filter_comments"];} - elseif (isset($_POST["lead_filter_comments"])) {$lead_filter_comments=$_POST["lead_filter_comments"];} -if (isset($_GET["lead_filter_sql"])) {$lead_filter_sql=$_GET["lead_filter_sql"];} - elseif (isset($_POST["lead_filter_sql"])) {$lead_filter_sql=$_POST["lead_filter_sql"];} -if (isset($_GET["agentonly_callbacks"])) {$agentonly_callbacks=$_GET["agentonly_callbacks"];} - elseif (isset($_POST["agentonly_callbacks"])) {$agentonly_callbacks=$_POST["agentonly_callbacks"];} -if (isset($_GET["agentcall_manual"])) {$agentcall_manual=$_GET["agentcall_manual"];} - elseif (isset($_POST["agentcall_manual"])) {$agentcall_manual=$_POST["agentcall_manual"];} -if (isset($_GET["vicidial_recording"])) {$vicidial_recording=$_GET["vicidial_recording"];} - elseif (isset($_POST["vicidial_recording"])) {$vicidial_recording=$_POST["vicidial_recording"];} -if (isset($_GET["vicidial_transfers"])) {$vicidial_transfers=$_GET["vicidial_transfers"];} - elseif (isset($_POST["vicidial_transfers"])) {$vicidial_transfers=$_POST["vicidial_transfers"];} -if (isset($_GET["delete_filters"])) {$delete_filters=$_GET["delete_filters"];} - elseif (isset($_POST["delete_filters"])) {$delete_filters=$_POST["delete_filters"];} -if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_options=$_GET["alter_agent_interface_options"];} - elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];} -if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];} - elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];} -if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];} - elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];} -if (isset($_GET["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} -if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];} - elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];} -if (isset($_GET["drop_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} -if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];} - elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];} -if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];} - elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];} -if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];} - elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];} -if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];} - elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];} -if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];} - elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];} -if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];} - elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];} -if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];} - elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];} -if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];} - elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];} -if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];} - elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];} -if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];} - elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];} -if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];} - elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];} -if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];} - elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];} -if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];} - elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];} -if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];} - elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];} -if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];} - elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];} -if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];} - elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];} -if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];} - elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];} -if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];} - elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];} -if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];} - elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];} -if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];} - elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];} -if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];} - elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];} -if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];} - elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];} -if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];} - elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];} -if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];} - elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];} -if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];} - elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} -if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} - elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} -if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} - elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} -if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} - elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} - - if (isset($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS ONLY ### -$user_level = ereg_replace("[^0-9]","",$user_level); -$wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); -$drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); -$am_message_exten = ereg_replace("[^0-9]","",$am_message_exten); -$campaign_rec_exten = ereg_replace("[^0-9]","",$campaign_rec_exten); -$campaign_vdad_exten = ereg_replace("[^0-9]","",$campaign_vdad_exten); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); -$dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); -$park_ext = ereg_replace("[^0-9]","",$park_ext); -$hopper_level = ereg_replace("[^0-9]","",$hopper_level); -$agent_choose_ingroups = ereg_replace("[^0-9]","",$agent_choose_ingroups); -$hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); -$agentonly_callbacks = ereg_replace("[^0-9]","",$agentonly_callbacks); -$agentcall_manual = ereg_replace("[^0-9]","",$agentcall_manual); -$vicidial_recording = ereg_replace("[^0-9]","",$vicidial_recording); -$vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); -$closer_default_blended = ereg_replace("[^0-9]","",$closer_default_blended); -$alter_agent_interface_options = ereg_replace("[^0-9]","",$alter_agent_interface_options); -$delete_users = ereg_replace("[^0-9]","",$delete_users); -$delete_user_groups = ereg_replace("[^0-9]","",$delete_user_groups); -$delete_scripts = ereg_replace("[^0-9]","",$delete_scripts); -$delete_remote_agents = ereg_replace("[^0-9]","",$delete_remote_agents); -$delete_lists = ereg_replace("[^0-9]","",$delete_lists); -$delete_ingroups = ereg_replace("[^0-9]","",$delete_ingroups); -$delete_filters = ereg_replace("[^0-9]","",$delete_filters); -$delete_campaigns = ereg_replace("[^0-9]","",$delete_campaigns); -$delete_call_times = ereg_replace("[^0-9]","",$delete_call_times); -$load_leads = ereg_replace("[^0-9]","",$delete_call_times); -$campaign_detail = ereg_replace("[^0-9]","",$campaign_detail); -$ast_delete_phones = ereg_replace("[^0-9]","",$ast_delete_phones); -$ast_admin_access = ereg_replace("[^0-9]","",$ast_admin_access); -$modify_leads = ereg_replace("[^0-9]","",$modify_leads); -$change_agent_campaign = ereg_replace("[^0-9]","",$change_agent_campaign); -$modify_call_times = ereg_replace("[^0-9]","",$modify_call_times); -$ct_wednesday_stop = ereg_replace("[^0-9]","",$ct_wednesday_stop); -$ct_wednesday_start = ereg_replace("[^0-9]","",$ct_wednesday_start); -$ct_tuesday_stop = ereg_replace("[^0-9]","",$ct_tuesday_stop); -$ct_tuesday_start = ereg_replace("[^0-9]","",$ct_tuesday_start); -$ct_thursday_stop = ereg_replace("[^0-9]","",$ct_thursday_stop); -$ct_thursday_start = ereg_replace("[^0-9]","",$ct_thursday_start); -$ct_sunday_stop = ereg_replace("[^0-9]","",$ct_sunday_stop); -$ct_sunday_start = ereg_replace("[^0-9]","",$ct_sunday_start); -$ct_saturday_stop = ereg_replace("[^0-9]","",$ct_saturday_stop); -$ct_saturday_start = ereg_replace("[^0-9]","",$ct_saturday_start); -$ct_monday_stop = ereg_replace("[^0-9]","",$ct_monday_stop); -$ct_monday_start = ereg_replace("[^0-9]","",$ct_monday_start); -$ct_friday_stop = ereg_replace("[^0-9]","",$ct_friday_stop); -$ct_friday_start = ereg_replace("[^0-9]","",$ct_friday_start); -$ct_default_stop = ereg_replace("[^0-9]","",$ct_default_stop); -$ct_default_start = ereg_replace("[^0-9]","",$ct_default_start); -$number_of_lines = ereg_replace("[^0-9]","",$number_of_lines); -$user_start = ereg_replace("[^0-9]","",$user_start); -$phone_number = ereg_replace("[^0-9]","",$phone_number); -$remote_agent_id = ereg_replace("[^0-9]","",$remote_agent_id); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); -$attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); -$hotkey = ereg_replace("[^0-9]","",$hotkey); -$list_id = ereg_replace("[^0-9]","",$list_id); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); -$allow_closers = ereg_replace("[^NY]","",$allow_closers); -$reset_hopper = ereg_replace("[^NY]","",$reset_hopper); -$amd_send_to_vmx = ereg_replace("[^NY]","",$amd_send_to_vmx); -$alt_number_dialing = ereg_replace("[^NY]","",$alt_number_dialing); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); -$selectable = ereg_replace("[^NY]","",$selectable); -$reset_list = ereg_replace("[^NY]","",$reset_list); -$fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); -$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); - -### ALPHA-NUMERIC ONLY ### -$user = ereg_replace("[^0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^0-9a-zA-Z]","",$pass); -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); -$submit = ereg_replace("[^0-9a-zA-Z]","",$submit); -$CoNfIrM = ereg_replace("[^0-9a-zA-Z]","",$CoNfIrM); -$campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid); -$get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch); -$campaign_recording = ereg_replace("[^0-9a-zA-Z]","",$campaign_recording); -$ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD); -$dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix); -$state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state); -$scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); - -### DIGITS and Dots -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); - -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); - -### ALPHA-NUMERIC and underscore and dash -$dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); -$dial_status_d = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_d); -$dial_status_c = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_c); -$dial_status_b = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_b); -$dial_status_a = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_a); -$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage); -$lead_filter_id = ereg_replace("[^-\_0-9a-zA-Z]","",$lead_filter_id); -$campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id); -$old_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_campaign_id); -$park_file_name = ereg_replace("[^-\_0-9a-zA-Z]","",$park_file_name); -$next_agent_call = ereg_replace("[^-\_0-9a-zA-Z]","",$next_agent_call); -$local_call_time = ereg_replace("[^-\_0-9a-zA-Z]","",$local_call_time); -$call_time_id = ereg_replace("[^-\_0-9a-zA-Z]","",$call_time_id); -$phone_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_pass); -$phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); -$group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); -$user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); -$OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); -$state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); - -### ALPHA-NUMERIC and spaces -$lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); -### ALPHA-NUMERIC and hash -$group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); -$campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); -$status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); -$HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); -$status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); -$script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); -$script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); -$list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); -$lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); -$lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); -$campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); -$call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); -$call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - -### remove semi-colons ### -$lead_filter_sql = ereg_replace(";","",$lead_filter_sql); - -### VARIABLES TO BE mysql_real_escape_string ### -# $web_form_address -# $script_text - -##### END VARIABLE FILTERING FOR SECURITY ##### - - -# AST GUI database administration -# admin.php -# -# CHANGES -# 50315-1110 - Added Custom Campaign Statuses -# 50317-1438 - Added Fronter Display var to inbound groups -# 50322-1355 - Added custom callerID per campaign -# 50517-1356 - Added user_groups sections and user_group to vicidial_users -# 50517-1440 - Added ability to logout (must click OK with empty user/pass) -# 50602-1622 - Added lead loader pages to load new files into vicidial_list -# 50620-1351 - Added custom vdad transfer AGI extension per campaign -# 50810-1414 - modified in groups to kick out spaces and dashes -# 50908-2136 - Added Custom Campaign HotKeys -# 50914-0950 - Fixed user search by user_group -# 50926-1358 - Modified to allow for language translation -# 50926-1615 - Added WeBRooTWritablE write controls -# 51020-1008 - Added editable web address and park ext - NEW dial campaigns -# 51020-1056 - Added fields and help for campaign recording control -# 51123-1335 - Altered code to function in php globals=off -# 51208-1038 - Added user_level changes, function controls and default user phones -# 51208-1556 - Added deletion of users/lists/campaigns/in groups/remote agents -# 51213-1706 - Added add/delete/modify vicidial scripts -# 51214-1737 - Added preview of vicidial script in popup window -# 51219-1225 - Added campaign and ingroups script selector and get_call_launch field -# 51222-1055 - Added am_message_exten to campaigns to allow for AM Message button -# 51222-1125 - Fixed new vicidial_campaigns default values not being assigned bug -# 51222-1156 - Added LOG OUT ALL AGENTS ON THIS CAMPAIGN button to campaign screen -# 60204-0659 - Fixed hopper reset bug -# 60207-1413 - Added AMD send to voicemail extension and xfer-conf dtmf presets -# 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 -# 60417-1416 - Added vicidial_lead_filters sections -# - Changed the header links to color-coded sectional with sublinks below -# - Added filter name and script name to campaign and in-group modify sections -# - Added callback and alt dial options to campaigns section -# - Added callback, alt dial and other options to users section -# 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered -# 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60425-2355 - Added agent options to vicidial_users, reformatted user page -# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen -# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen -# 60505-1117 - Added initial framework for new local_call_times tables and definitions -# 60506-1033 - More revisions to the local_call_time section -# 60508-1354 - Finished call_times and state_call_times sections -# - Added modify/delete options for call_times -# 60509-1311 - Functionalize campaign dialable leads calculation -# - Change state_call_times selection from call_times to only allow one per state -# - Added dialable leads count popup to campaign screen if auto-calc is disabled -# - Added test dialable leads count popup to filter screen -# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen -# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen -# 60609-1051 - Added add-to-dnc in LISTS section -# 60613-1415 - Added lead recycling options to campaign detail screen -# 60619-1523 - Added variable filtering to eliminate SQL injection attack threat -# 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug -# - -# 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.12-3'; -$build = '60623-1159'; - -$STARTtime = date("U"); - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGuser_level =$row[4]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN: "; - -if (!isset($ADD)) {$ADD=0;} - -if ($ADD==1) {$hh='users'; echo "Add New User";} -if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";} -if ($ADD==111) {$hh='lists'; echo "Add New List";} -if ($ADD==121) {$hh='lists'; echo "Add New DNC";} -if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} -if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} -if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} -if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";} -if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";} -if ($ADD==111111111) {$hh='times'; echo "Add New Call Time";} -if ($ADD==1111111111) {$hh='times'; echo "Add New State Call Time";} -if ($ADD==2) {$hh='users'; echo "New User Addition";} -if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} -if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} -if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; echo "New Campaign Lead Recycle Addition";} -if ($ADD==211) {$hh='lists'; echo "New List Addition";} -if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} -if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";} -if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";} -if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";} -if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";} -if ($ADD==211111111) {$hh='times'; echo "New Call Time Addition";} -if ($ADD==2111111111) {$hh='times'; echo "New State Call Time Addition";} -if ($ADD==3) {$hh='users'; echo "Modify User";} -if ($ADD==31) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==34) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==311) {$hh='lists'; echo "Modify List";} -if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==311111111) {$hh='times'; echo "Modify Call Time";} -if ($ADD==321111111) {$hh='times'; echo "Modify Call Time State Definitions List";} -if ($ADD==3111111111) {$hh='times'; echo "Modify State Call Time";} -if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";} -if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";} -if ($ADD==4) {$hh='users'; echo "Modify User";} -if ($ADD==41) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==42) {$hh='campaigns'; echo "Modify Campaign Status";} -if ($ADD==43) {$hh='campaigns'; echo "Modify Campaign HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==45) {$hh='campaigns'; echo "Modify Campaign Lead Recycle";} -if ($ADD==411) {$hh='lists'; echo "Modify List";} -if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==411111111) {$hh='times'; echo "Modify Call Time";} -if ($ADD==4111111111) {$hh='times'; echo "Modify State Call Time";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==52) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==511111111) {$hh='times'; echo "Delete Call Time";} -if ($ADD==5111111111) {$hh='times'; echo "Delete State Call Time";} -if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==65) {$hh='campaigns'; echo "Delete Lead Recycle";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==611111111) {$hh='times'; echo "Delete Call Time";} -if ($ADD==6111111111) {$hh='times'; echo "Delete State Call Time";} -if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";} -if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} -if ($ADD==0) {$hh='users'; echo "Users List";} -if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} -if ($ADD==81) {$hh='campaigns'; echo "CallBacks Within Campaign";} -if ($ADD==811) {$hh='campaigns'; echo "CallBacks Within List";} -if ($ADD==10) {$hh='campaigns'; echo "Campaigns";} -if ($ADD==100) {$hh='lists'; echo "Lists";} -if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} -if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";} -if ($ADD==100000) {$hh='usergroups'; echo "User Groups";} -if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} -if ($ADD==10000000) {$hh='filters'; echo "Filters";} -if ($ADD==100000000) {$hh='times'; echo "Call Times";} -if ($ADD==1000000000) {$hh='times'; echo "State Call Times";} -if ($ADD==55) {$hh='users'; echo "Search Form";} -if ($ADD==66) {$hh='users'; echo "Search Results";} -if ($ADD==99999) {$hh='users'; echo "HELP";} - -if ( ($ADD>9) && ($ADD < 99998) ) - { - ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $scripts_to_print = mysql_num_rows($rslt); - $scripts_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($scripts_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $scriptname_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - $filters_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($filters_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $filtername_list["$rowx[0]"] = "$rowx[1]"; - $filtersql_list["$rowx[0]"] = "$rowx[2]"; - $o++; - } - - ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $times_to_print = mysql_num_rows($rslt); - - $o=0; - while ($times_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $call_timename_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - } - -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD==31) or ($ADD==41) or ($ADD=="4A") or ($ADD=="4B") ) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ($ADD==31) - { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ($ADD==3) - { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) - { - if ($group_id_value == $groups[$p]) - { - $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; - } - $p++; - } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; - $o++; - } - if (strlen($groups_value)>2) {$groups_value .= " -";} - } - - - - - -$NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; -$NWE = "')\"><IMG SRC=\"../astguiclient/help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
VICIDIAL ADMIN: HELP


\n"; - -?> -VICIDIAL_USERS TABLE

- -
-User ID - This field is where you put the VICIDIAL users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. - -
-
-
-Password - This field is where you put the VICIDIAL users password. Must be at least 2 characters in length. - -
-
-
-Full Name - This field is where you put the VICIDIAL users full name. Must be at least 2 characters in length. - -
-
-
-User Level - This menu is where you select the VICIDIAL users user level. Must be a level of 1 to log into VICIDIAL, Must be level greater than 2 to log in as a closer, Must be user level 8 or greater to get into admin web section. - -
-
-
-User Group - This menu is where you select the VICIDIAL users group that this user will belong to. This does not have any restrictions at this time, this is just to subdivide users and allow for future features based upon it. - -
-
-
-Phone Login - Here is where you can set a default phone login value for when the user logs into vicidial.php. This value will populate the phone_login automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen. - -
-
-
-Phone Pass - Here is where you can set a default phone pass value for when the user logs into vicidial.php. This value will populate the phone_pass automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen. - -
-
-
-HotKeys Active - This option if set to 1 allows the user to use the HotKeys quick-dispositioning function in vicidial.php. - -
-
-
-Agent Choose Ingroups - This option if set to 1 allows the user to choose the ingroups that they will receive calls from when they login to a CLOSER or INBOUND campaign. Otherwise the Manager will need to set this in their user detail screen of the admin page. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - -
-
-
-Scheduled Callbacks - This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated. - -
-
-
-Agent-Only Callbacks - This option allows an agent to set a callback so that they are the only Agent that can call the customer back. This also allows the agent to see their callback listings and call them back any time they want to. - -
-
-
-Agent Call Manual - This option allows an agent to manually enter a new lead into the system and call them. This also allows the calling of any phone number from their vicidial screen and puts that call into their session. Use this option with caution. - -
-
-
-Vicidial Recording - This option can prevent an agent from doing any recordings after they log in to vicidial. This option must be on for vicidial to follow the campaign recording session. - -
-
-
-Vicidial Transfers - This option can prevent an agent from opening the transfer - conference session of vicidial. If this is disabled, the agent cannot third party call or blind transfer any calls. - -
-
-
-Closer Default Blended - This option simply defaults the Blended checkbox on a CLOSER login screen. - -
-
-
-Alter Agent Interface Options - This option if set to 1 allows the administrative user to modify the Agents interface options in admin.php. - -
-
-
-Delete Users - This option if set to 1 allows the user to delete other users of equal or lesser user level from the system. - -
-
-
-Delete User Groups - This option if set to 1 allows the user to delete user groups from the system. - -
-
-
-Delete Lists - This option if set to 1 allows the user to delete vicidial lists from the system. - -
-
-
-Delete Campaigns - This option if set to 1 allows the user to delete vicidial campaigns from the system. - -
-
-
-Delete In-Groups - This option if set to 1 allows the user to delete vicidial In-Groups from the system. - -
-
-
-Delete Remote Agents - This option if set to 1 allows the user to delete vicidial remote agents from the system. - -
-
-
-Load Leads - This option if set to 1 allows the user to load vicidial leads into the vicidial_list table by way of the web based lead loader. - -
-
-
-Campaign Detail - This option if set to 1 allows the user to view and modify the campaign detail screen elements. - -
-
-
-AGC Admin Access - This option if set to 1 allows the user to login to the astGUIclient admin pages. - -
-
-
-AGC Delete Phones - This option if set to 1 allows the user to delete phone entries in the astGUIclient admin pages. - -
-
-
-Delete Scripts - This option if set to 1 allows the user to delete Campaign scripts in the script modification screen. - -
-
-
-Modify Leads - This option if set to 1 allows the user to modify leads in the admin section lead search results page. - -
-
-
-Change Agent Campaign - This option if set to 1 allows the user to alter the campaign that an agent is logged into while they are logged into it. - -
-
-
-Delete Filters - This option allows the user to be able to delete vicidial lead filters from the system. - -
-
-
-Delete Call Times - This option allows the user to be able to delete vicidial call times records and vicidial state call times records from the system. - -
-
-
-Modify Call Times - This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen. - - - - -



- -VICIDIAL_CAMPAIGNS TABLE

-
-
-Campaign ID - This is the short name of the campaign, it is not editable after initial submission, cannot contain spaces and must be between 2 and 8 characters in length. - -
-
-
-Campaign Name - This is the description of the campaign, it must be between 6 and 40 characters in length. - -
-
-
-Active - This is where you set the campaign to Active or Inactive. If Inactive, noone can log into it. - -
-
-
-Park Extension - This is where you can customize the on-hold music for VICIDIAL. Make sure the extension is in place in the extensions.conf and that it points to the filename below. - -
-
-
-Park File Name - This is where you can customize the on-hold music for VICIDIAL. Make sure the filename is 10 characters in length or less and that the file is in place in the /var/lib/asterisk/sounds directory. - -
-
-
-Web Form - This is where you can set the custom web page that will be opened when the user clicks on the WEB FORM button. - -
-
-
-Allow Closers - This is where you can set whether the users of this campaign will have the option to send the call to a closer. - -
-
-
-Dial Status - This is where you set the statuses that you are wanting to dial on within the lists that are active for the campaign below - -
-
-
-List Order - This menu is where you select how the leads that match the statuses selected above will be put in the lead hopper: -
  - DOWN: select the first leads loaded into the vicidial_list table -
  - UP: select the last leads loaded into the vicidial_list table -
  - UP PHONE: select the highest phone number and works its way down -
  - DOWN PHONE: select the lowest phone number and works its way up -
  - UP LAST NAME: starts with last names starting with Z and works its way down -
  - DOWN LAST NAME: starts with last names starting with A and works its way up -
  - UP COUNT: starts with most called leads and works its way down -
  - DOWN COUNT: starts with least called leads and works its way up -
  - DOWN COUNT 2nd NEW: starts with least called leads and works its way up inserting a NEW lead in every other lead - Must NOT have NEW selected in the dial statuses -
  - DOWN COUNT 3nd NEW: starts with least called leads and works its way up inserting a NEW lead in every third lead - Must NOT have NEW selected in the dial statuses -
  - DOWN COUNT 4th NEW: starts with least called leads and works its way up inserting a NEW lead in every forth lead - Must NOT have NEW selected in the dial statuses - -
-
-
-Hopper Level - This is how many leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute. - -
-
-
-Lead Filter - This is a method of filtering your leads using a fragment of a SQL query. Use this feature with caution, it is easy to stop dialing accidentally with the slightest alteration to the SQL statement. Default is NONE. - -
-
-
-Force Reset of Hopper - This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. - -
-
-
-Auto Dial Level - This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. -
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. - -
-
-
-Local Call Time - This is where you set during which hours you would like to dial, as determined by the local time in the are in which you are calling. This is controlled by area code and is adjusted for Daylight Savings time if applicable. General Guidelines in the USA for Business to Business is 9am to 5pm and Business to Consumer calls is 9am to 9pm. - -
-
-
-Dial Timeout - If defined, calls that would normally hangup after the timeout defined in extensions.conf would instead timeout at this amount of seconds if it is less than the extensions.conf timeout. This allows for quickly changing dial timeouts from server to server and limiting the effects to a single campaign. If you are having a lot of Answering Machine or Voicemail calls you may want to try changing this value to between 21-26 and see if results improve. - -
-
-
-Dial Prefix - This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dialplan - extensions.conf. - -
-
-
-Campaign CallerID - This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID. - -
-
-
-Campaign VDAD extension - This field allows for a custom VDAD transfer extension. This allows you to use different VDADtransfer...agi scripts depending upon your campaign. The default transfer AGI - exten 8365 agi-VDADtransfer.agi - just immediately sends the calls on to agents as soon as they are picked up. An additional sample political survey AGI is also now included - 8366 agi-VDADtransferSURVEY.agi - that plays a message to the called person and allows them to make a choice by pressing buttons - effectively pre-screening the lead - . Please note that except for surveys, political calls and charities this form of calling is illegal in the United States. - -
-
-
-Campaign Rec extension - This field allows for a custom recording extension to be used with VICIDIAL. This allows you to use different extensions depending upon how long you want to allow a maximum recording and what type of codec you want to record in. The default exten is 8309 which if you follow the SCRATCH_INSTALL examples will record in the WAV format for upto one hour. Another option included in the examples is 8310 which will record in GSM format for upto one hour. - -
-
-
-Campaign Recording - This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. - -
-
-
-Campaign Rec Filename - This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. - -
-
-
-Campaign Script - This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign. - -
-
-
-Get Call Launch - This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. - -
-
-
-Answering Machine Message - This field is for entering in an extension to blind transfer calls to when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this exten up in the dialplan - extensions.conf - and make sure it plays an audio file then hangs up. - -
-
-
-AMD send to vm exten - This menu allows you to define whether a message is left on an answering machine when it is detected. the call will be immediately forwarded to the Answering-Machine-Message extension if AMD is active and it is determined that the call is an answering machine. - -
-
-
-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. - -
-
-
-Agent Alt Num Dialing - This option allows an agent to manually dial the alternate phone number or address3 field after the main number has been called. - -
-
-
-Scheduled Callbacks - This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated. - -
-
-
-Drop Call Seconds - The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Safe Harbor Message - If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y. - -
-
-
-Safe Harbor Exten - This is the dialplan extension that the desired Safe Harbor audio file is located at on your server. - -
-
-
-Wrapup Seconds - The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition. - -
-
-
-Wrapup Message - This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set. - -
-
-
-Wrapup Message - This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set. - -
-
-
-Use Internal DNC List - This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N. - -
-
-
-Allowed Inbound Groups - For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. - - - -



- -VICIDIAL_LISTS TABLE

-
-
-List ID - This is the numerical name of the list, it is not editable after initial submission, must contain only numbers and must be between 2 and 8 characters in length. - -
-
-
-List Name - This is the description of the list, it must be between 2 and 20 characters in length. - -
-
-
-Campaign - This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time. - -
-
-
-Active - This defines whether the list is to be dialed on or not. - -
-
-
-Reset Lead-Called-Status for this list - This resets all leads in this list to N for "not called since last reset" and means that any lead can now be called if it is the right status as defined in the campaign screen. - -
-
-
-VICIDIAL DNC List - This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add a number to this list so that it will not be called by campaigns that use the internal DNC list. - - - -



- -VICIDIAL_INBOUND_GROUPS TABLE

-
-
-Group ID - This is the short name of the inbound group, it is not editable after initial submission, must not contain any spaces and must be between 2 and 20 characters in length. - -
-
-
-Group Name - This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes, plusses or spaces . - -
-
-
-Group Color - This is the color that displays in the VICIDIAL client app when a call comes in on this group. It must be between 2 and 7 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or VICIDIAL will not work properly. - -
-
-
-Active - This determines whether this group show up in the selection box when a VICIDIAL agent logs in. - -
-
-
-Web Form - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this group. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. -
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. - -
-
-
-Fronter Display - This field determines whether the inbound VICIDIAL agent would have the fronter name - if there is one - displayed in the Status field when the call comes to the agent. - -
-
-
-Campaign Script - This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign. - -
-
-
-Get Call Launch - This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. - -
-
-
-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. - -
-
-
-Drop Call Seconds - The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Drop Message - If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y. - -
-
-
-Drop Exten - This is the dialplan extension that the desired Dropped call audio file is located at on your server. - - - -



- -VICIDIAL_REMOTE_AGENTS TABLE

-
-
-User ID Start - This is the starting User ID that is used when the remote agent entries are inserted into the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new VICIDIAL user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account. - -
-
-
-Number of Lines - This defines how many remote agent entries the system creates, and determines how many lines it thinks it can safely send to the number below. - -
-
-
-Server IP - A remote agent entry is only good for one specific server, here is where you select which server you want. - -
-
-
-External Extension - This is the number that you want the calls forwarded to. Make sure that it is a full dialplan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system. - -
-
-
-Status - Here is where you turn the remote agent on and off. As soon as the agent is Active the system assumes that it can send calls to it. It may take up to 30 seconds once you change the status to Inactive to stop receiving calls. - -
-
-
-Campaign - Here is where you select the campaign that these remote agents will be logged into. Inbound needs to use the CLOSER campaign and select the inbound campaigns below that you want to receive calls from. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - - -



- -VICIDIAL_CAMPAIGN_LISTS

-
-
-The lists within this campaign are listed here, whether they are active is denoted by the Y or N and you can go to the list screen by clicking on the list ID in the first column. - - -



- -VICIDIAL_CAMPAIGN_STATUSES TABLE

-
-
-Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition. - - - -



- -VICIDIAL_CAMPAIGN_HOTKEYS TABLE

-
-
-Through the use of custom campaign hotkeys, agents that use the vicidial web-client can hangup and disposition calls just by pressing a single key on their keyboard. - - - - -



- -VICIDIAL_LEAD_RECYCLE TABLE

-
-
-Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links. This feature only works in auto-dial mode, where dial level is greater than 0. - - - - - -



- -VICIDIAL_USER_GROUPS TABLE

-
-
-User Group - This is the short name of a Vicidial User group, try not to use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters. - -
-
-
-Group Name - This is the description of the vicidial user group max of 40 characters. - - - - - -



- -VICIDIAL_SCRIPTS TABLE

-
-
-Script ID - This is the short name of a Vicidial Script. This needs to be a unique identifier. Try not to use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Script Name - This is the title of a Vicidial Script. This is a short summary of the script. max 50 characters, minimum of 2 characters. There should be no spaces or punctuation of any kind in theis field. - -
-
-Script Comments - This is where you can place comments for a Vicidial Script such as -changed to free upgrade on Sept 23-. max 255 characters, minimum of 2 characters. - -
-
-Script Text - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today? - -
-
-
-Active - This determines whether this script can be selected to be used by a campaign. - - - - - -



- -VICIDIAL_LEAD_FILTERS TABLE

-
-
-Filter ID - This is the short name of a Vicidial Lead Filter. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Filter Name - This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters. - -
-
-Filter Comments - This is where you can place comments for a Vicidial Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters. - -
-
-Filter SQL - This is where you place the SQL query fragment that you want to filter by. do not begin or end with an AND, that will be added by the hopper cron script automatically. an example SQL query that would work here is- called_count > 4 and called_count < 8 -. - - - - - -



- -VICIDIAL_CALL TIMES TABLE

-
-
-Call Time ID - This is the short name of a Vicidial Call Time Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Call Time Name - This is a more descriptive name of the Call Time Definition. This is a short summary of the Call Time definition. max 30 characters, minimum of 2 characters. - -
-
-Call Time Comments - This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters. - -
-
-Default Start and Stop Times - This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400. - -
-
-Weekday Start and Stop Times - These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times. - -
-
-State Call Time Definitions - This is the list of State specific call time definitions that are followed in this Call Time Definition. - -
-
-State Call Time State - This is the two letter code for the state that this calling time definition is for. For this to be in effect the local call time that is set in the campaign must have this state call time record in it as well as all of the leads having two letter state codes in them. - - - - -



- -VICIDIAL LIST LOADER FUNCTIONALITY

-
-
-The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. There is also a new beta version super lead loader that allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation or check for duplicates in itself or other lists, so that is something you need to do before you load the leads. Also, make sure that you have created the list that these leads are to be under so that you can use them. There is also the matter of time-zone-coding these leads. You may want to increase the frequency that the ADMIN_adjust_GMTnow_on_leads.pl is being run in the cron on your Asterisk server so that any loaded leads can be coded faster. Here is a list of the fields in their proper order for the lead files: -
    -
  1. Vendor Lead Code - shows up in the Vendor ID field of the GUI -
  2. Source Code - internal use only for admins and DBAs -
  3. List ID - the list number that these leads will show up under -
  4. Phone Code - the prefix for the phone number - 1 for US, 01144 for UK, 01161 for AUS, etc -
  5. Phone Number - must be at least 8 digits long -
  6. Title - title of the customer - Mr. Ms. Mrs, etc... -
  7. First Name -
  8. Middle Initial -
  9. Last Name -
  10. Address Line 1 -
  11. Address Line 2 -
  12. Address Line 3 -
  13. City -
  14. State - limited to 2 characters -
  15. Province -
  16. Postal Code -
  17. Country -
  18. Gender -
  19. Date of Birth -
  20. Alternate Phone Number -
  21. Email Address -
  22. Security Phrase -
  23. Comments -
- -
NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /home/cron/AST_SERVER_conf.pl file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. - -







-







-THE END -
-\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$dial_status_a = $row[3]; -$dial_status_b = $row[4]; -$dial_status_c = $row[5]; -$dial_status_d = $row[6]; -$dial_status_e = $row[7]; -$local_call_time = $row[16]; -if ($lead_filter_id=='') - { - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') - { - $lead_filter_id='NONE'; - } - } - -$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; -$rslt=mysql_query($stmt, $link); -$lists_to_print = mysql_num_rows($rslt); -$camp_lists=''; -$o=0; -while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; -if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} -} -$camp_lists = eregi_replace(".$","",$camp_lists); - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - -echo "

\n"; -echo "Show Dialable Leads Count -

\n"; -echo "CAMPAIGN: $campaign_id
\n"; -echo "LISTS: $camp_lists
\n"; -echo "STATUSES: $dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e
\n"; -echo "FILTER: $lead_filter_id
\n"; -echo "CALL TIME: $local_call_time

\n"; - -### call function to calculate and print dialable leads -dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - -echo "

\n"; -echo "\n"; - -exit; -} - - -###################### -# ADD=7111111 view sample script with test variables -###################### - -if ($ADD==7111111) -{ - ##### TEST VARIABLES ##### - $vendor_lead_code = 'VENDORLEADCODE'; - $list_id = 'LISTID'; - $gmt_offset_now = 'GMTOFFSET'; - $phone_code = '1'; - $phone_number = '7275551212'; - $title = 'Mr.'; - $first_name = 'JOHN'; - $middle_initial = 'Q'; - $last_name = 'PUBLIC'; - $address1 = '1234 Main St.'; - $address2 = 'Apt. 3'; - $address3 = 'ADDRESS3'; - $city = 'CHICAGO'; - $state = 'IL'; - $province = 'PROVINCE'; - $postal_code = '33760'; - $country_code = 'USA'; - $gender = 'M'; - $date_of_birth = '1970-01-01'; - $alt_phone = '3125551212'; - $email = 'test@test.com'; - $security_phrase = 'SECUTIRY'; - $comments = 'COMMENTS FIELD'; - $RGfullname = 'JOE AGENT'; - $RGuser = '6666'; - -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; - -$script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); -$script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); -$script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); -$script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); -$script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); -$script_text = eregi_replace('--A--title--B--',"$title",$script_text); -$script_text = eregi_replace('--A--first_name--B--',"$first_name",$script_text); -$script_text = eregi_replace('--A--middle_initial--B--',"$middle_initial",$script_text); -$script_text = eregi_replace('--A--last_name--B--',"$last_name",$script_text); -$script_text = eregi_replace('--A--address1--B--',"$address1",$script_text); -$script_text = eregi_replace('--A--address2--B--',"$address2",$script_text); -$script_text = eregi_replace('--A--address3--B--',"$address3",$script_text); -$script_text = eregi_replace('--A--city--B--',"$city",$script_text); -$script_text = eregi_replace('--A--state--B--',"$state",$script_text); -$script_text = eregi_replace('--A--province--B--',"$province",$script_text); -$script_text = eregi_replace('--A--postal_code--B--',"$postal_code",$script_text); -$script_text = eregi_replace('--A--country_code--B--',"$country_code",$script_text); -$script_text = eregi_replace('--A--gender--B--',"$gender",$script_text); -$script_text = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$script_text); -$script_text = eregi_replace('--A--alt_phone--B--',"$alt_phone",$script_text); -$script_text = eregi_replace('--A--email--B--',"$email",$script_text); -$script_text = eregi_replace('--A--security_phrase--B--',"$security_phrase",$script_text); -$script_text = eregi_replace('--A--comments--B--',"$comments",$script_text); -$script_text = eregi_replace('--A--fullname--B--',"$RGfullname",$script_text); -$script_text = eregi_replace('--A--user--B--',"$RGuser",$script_text); -$script_text = eregi_replace("\n","
",$script_text); - - -echo ""; - -echo "Preview Script: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') {$users_hh='bgcolor ="#FFFF99"'; $users_fc='BLACK';} # yellow - else {$users_hh=''; $users_fc='WHITE';} -if ($hh=='campaigns') {$campaigns_hh='bgcolor ="#FFCC99"'; $campaigns_fc='BLACK';} # orange - else {$campaigns_hh=''; $campaigns_fc='WHITE';} -if ($hh=='lists') {$lists_hh='bgcolor ="#FFCCCC"'; $lists_fc='BLACK';} # red - else {$lists_hh=''; $lists_fc='WHITE';} -if ($hh=='ingroups') {$ingroups_hh='bgcolor ="#CC99FF"'; $ingroups_fc='BLACK';} # purple - else {$ingroups_hh=''; $ingroups_fc='WHITE';} -if ($hh=='remoteagent') {$remoteagent_hh='bgcolor ="#CCFFCC"'; $remoteagent_fc='BLACK';} # green - else {$remoteagent_hh=''; $remoteagent_fc='WHITE';} -if ($hh=='usergroups') {$usergroups_hh='bgcolor ="#CCFFFF"'; $usergroups_fc='BLACK';} # cyan - else {$usergroups_hh=''; $usergroups_fc='WHITE';} -if ($hh=='scripts') {$scripts_hh='bgcolor ="#99FFCC"'; $scripts_fc='BLACK';} # light teal - else {$scripts_hh=''; $scripts_fc='WHITE';} -if ($hh=='filters') {$filters_hh='bgcolor ="#CCCCCC"'; $filters_fc='BLACK';} # grey - else {$filters_hh=''; $filters_fc='WHITE';} -if ($hh=='times') {$times_hh='bgcolor ="#99FF33"'; $times_fc='BLACK';} # hard teal - else {$times_hh=''; $times_fc='WHITE';} - -?> - - - - -\n"; -echo "
English Español
- - - - - - - - - - - - - - - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - - - - -
  VICIDIAL ADMIN - Logout  
> SIZE=1> USERS > SIZE=1> CAMPAIGNS > SIZE=1> LISTS > SIZE=1> SCRIPTS > SIZE=1> FILTERS > SIZE=1> IN-GROUPS > SIZE=1> CALL TIMES > SIZE=1> USER GROUPS > SIZE=1> REMOTE AGENTS > REPORTS
  LIST USERS     |     ADD A NEW USER     |     SEARCH FOR A USER
  ADD CAMPAIGN     |     LIST CAMPAIGNS
  SHOW LISTS     |     ADD NEW LIST     |     SEARCH FOR A LEAD |     ADD NUMBER TO DNC           |     LOAD NEW LEADS
  ADD SCRIPT     |     VIEW SCRIPTS
  ADD FILTER     |     VIEW FILTERS
  SHOW IN-GROUPS     |     ADD NEW IN-GROUP
  SHOW CALL TIMES     |     ADD NEW CALL TIME     |     SHOW STATE CALL TIMES     |     ADD NEW STATE CALL TIME  
  ADD USER GROUP     |     LIST USER GROUPS     |     GROUP HOURLY
  SHOW REMOTE AGENTS     |     ADD NEW REMOTE AGENTS
 
-
\n"; -echo ""; - -echo "
ADD A NEW USER
\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "$NWB#vicidial_users-user_group$NWE\n"; -echo "\n"; -echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group:
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN -###################### - -if ($ADD==11) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW CAMPAIGN\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $NWB#vicidial_campaigns-park_ext$NWE
Park Filename: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List ID: (digits only)$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
\n"; - -} - - -###################### -# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number -###################### - -if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) - { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NOT ADDED - This phone number is already in the Do Not Call List: $phone_number

\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC ADDED: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); - } - } - } - -echo "
ADD A NUMBER TO THE DNC LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Phone Number: (digits only)$NWB#vicidial_list-dnc$NWE
\n"; - -} - - -###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN -###################### - -if ($ADD==1111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW INBOUND GROUP\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN -###################### - -if ($ADD==11111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW REMOTE AGENTS\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dialplan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - -###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN -###################### - -if ($ADD==111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW USERS GROUP\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -} - - -###################### -# ADD=1111111 display the ADD NEW SCRIPT SCREEN -###################### - -if ($ADD==1111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW SCRIPT\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Script ID: (no spaces or punctuation)$NWB#vicidial_scripts-script_id$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text: $NWB#vicidial_scripts-script_text$NWE
\n"; - -} - - -###################### -# ADD=11111111 display the ADD NEW FILTER SCREEN -###################### - -if ($ADD==11111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW FILTER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Filter ID: (no spaces or punctuation)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; -} - - -###################### -# ADD=111111111 display the ADD NEW CALL TIME SCREEN -###################### - -if ($ADD==111111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW CALL TIME\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; -} - - -###################### -# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN -###################### - -if ($ADD==1111111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW STATE CALL TIME\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
State Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (no spaces or punctuation)$NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 2 series, validates form data and inserts the new record into the database -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=2 adds the new user to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USER NOT ADDED - there is already a user in the system with this user number\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
USER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
user id must be between 2 and 8 characters long\n"; - echo "
full name and password must be at least 2 characters long\n"; - } - else - { - echo "
USER ADDED: $user\n"; - - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); - } - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new campaign to the system -###################### - -if ($ADD==21) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) ) - { - echo "
CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n"; - echo "
campaign ID must be between 2 and 8 characters in length\n"; - echo "
campaign name must be between 6 and 40 characters in length\n"; - } - else - { - echo "
CAMPAIGN ADDED: $campaign_id\n"; - - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch) values('$campaign_id','$campaign_name','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - } - } -$ADD=31; -} - -###################### -# ADD=22 adds the new campaign status to the system -###################### - -if ($ADD==22) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a campaign-status in the system with this name\n";} - else - { - $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a global-status in the system with this name\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 8 characters in length\n"; - echo "
status name must be between 2 and 30 characters in length\n"; - } - else - { - echo "
CAMPAIGN STATUS ADDED: $campaign_id - $status\n"; - - $stmt="INSERT INTO vicidial_campaign_statuses values('$status','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN STATUS |$PHP_AUTH_USER|$ip|'$status','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } - } -$ADD=31; -} - - -###################### -# ADD=23 adds the new campaign hotkey to the system -###################### - -if ($ADD==23) -{ - $HKstatus_data = explode('-----',$HKstatus); - $status = $HKstatus_data[0]; - $status_name = $HKstatus_data[1]; - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN HOTKEY NOT ADDED - there is already a campaign-hotkey in the system with this hotkey\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
CAMPAIGN HOTKEY NOT ADDED - Please go back and look at the data you entered\n"; - echo "
hotkey must be a single character between 1 and 9 \n"; - echo "
status must be between 1 and 8 characters in length\n"; - } - else - { - echo "
CAMPAIGN HOTKEY ADDED: $campaign_id - $status - $hotkey\n"; - - $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN HOTKEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=25 adds the new campaign lead recycle entry to the system -###################### - -if ($ADD==25) -{ - $status = eregi_replace("-----.*",'',$status); - echo ""; - $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD RECYCLE ADDED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new list to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
LIST NOT ADDED - there is already a list in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or (strlen($list_id) < 2) or (strlen($list_id) > 8) ) - { - echo "
LIST NOT ADDED - Please go back and look at the data you entered\n"; - echo "
List ID must be between 2 and 8 characters in length\n"; - echo "
List name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST ADDED: $list_id\n"; - - $stmt="INSERT INTO vicidial_lists values('$list_id','$list_name','$campaign_id','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|'$list_id','$list_name','$campaign_id','$active'|\n"); - fclose($fp); - } - } - } -$ADD=311; -} - - - -###################### -# ADD=2111 adds the new inbound group to the system -###################### - -if ($ADD==2111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
GROUP NOT ADDED - there is already a group in the system with this ID\n";} - else - { - if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) ) - { - echo "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; - echo "
Group name and group color must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - echo "
GROUP ADDED: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000; -} - - -###################### -# ADD=21111 adds new remote agents to the system -###################### - -if ($ADD==21111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
REMOTE AGENTS NOT ADDED - there is already a remote agents entry starting with this userID\n";} - else - { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
User ID start and external extension must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTE AGENTS ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } - } - } -$ADD=10000; -} - -###################### -# ADD=211111 adds new user group to the system -###################### - -if ($ADD==211111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USER GROUP NOT ADDED - there is already a user group entry with this name\n";} - else - { - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_user_groups values('$user_group','$group_name');"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW USER GROUP ENTRY |$PHP_AUTH_USER|$ip|'$user_group','$group_name'|\n"); - fclose($fp); - } - } - } -$ADD=100000; -} - -###################### -# ADD=2111111 adds new script to the system -###################### - -if ($ADD==2111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SCRIPT NOT ADDED - there is already a script entry with this name\n";} - else - { - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
SCRIPT NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Script name, description and text must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; - $rslt=mysql_query($stmt, $link); - - echo "
SCRIPT ADDED: $script_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000000; -} - - -###################### -# ADD=21111111 adds new filter to the system -###################### - -if ($ADD==21111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
FILTER NOT ADDED - there is already a filter entry with this ID\n";} - else - { - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Filter ID, name and SQL must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='$lead_filter_sql';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER ADDED: $lead_filter_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=10000000; -} - - -###################### -# ADD=211111111 adds new call time definition to the system -###################### - -if ($ADD==211111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Call Time ID and name must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments';"; - $rslt=mysql_query($stmt, $link); - - echo "
CALL TIME ADDED: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - } -$ADD=311111111; -} - - -###################### -# ADD=2111111111 adds new state call time definition to the system -###################### - -if ($ADD==2111111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
STATE CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
STATE CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; - echo "
State Call Time ID, name and state must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_state_call_times SET state_call_time_id='$call_time_id',state_call_time_name='$call_time_name',state_call_time_comments='$call_time_comments',state_call_time_state='$state_call_time_state';"; - $rslt=mysql_query($stmt, $link); - - echo "
STATE CALL TIME ADDED: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=3111111111; -} - - - - -###################################################################################################### -###################################################################################################### -####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below -###################################################################################################### -###################################################################################################### - - - -###################### -# ADD=4A submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4A") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - -###################### -# ADD=4B submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4B") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - - -###################### -# ADD=4 submit user modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - -###################### -# ADD=41 submit campaign modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=42 delete campaign status in the system -###################### - -if ($ADD==42) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - } - else - { - echo "
CUSTOM CAMPAIGN STATUS DELETED: $campaign_id - $status\n"; - - $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=43 delete campaign hotkey in the system -###################### - -if ($ADD==43) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
CAMPAIGN HOTKEY NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - echo "
the campaign hotkey needs to be at least 1 characters in length\n"; - } - else - { - echo "
CUSTOM CAMPAIGN HOTKEY DELETED: $campaign_id - $status - $hotkey\n"; - - $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=44 submit campaign modifications to the system - Basic View -###################### - -if ($ADD==44) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=34; # go to campaign modification form below -} - -###################### -# ADD=45 modify campaign lead recycle in the system -###################### - -if ($ADD==45) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=411 submit list modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) - { - echo "
LIST NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
list name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST MODIFIED: $list_id\n"; - - $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') - { - echo "
RESETTING LIST-CALLED-STATUS\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } - } - if ($campaign_id != "$old_campaign_id") - { - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id'|\n"); - fclose($fp); - } - } - -$ADD=311; # go to list modification form below -} - - -###################### -# ADD=4111 modify in-group info in the system -###################### - -if ($ADD==4111) -{ - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) - { - echo "
GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
group name and group color must be at least 2 characters in length\n"; - } - else - { - echo "
GROUP MODIFIED: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_message='$drop_message',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111; # go to in-group modification form below -} - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
User ID Start and External Extension must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTE AGENTS MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - } - -$ADD=31111; # go to remote agents modification form below -} - - - -###################### -# ADD=411111 modify user group info in the system -###################### - -if ($ADD==411111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group'|\n"); - fclose($fp); - } - } - -$ADD=311111; # go to user group modification form below -} - -###################### -# ADD=4111111 modify script in the system -###################### - -if ($ADD==4111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
SCRIPT NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Script name, description and text must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
SCRIPT MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111; # go to script modification form below -} - - -###################### -# ADD=41111111 modify filter in the system -###################### - -if ($ADD==41111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Filter ID, name and SQL must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='$lead_filter_sql' where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31111111; # go to filter modification form below -} - - -###################### -# ADD=411111111 modify call time in the system -###################### - -if ($ADD==411111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Call Time ID and name must be at least 2 characters in length\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
CALL TIME MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - -$ADD=311111111; # go to call time modification form below -} - - -###################### -# ADD=4111111111 modify state call time in the system -###################### - -if ($ADD==4111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
STATE CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
State Call Time ID, name and state must be at least 2 characters in length\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
STATE CALL TIME MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111111; # go to state call time modification form below -} - - - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of user -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) - { - echo "
USER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - echo "
USER DELETION CONFIRMATION: $user\n"; - echo "

Click here to delete user $user


\n"; - } - -$ADD='3'; # go to user modification below -} - -###################### -# ADD=51 confirmation before deletion of campaign -###################### - -if ($ADD==51) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) ) - { - echo "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
CAMPAIGN DELETION CONFIRMATION: $campaign_id\n"; - echo "

Click here to delete campaign $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=52 confirmation before logging all agents out of campaign of campaign -###################### - -if ($ADD==52) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
AGENT LOGOUT CONFIRMATION: $campaign_id\n"; - echo "

Click here to log all agents out of $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=511 confirmation before deletion of list -###################### - -if ($ADD==511) -{ - echo ""; - - if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) ) - { - echo "
LIST NOT DELETED - Please go back and look at the data you entered\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - echo "
LIST DELETION CONFIRMATION: $list_id\n"; - echo "

Click here to delete list and all of its leads $list_id


\n"; - } - -$ADD='311'; # go to campaign modification below -} - -###################### -# ADD=5111 confirmation before deletion of in-group -###################### - -if ($ADD==5111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) ) - { - echo "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - echo "
IN-GROUP DELETION CONFIRMATION: $group_id\n"; - echo "

Click here to delete in-group $group_id


\n"; - } - -$ADD='3111'; # go to in-group modification below -} - -###################### -# ADD=51111 confirmation before deletion of remote agent record -###################### - -if ($ADD==51111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) ) - { - echo "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - echo "
REMOTE AGENT DELETION CONFIRMATION: $remote_agent_id\n"; - echo "

Click here to delete remote agent $remote_agent_id


\n"; - } - -$ADD='31111'; # go to remote agent modification below -} - -###################### -# ADD=511111 confirmation before deletion of user group record -###################### - -if ($ADD==511111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) - { - echo "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - echo "
USER GROUP DELETION CONFIRMATION: $user_group\n"; - echo "

Click here to delete user group $user_group


\n"; - } - -$ADD='311111'; # go to user group modification below -} - -###################### -# ADD=5111111 confirmation before deletion of script record -###################### - -if ($ADD==5111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) ) - { - echo "
SCRIPT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Script_id must be at least 2 characters in length\n"; - } - else - { - echo "
SCRIPT DELETION CONFIRMATION: $script_id\n"; - echo "

Click here to delete script $script_id


\n"; - } - -$ADD='3111111'; # go to script modification below -} - -###################### -# ADD=51111111 confirmation before deletion of filter record -###################### - -if ($ADD==51111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) ) - { - echo "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Filter ID must be at least 2 characters in length\n"; - } - else - { - echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; - echo "

Click here to delete filter $lead_filter_id


\n"; - } - -$ADD='31111111'; # go to filter modification below -} - -###################### -# ADD=511111111 confirmation before deletion of call time record -###################### - -if ($ADD==511111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - echo "
CALL TIME DELETION CONFIRMATION: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; - } - -$ADD='311111111'; # go to call time modification below -} - -###################### -# ADD=5111111111 confirmation before deletion of call time record -###################### - -if ($ADD==5111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - echo "
STATE CALL TIME DELETION CONFIRMATION: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; - } - -$ADD='3111111111'; # go to state call time modification below -} - - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete user record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) - { - echo "
USER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|user='$user'|\n"); - fclose($fp); - } - echo "
USER DELETION COMPLETED: $user\n"; - echo "

\n"; - } - -$ADD='0'; # go to user list -} - -###################### -# ADD=61 delete campaign record -###################### - -if ($ADD==61) -{ - echo ""; - - if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) - { - echo "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
CAMPAIGN DELETION COMPLETED: $campaign_id\n"; - echo "

\n"; - } - -$ADD='10'; # go to campaigns list -} - -###################### -# ADD=62 Logout all agents fro a campaign -###################### - -if ($ADD==62) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!AGENT LOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
AGENT LOGOUT COMPLETED: $campaign_id\n"; - echo "

\n"; - } - -$ADD='31'; # go to campaign modification below -} - - -###################### -# ADD=65 delete campaign lead recycle in the system -###################### - -if ($ADD==65) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD RECYCLE DELETED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=611 delete list record and all leads within it -###################### - -if ($ADD==611) -{ - echo ""; - - if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) - { - echo "
LIST NOT DELETED - Please go back and look at the data you entered\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST LEADS FROM VICIDIAL_LIST TABLE\n"; - $stmt="DELETE from vicidial_list where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } - echo "
LIST DELETION COMPLETED: $list_id\n"; - echo "

\n"; - } - -$ADD='100'; # go to lists list -} - -###################### -# ADD=6111 delete in-group record -###################### - -if ($ADD==6111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) - { - echo "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } - echo "
IN-GROUP DELETION COMPLETED: $group_id\n"; - echo "

\n"; - } - -$ADD='1000'; # go to in-group list -} - -###################### -# ADD=61111 delete remote agent record -###################### - -if ($ADD==61111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) - { - echo "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - echo "
REMOTE AGENT DELETION COMPLETED: $remote_agent_id\n"; - echo "

\n"; - } - -$ADD='10000'; # go to remote agents list -} - -###################### -# ADD=611111 delete user group record -###################### - -if ($ADD==611111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) - { - echo "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } - echo "
USER GROUP DELETION COMPLETED: $user_group\n"; - echo "

\n"; - } - -$ADD='100000'; # go to user group list -} - -###################### -# ADD=6111111 delete script record -###################### - -if ($ADD==6111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) - { - echo "
SCRIPT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Script_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } - echo "
SCRIPT DELETION COMPLETED: $script_id\n"; - echo "

\n"; - } - -$ADD='1000000'; # go to script list -} - - -###################### -# ADD=61111111 delete filter record -###################### - -if ($ADD==61111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) - { - echo "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Filter ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } - echo "
FILTER DELETION COMPLETED: $lead_filter_id\n"; - echo "

\n"; - } - -$ADD='10000000'; # go to filter list -} - - -###################### -# ADD=611111111 delete call times record -###################### - -if ($ADD==611111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
CALL TIME DELETION COMPLETED: $call_time_id\n"; - echo "

\n"; - } - -$ADD='100000000'; # go to call times list -} - - -###################### -# ADD=6111111111 delete call times record -###################### - -if ($ADD==6111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; - $rslt=mysql_query($stmt, $link); - $sct_to_print = mysql_num_rows($rslt); - $sct_list=''; - - $o=0; - while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_ids[$o] = "$rowx[0]"; - $sct_states[$o] = "$rowx[1]"; - $o++; - } - $o=0; - - while ($sct_to_print > $o) { - $sct_states[$o] = eregi_replace("\|$call_time_id\|",'|',$sct_states[$o]); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$sct_states[$o]' where call_time_id='$sct_ids[$o]';"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - echo "State Rule Removed: $sct_ids[$o]
\n"; - $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
STATE CALL TIME DELETION COMPLETED: $call_time_id\n"; - echo "

\n"; - } - -$ADD='1000000000'; # go to call times list -} - - - - - - -###################################################################################################### -###################################################################################################### -####### 3 series, record modification forms -###################################################################################################### -###################################################################################################### - - - - -###################### -# ADD=3 modify user info in the system -###################### - -if ($ADD==3) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_level = $row[4]; - $user_group = $row[5]; - $phone_login = $row[6]; - $phone_pass = $row[7]; - $delete_users = $row[8]; - $delete_user_groups = $row[9]; - $delete_lists = $row[10]; - $delete_campaigns = $row[11]; - $delete_ingroups = $row[12]; - $delete_remote_agents = $row[13]; - $load_leads = $row[14]; - $campaign_detail = $row[15]; - $ast_admin_access = $row[16]; - $ast_delete_phones = $row[17]; - $delete_scripts = $row[18]; - $modify_leads = $row[19]; - $hotkeys_active = $row[20]; - $change_agent_campaign =$row[21]; - $agent_choose_ingroups =$row[22]; - $scheduled_callbacks = $row[24]; - $agentonly_callbacks = $row[25]; - $agentcall_manual = $row[26]; - $vicidial_recording = $row[27]; - $vicidial_transfers = $row[28]; - $delete_filters = $row[29]; - $alter_agent_interface_options =$row[30]; - $closer_default_blended = $row[31]; - $delete_call_times = $row[32]; - $modify_call_times = $row[33]; - -if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) - { - echo "
You do not have permissions to modify this user: $row[1]\n"; - } -else - { - echo "
MODIFY A USERS RECORD: $row[1]\n"; - if ($LOGuser_level > 8) - {echo "\n";} - else - { - if ($LOGalter_agent_interface == "1") - {echo "\n";} - else - {echo "\n";} - } - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - if ($LOGuser_level > 8) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
User Number: $row[1]$NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group: $NWB#vicidial_users-user_group$NWE
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
AGENT INTERFACE OPTIONS:
Agent Choose Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
HotKeys Active: $NWB#vicidial_users-hotkeys_active$NWE
Scheduled Callbacks: $NWB#vicidial_users-scheduled_callbacks$NWE
Agent-Only Callbacks: $NWB#vicidial_users-agentonly_callbacks$NWE
Agent Call Manual: $NWB#vicidial_users-agentcall_manual$NWE
Vicidial Recording: $NWB#vicidial_users-vicidial_recording$NWE
Vicidial Transfers: $NWB#vicidial_users-vicidial_transfers$NWE
Closer Default Blended: $NWB#vicidial_users-closer_default_blended$NWE
Inbound Groups: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_users-closer_campaigns$NWE
ADMIN INTERFACE OPTIONS:
Alter Agent Interface Options: $NWB#vicidial_users-alter_agent_interface_options$NWE
Delete Users: $NWB#vicidial_users-delete_users$NWE
Delete User Groups: $NWB#vicidial_users-delete_user_groups$NWE
Delete Lists: $NWB#vicidial_users-delete_lists$NWE
Delete Campaigns: $NWB#vicidial_users-delete_campaigns$NWE
Delete In-Groups: $NWB#vicidial_users-delete_ingroups$NWE
Delete Remote Agents: $NWB#vicidial_users-delete_remote_agents$NWE
Delete Scripts: $NWB#vicidial_users-delete_scripts$NWE
Load Leads: $NWB#vicidial_users-load_leads$NWE
Campaign Detail: $NWB#vicidial_users-campaign_detail$NWE
AGC Admin Access: $NWB#vicidial_users-ast_admin_access$NWE
AGC Delete Phones: $NWB#vicidial_users-ast_delete_phones$NWE
Modify Leads: $NWB#vicidial_users-modify_leads$NWE
Change Agent Campaign: $NWB#vicidial_users-change_agent_campaign$NWE
Delete Filters: $NWB#vicidial_users-delete_filters$NWE
Delete Call Times: $NWB#vicidial_users-delete_call_times$NWE
Modify Call Times: $NWB#vicidial_users-modify_call_times$NWE
\n"; - - if ($LOGdelete_users > 0) - { - echo "

DELETE THIS USER\n"; - } - echo "

Click here for user time sheet\n"; - echo "

Click here for user status\n"; - echo "

Click here for user stats\n"; - echo "

Click here for user CallBack Holds\n"; - } - -} - - -###################### -# ADD=31 modify campaign info in the system - Detail view -###################### - -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed - -if ($ADD==31) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $campaign_rec_exten = $row[22]; - $campaign_recording = $row[23]; - $campaign_rec_filename = $row[24]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $am_message_exten = $row[27]; - $amd_send_to_vmx = $row[28]; - $xferconf_a_dtmf = $row[29]; - $xferconf_a_number = $row[30]; - $xferconf_b_dtmf = $row[31]; - $xferconf_b_number = $row[32]; - $alt_number_dialing = $row[33]; - $scheduled_callbacks = $row[34]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; - $safe_harbor_exten = $row[38]; - $display_dialable_count = $row[39]; - $wrapup_seconds = $row[40]; - $wrapup_message = $row[41]; -# $closer_campaigns = $row[42]; - $use_internal_dnc = $row[43]; - -echo "
MODIFY A CAMPAIGNS RECORD: $row[0] - Basic View"; -echo " | Detail View | "; -echo "Realtime Screen\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -if (eregi("CLOSER", $campaign_id)) - { - echo "\n"; - } - - - -echo "\n"; -echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Dial status 1: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE
List Order: $NWB#vicidial_campaigns-lead_order$NWE
Lead Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Dial Timeout: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Dial Prefix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Campaign CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Campaign VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Campaign Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Campaign Recording: $NWB#vicidial_campaigns-campaign_recording$NWE
Campaign Rec Filename: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
Answering Machine Message: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD Send to VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Alt Number Dialing: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Scheduled Callbacks: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Drop Call Seconds: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Use Safe Harbor Message: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Safe Harbor Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Wrapup Seconds: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Wrapup Message: $NWB#vicidial_campaigns-wrapup_message$NWE
Use Internal DNC List: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Allowed Inbound Groups:
"; - echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; - echo "$groups_list"; - echo "
\n"; - -echo "
\n"; -echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\n"; - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - HIDE

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - SHOW

"; - } - - - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "This campaign has $hopper_leads leads in the dial hopper

\n"; -echo "Click here to see what leads are in the hopper right now

\n"; -echo "Click here to see all CallBack Holds in this campaign

\n"; -echo "
\n"; - - - - -echo "
\n"; -echo "
CUSTOM STATUSES WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_statuses$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
STATUSDESCRIPTIONSELECTABLEDELETE
$rowx[0]$rowx[1]$rowx[2]DELETE
\n"; - -echo "
ADD NEW CUSTOM CAMPAIGN STATUS
\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Description:   \n"; -echo "Selectable:   \n"; -echo "
\n"; - -echo "

\n"; - - - -echo "
CUSTOM HOTKEYS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
HOTKEYSTATUSDESCRIPTIONDELETE
$rowx[1]$rowx[0]$rowx[2]DELETE
\n"; - -echo "
ADD NEW CUSTOM CAMPAIGN HOTKEY
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Hotkey:   \n"; -echo "Status:   \n"; -echo "
\n"; -echo "

\n"; - - - -echo "

LEAD RECYCLING WITHIN THIS CAMPAIGN:   $NWB#vicidial_lead_recycle$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $recycle_to_print = mysql_num_rows($rslt); - $o=0; - while ($recycle_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - -echo "
STATUSATTEMPT DELAYATTEMPT MAXIMUMACTIVE DELETE
$rowx[2]
\n"; - echo "\n"; - echo "\n"; - echo "
DELETE
\n"; - -echo "
ADD NEW CAMPAIGN LEAD RECYCLE
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Attempt Delay: \n"; -echo "Attempt Maximum: \n"; -echo "
\n"; - -echo "

\n"; - -echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; - -if ($LOGdelete_campaigns > 0) - { - echo "

DELETE THIS CAMPAIGN\n"; - } - -} - - -###################### -# ADD=34 modify campaign info in the system - Basic View -###################### - -if ($ADD==34) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $display_dialable_count = $row[39]; - -echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Basic View | "; -echo "Detail View | "; -echo "Realtime Screen\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; -echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Web Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Dial status 1: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE
List Order: $NWB#vicidial_campaigns-lead_order$NWE
Lead Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Script: $script_id
Get Call Launch: $get_call_launch
\n"; - -echo "
\n"; -echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\n"; - - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - HIDE

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - SHOW

"; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "This campaign has $hopper_leads leads in the dial hopper

\n"; -echo "Click here to see what leads are in the hopper right now

\n"; -echo "Click here to see all CallBack Holds in this campaign

\n"; -echo "
\n"; - -echo "
\n"; - -echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; - - -if ($LOGdelete_campaigns > 0) - { - echo "

DELETE THIS CAMPAIGN\n"; - } - - -} - - -###################### -# ADD=311 modify list info in the system -###################### - -if ($ADD==311) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $Cstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($Cstatuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - # end grab status names - - -echo "
MODIFY A LISTS RECORD: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List ID: $row[0]$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
Reset Lead-Called-Status for this list: $NWB#vicidial_lists-reset_list$NWE
\n"; - -echo "
\n"; -echo "
STATUSES WITHIN THIS LIST:
\n"; -echo "\n"; -echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $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($rslt); - - $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]] = ($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; - if ($lead_list['count'] > 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 ($dispo == 'CBHOLD') - { - $CLB=""; - $CLE=""; - } - else - { - $CLB=''; - $CLE=''; - } - - echo "\n"; - $o++; - } - } - -echo "\n"; -echo "\n"; - -echo "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; -unset($lead_list); - - - - - -echo "
\n"; -echo "
TIME ZONES WITHIN THIS LIST:
\n"; -echo "\n"; -echo "\n"; - - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - $plus='+'; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $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]] = ($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++; - } - - if ($lead_list['count'] > 0) - { - while (list($tzone,) = each($lead_list[$since_reset])) - { - $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - - if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} - else {$DISPtzone = "$tzone";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - } - } - -echo "\n"; -echo "\n"; - -echo "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; -unset($lead_list); - - - - - - - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; - $rslt=mysql_query($stmt, $link); - $status_called_to_print = mysql_num_rows($rslt); - - $o=0; - $sts=0; - $first_row=1; - $all_called_first=1000; - $all_called_last=0; - while ($status_called_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $leads_in_list = ($leads_in_list + $rowx[2]); - $count_statuses[$o] = "$rowx[0]"; - $count_called[$o] = "$rowx[1]"; - $count_count[$o] = "$rowx[2]"; - $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); - - if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) - { - if ($first_row) {$first_row=0;} - else {$sts++;} - $status[$sts] = "$rowx[0]"; - $status_called_first[$sts] = "$rowx[1]"; - if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} - } - $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); - $status_called_last[$sts] = "$rowx[1]"; - if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} - - $o++; - } - - - - -echo "
\n"; -echo "
CALLED COUNTS WITHIN THIS LIST:
\n"; -echo "\n"; -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - - $sts=0; - $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 ""; - - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $sts)) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - else - { - if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - - $called_printed=0; - $o=0; - while ($status_called_to_print > $o) - { - if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) - { - $called_printed++; - echo ""; - } - - - $o++; - } - if (!$called_printed) - {echo "";} - $first++; - } - echo "\n\n"; - - $sts++; - } - -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - -echo "
STATUSSTATUS NAME$firstSUBTOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; - - - - - -echo "
\n"; - -if ($LOGdelete_lists > 0) - { - echo "

DELETE THIS LIST\n"; - } - -} - - - -###################### -# ADD=3111 modify in-group info in the system -###################### - -if ($ADD==3111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $group_name = $row[1]; - $group_color = $row[2]; - $active = $row[3]; - $web_form_address = $row[4]; - $voicemail_ext = $row[5]; - $next_agent_call = $row[6]; - $fronter_display = $row[7]; - $script_id = $row[8]; - $get_call_launch = $row[9]; - $xferconf_a_dtmf = $row[10]; - $xferconf_a_number = $row[11]; - $xferconf_b_dtmf = $row[12]; - $xferconf_b_number = $row[13]; - $drop_call_seconds = $row[14]; - $drop_message = $row[15]; - $drop_exten = $row[16]; - -echo "
MODIFY A GROUPS RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -echo "\n"; -echo "
Group ID: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Drop Call Seconds: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Use Drop Message: $NWB#vicidial_inbound_groups-drop_message$NWE
Drop Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
\n"; - -echo "

\n"; - -echo "
\n"; - -if ($LOGdelete_ingroups > 0) - { - echo "

DELETE THIS IN-GROUP\n"; - } - -} - - - -###################### -# ADD=31111 modify remote agents info in the system -###################### - -if ($ADD==31111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dialplan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - - -if ($LOGdelete_remote_agents > 0) - { - echo "

DELETE THIS REMOTE AGENT\n"; - } - -} - - -###################### -# ADD=311111 modify user group info in the system -###################### - -if ($ADD==311111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; -echo ""; - -echo "
MODIFY A USERS GROUP ENTRY\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -if ($LOGdelete_user_groups > 0) - { - echo "

DELETE THIS USER GROUP\n"; - } - -} - - -###################### -# ADD=3111111 modify script info in the system -###################### - -if ($ADD==3111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $script_name = $row[1]; - $script_comments = $row[2]; - $script_text = $row[3]; - $active = $row[4]; -echo ""; - -echo "
MODIFY A SCRIPT\n"; -echo "\n"; -echo "\n"; -echo "
Script ID: $script_id$NWB#vicidial_scripts-script_name$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text:

Preview Script
$NWB#vicidial_scripts-script_text$NWE
\n"; - -if ($LOGdelete_scripts > 0) - { - echo "

DELETE THIS SCRIPT\n"; - } - -} - - -###################### -# ADD=31111111 modify filter info in the system -###################### - -if ($ADD==31111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $lead_filter_name = $row[1]; - $lead_filter_comments = $row[2]; - $lead_filter_sql = $row[3]; -echo ""; - -echo "
MODIFY A FILTER\n"; -echo "\n"; -echo "\n"; -echo "
Filter ID: $lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - -echo "

"; -echo "
TEST ON CAMPAIGN:
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -if ($LOGdelete_filters > 0) - { - echo "

DELETE THIS FILTER\n"; - } - -} - - -###################### -# ADD=321111111 modify call time definition info in the system -###################### - -if ($ADD==321111111) -{ -if ($LOGmodify_call_times==1) -{ - -if ( ($stage=="ADD") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - if (eregi("\|$",$ct_state_call_times)) - {$ct_state_call_times = "$ct_state_call_times$state_rule\|";} - else - {$ct_state_call_times = "$ct_state_call_times\|$state_rule\|";} - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "State Rule Added: $state_rule
\n"; - } -if ( ($stage=="REMOVE") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - $ct_state_call_times = eregi_replace("\|$state_rule\|",'|',$ct_state_call_times); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "State Rule Removed: $state_rule
\n"; - } - -$ADD=311111111; -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# ADD=311111111 modify call time definition info in the system -###################### - -if ($ADD==311111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -$ct_srs=1; -$b=0; -$srs_SQL =''; -if (strlen($ct_state_call_times)>2) - { - $state_rules = explode('|',$ct_state_call_times); - $ct_srs = ((count($state_rules)) - 1); - } -echo "\n"; -echo "\n"; -while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>0) - { - $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - echo "\n"; - $srs_SQL .= "'$state_rules[$b]',"; - $srs_state_SQL .= "'$row[0]',"; - } - $b++; - } -if (strlen($srs_SQL)>2) - { - $srs_SQL = "$srs_SQL''"; - $srs_state_SQL = "$srs_state_SQL''"; - $srs_SQL = "where state_call_time_id NOT IN($srs_SQL) and state_call_time_state NOT IN($srs_state_SQL)"; - } -else - {$srs_SQL='';} -$stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;"; -$rslt=mysql_query($stmt, $link); -$sct_to_print = mysql_num_rows($rslt); -$sct_list=''; - -$o=0; -while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_list .= "\n"; - $o++; -} -echo "\n"; -echo "\n"; - -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $call_time_name = $row[1]; - $call_time_comments = $row[2]; - $ct_default_start = $row[3]; - $ct_default_stop = $row[4]; - $ct_sunday_start = $row[5]; - $ct_sunday_stop = $row[6]; - $ct_monday_start = $row[7]; - $ct_monday_stop = $row[8]; - $ct_tuesday_start = $row[9]; - $ct_tuesday_stop = $row[10]; - $ct_wednesday_start = $row[11]; - $ct_wednesday_stop = $row[12]; - $ct_thursday_start = $row[13]; - $ct_thursday_stop = $row[14]; - $ct_friday_start = $row[15]; - $ct_friday_stop = $row[16]; - $ct_saturday_start = $row[17]; - $ct_saturday_stop = $row[18]; - $ct_state_call_times = $row[19]; - -echo ""; - -echo "
MODIFY A CALL TIME\n"; -echo "\n"; -echo "\n"; -echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Active State Call Time Definitions for this Record:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Add state call time rule:


\n"; -echo "CAMPAIGNS USING THIS CALL TIME:
\n"; -echo "\n"; - - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - $CT_camp_id = $row[1]; - $CT_camp_name = $row[2]; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

DELETE THIS CALL TIME DEFINITION\n"; - } -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# ADD=3111111111 modify state call time definition info in the system -###################### - -if ($ADD==3111111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $state_call_time_state =$row[1]; - $call_time_name = $row[2]; - $call_time_comments = $row[3]; - $ct_default_start = $row[4]; - $ct_default_stop = $row[5]; - $ct_sunday_start = $row[6]; - $ct_sunday_stop = $row[7]; - $ct_monday_start = $row[8]; - $ct_monday_stop = $row[9]; - $ct_tuesday_start = $row[10]; - $ct_tuesday_stop = $row[11]; - $ct_wednesday_start = $row[12]; - $ct_wednesday_stop = $row[13]; - $ct_thursday_start = $row[14]; - $ct_thursday_stop = $row[15]; - $ct_friday_start = $row[16]; - $ct_friday_stop = $row[17]; - $ct_saturday_start = $row[18]; - $ct_saturday_stop = $row[19]; - -echo ""; - -echo "
MODIFY A STATE CALL TIME
\n"; -echo "\n"; -echo "\n"; -echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; -echo "CALL TIMES USING THIS STATE CALL TIME:
\n"; -echo "\n"; - - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

DELETE THIS STATE CALL TIME DEFINITION\n"; - } - -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo "
\n"; -echo ""; - -echo "
SEARCH FOR A USER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
User Number:
Full Name:
User Level:
User Group:
\n"; - -} - -###################### -# ADD=66 user search results -###################### - -if ($ADD==66) -{ -echo "
\n"; - echo ""; - - $SQL = ''; - if ($user) {$SQL .= " user LIKE \"%$user%\" and";} - if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";} - if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";} - if ($user_group) {$SQL .= " user_group = '$user_group' and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SEARCH RESULTS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS | STATUS | TIME
\n"; - -} - - -###################################################################################################### -###################################################################################################### -####### 8 series, Callback lists -###################################################################################################### -###################################################################################################### - -###################### -# ADD=8 find all callbacks on hold by a User -###################### -if ($ADD==8) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user='$user' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
USER CALLBACK HOLD LISTINGS: $user\n"; -$ADD='82'; -} - -###################### -# ADD=81 find all callbacks on hold within a Campaign -###################### -if ($ADD==81) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and campaign_id='$campaign_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN CALLBACK HOLD LISTINGS: $campaign_id\n"; -$ADD='82'; -} - -###################### -# ADD=811 find all callbacks on hold within a List -###################### -if ($ADD==811) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and list_id='$list_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; -$ADD='82'; -} - -###################### -# ADD=82 display all callbacks on hold -###################### -if ($ADD==82) -{ -echo "
\n"; -echo "
\n"; -echo "\n"; - - $o=0; - while ($cb_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
LEADLISTCAMPAIGNENTRY DATECALLBACK DATEUSERRECIPIENTSTATUS
$row[1]$row[2]$row[3]$row[5]$row[6]$row[8]$row[9]$row[4]
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 0 series, displays and searches -###################################################################################################### -###################################################################################################### - -###################### -# ADD=0 display all active users -###################### -if ($ADD==0) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users order by full_name"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS | STATUS | TIME
\n"; -} - -###################### -# ADD=10 display all campaigns -###################### -if ($ADD==10) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  MODIFY
\n"; -} - - -###################### -# ADD=100 display all lists -###################### -if ($ADD==100) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists order by list_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
LIST LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]  MODIFY
\n"; -} - - - -###################### -# ADD=1000 display all inbound groups -###################### -if ($ADD==1000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
INBOUND GROUP LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[5]  MODIFY
\n"; -} - - -###################### -# ADD=10000 display all remote agents -###################### -if ($ADD==10000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
REMOTE AGENTS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFY
\n"; -} - - -###################### -# ADD=100000 display all user groups -###################### -if ($ADD==100000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER GROUPS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=1000000 display all scripts -###################### -if ($ADD==1000000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SCRIPTS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=10000000 display all filters -###################### -if ($ADD==10000000) -{ -echo "\n";echo "\n";?> -
-
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
LEAD FILTER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=100000000 display all call times -###################### -if ($ADD==100000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
CALL TIME LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[4] MODIFY
\n"; -} - -###################### -# ADD=1000000000 display all state call times -###################### -if ($ADD==1000000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
STATE CALL TIME LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFY
\n"; -} - - - - - -echo "
\n"; - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; -echo "             VERSION: $version"; -echo "             BUILD: $build
\n"; - - -?> - - -
- - - -1) - { - $g=0; - $p='13'; - $GMT_gmt[0] = ''; - $GMT_hour[0] = ''; - $GMT_day[0] = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $pmin=(gmdate("i", time() + $pzone)); - $phour=( (gmdate("G", time() + $pzone)) * 100); - $pday=gmdate("w", time() + $pzone); - $tz = sprintf("%.2f", $p); - $GMT_gmt[$g] = "$tz"; - $GMT_day[$g] = "$pday"; - $GMT_hour[$g] = ($phour + $pmin); - $p = ($p - 0.25); - $g++; - } - - $stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $Gct_default_start = "$rowx[3]"; - $Gct_default_stop = "$rowx[4]"; - $Gct_sunday_start = "$rowx[5]"; - $Gct_sunday_stop = "$rowx[6]"; - $Gct_monday_start = "$rowx[7]"; - $Gct_monday_stop = "$rowx[8]"; - $Gct_tuesday_start = "$rowx[9]"; - $Gct_tuesday_stop = "$rowx[10]"; - $Gct_wednesday_start = "$rowx[11]"; - $Gct_wednesday_stop = "$rowx[12]"; - $Gct_thursday_start = "$rowx[13]"; - $Gct_thursday_stop = "$rowx[14]"; - $Gct_friday_start = "$rowx[15]"; - $Gct_friday_stop = "$rowx[16]"; - $Gct_saturday_start = "$rowx[17]"; - $Gct_saturday_stop = "$rowx[18]"; - $Gct_state_call_times = "$rowx[19]"; - - $ct_states = ''; - $ct_state_gmt_SQL = ''; - $ct_srs=0; - $b=0; - if (strlen($Gct_state_call_times)>2) - { - $state_rules = explode('|',$Gct_state_call_times); - $ct_srs = ((count($state_rules)) - 2); - } - while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>1) - { - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Gstate_call_time_id = "$row[0]"; - $Gstate_call_time_state = "$row[1]"; - $Gsct_default_start = "$row[4]"; - $Gsct_default_stop = "$row[5]"; - $Gsct_sunday_start = "$row[6]"; - $Gsct_sunday_stop = "$row[7]"; - $Gsct_monday_start = "$row[8]"; - $Gsct_monday_stop = "$row[9]"; - $Gsct_tuesday_start = "$row[10]"; - $Gsct_tuesday_stop = "$row[11]"; - $Gsct_wednesday_start = "$row[12]"; - $Gsct_wednesday_stop = "$row[13]"; - $Gsct_thursday_start = "$row[14]"; - $Gsct_thursday_stop = "$row[15]"; - $Gsct_friday_start = "$row[16]"; - $Gsct_friday_stop = "$row[17]"; - $Gsct_saturday_start = "$row[18]"; - $Gsct_saturday_stop = "$row[19]"; - - $ct_states .="'$Gstate_call_time_state',"; - - $r=0; - $state_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday local time - { - if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday local time - { - if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday local time - { - if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday local time - { - if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday local time - { - if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday local time - { - if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday local time - { - if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - $state_gmt = "$state_gmt'99'"; - $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; - } - - $b++; - } - if (strlen($ct_states)>2) - { - $ct_states = eregi_replace(",$",'',$ct_states); - $ct_statesSQL = "and state NOT IN($ct_states)"; - } - else - { - $ct_statesSQL = ""; - } - - $r=0; - $default_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday local time - { - if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday local time - { - if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday local time - { - if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday local time - { - if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday local time - { - if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday local time - { - if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday local time - { - if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - - $default_gmt = "$default_gmt'99'"; - $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; - - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL"; - #$DB=1; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rslt_rows = mysql_num_rows($rslt); - if ($rslt_rows) - { - $rowx=mysql_fetch_row($rslt); - $active_leads = "$rowx[0]"; - } - else {$active_leads = '0';} - - echo "This campaign has $active_leads leads to be dialed in those lists\n"; - } - else - { - echo "no active lists selected for this campaign\n"; - } - } -else - { - echo "no active lists selected for this campaign\n"; - } -##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### -} -?> diff --git a/LANG_admin/vicidial_en/admin_changes_log.txt b/LANG_admin/vicidial_en/admin_changes_log.txt deleted file mode 100644 index e4750d94..00000000 --- a/LANG_admin/vicidial_en/admin_changes_log.txt +++ /dev/null @@ -1,37 +0,0 @@ -Wed, 14 Dec 2005 10:17:51 -0500|ADD A NEW SCRIPT ENTRY |6666|10.10.6.19|'TESTCAMP01','first test script','script_comments','script_text','Y'| -Wed, 14 Dec 2005 17:02:06 -0500|ADD A NEW SCRIPT ENTRY |6666|10.10.6.19|'TESTCAMP02','first test script','for testing purposes only','asdf asdf as dfafd as dfas fda sf as fa sdf a sdf as fda sdf a sdf as fas df as fa sf as dfa sdf a fd - - -hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there ','Y'| -Wed, 14 Dec 2005 17:04:05 -0500|ADD A NEW SCRIPT ENTRY |6666|10.10.6.19|'TESTCAMP03','first test script','for testing purposes only','asdf asdf as dfafd as dfas fda sf as fa sdf a sdf as fda sdf a sdf as fas df as fa sf as dfa sdf a fd - - -hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there hello there ','Y'| -Tue, 03 Jan 2006 11:33:22 -0500|RESET LIST CALLED |123456|10.10.6.19|list_name='test domestic lists'| -Tue, 03 Jan 2006 11:33:22 -0500|MODIFY LIST INFO |123456|10.10.6.19|list_name='test domestic lists',campaign_id='TESTCAMP',active='Y' where list_id='101'| -Mon, 23 Jan 2006 10:45:26 -0500|ADD A NEW CAMPAIGN |123456|10.10.6.19|INSERT INTO vicidial_campaigns (campaign_id,campaign_name,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch) values('CCONFIRM','College Partnership Confirm','Y','NEW','DOWN','','','','Y','50','1','oldest_call_finish','9am-9pm','','','NONE')| -Mon, 23 Jan 2006 10:46:09 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='College Partnership Confirm',active='Y',dial_status_a='NEW',dial_status_b='',dial_status_c='',dial_status_d='',dial_status_e='',lead_order='DOWN',allow_closers='Y',hopper_level='50', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='9am-9pm', voicemail_ext='', dial_timeout='60', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8367', web_form_address='', park_ext='', park_file_name='', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='FULLDATE_AGENT', campaign_script='', get_call_launch='NONE', am_message_exten='' where campaign_id='CCONFIRM'|N| -Mon, 23 Jan 2006 10:47:08 -0500|ADD A NEW CAMPAIGN HOTKEY |123456|10.10.6.19|'A','1','Answering Machine','Y','CCONFIRM'| -Mon, 23 Jan 2006 10:47:14 -0500|ADD A NEW CAMPAIGN HOTKEY |123456|10.10.6.19|'N','2','No Answer','Y','CCONFIRM'| -Mon, 23 Jan 2006 10:48:06 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='College Partnership',active='Y',dial_status_a='N',dial_status_b='NEW',dial_status_c='DROP',dial_status_d='A',dial_status_e='NA',lead_order='DOWN COUNT',allow_closers='Y',hopper_level='200', auto_dial_level='2.7', next_agent_call='oldest_call_finish', local_call_time='9am-9pm', voicemail_ext='', dial_timeout='30', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8367', web_form_address='http://10.10.10.196/vicidial/vicidial_college_partnership.php', park_ext='', park_file_name='', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='FULLDATE_AGENT', campaign_script='', get_call_launch='NONE', am_message_exten='' where campaign_id='CPARTNER'|N| -Mon, 23 Jan 2006 10:48:22 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='College Partnership Confirm',active='Y',dial_status_a='NEW',dial_status_b='',dial_status_c='',dial_status_d='',dial_status_e='',lead_order='DOWN',allow_closers='Y',hopper_level='50', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='9am-9pm', voicemail_ext='', dial_timeout='30', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8367', web_form_address='', park_ext='', park_file_name='', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='FULLDATE_AGENT', campaign_script='', get_call_launch='NONE', am_message_exten='' where campaign_id='CCONFIRM'|N| -Mon, 23 Jan 2006 10:49:01 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='College Partnership Confirm',active='Y',dial_status_a='NEW',dial_status_b='',dial_status_c='',dial_status_d='',dial_status_e='',lead_order='DOWN',allow_closers='Y',hopper_level='50', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='9am-9pm', voicemail_ext='', dial_timeout='30', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8367', web_form_address='http://10.10.10.196/vicidial/vicidial_college_partnership_confirm.php', park_ext='', park_file_name='', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='FULLDATE_AGENT', campaign_script='', get_call_launch='NONE', am_message_exten='' where campaign_id='CCONFIRM'|N| -Mon, 23 Jan 2006 11:07:57 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='College Partnership Confirm',active='Y',dial_status_a='NEW',dial_status_b='',dial_status_c='',dial_status_d='',dial_status_e='',lead_order='DOWN',allow_closers='Y',hopper_level='50', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='9am-9pm', voicemail_ext='', dial_timeout='30', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8367', web_form_address='http://10.10.10.196/vicidial/vicidial_college_partnership_confirm.php?STAGE=CONFIRMLOOKUP', park_ext='', park_file_name='', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='FULLDATE_AGENT', campaign_script='', get_call_launch='NONE', am_message_exten='' where campaign_id='CCONFIRM'|N| -Mon, 23 Jan 2006 12:10:13 -0500|ADD A NEW LIST |123456|10.10.6.19|'80204','CP Confirm Jan28-29','CCONFIRM','N'| -Mon, 23 Jan 2006 12:14:26 -0500|MODIFY LIST INFO |123456|10.10.6.19|list_name='CPConfirm Jan28-29 E',campaign_id='CCONFIRM',active='N' where list_id='80204'| -Mon, 23 Jan 2006 12:14:31 -0500|RESET LIST CALLED |123456|10.10.6.19|list_name='CPConfirm Jan28-29 E'| -Mon, 23 Jan 2006 12:14:31 -0500|MODIFY LIST INFO |123456|10.10.6.19|list_name='CPConfirm Jan28-29 E',campaign_id='CCONFIRM',active='Y' where list_id='80204'| -Mon, 23 Jan 2006 12:14:48 -0500|ADD A NEW LIST |123456|10.10.6.19|'80304','CPConfirm Jan28-29 W','CCONFIRM','Y'| -Mon, 23 Jan 2006 12:15:57 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='College Partnership Confirm',active='Y',dial_status_a='SALE',dial_status_b='',dial_status_c='',dial_status_d='',dial_status_e='',lead_order='DOWN',allow_closers='Y',hopper_level='50', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='9am-9pm', voicemail_ext='', dial_timeout='30', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8367', web_form_address='http://10.10.10.196/vicidial/vicidial_college_partnership_confirm.php?STAGE=CONFIRMLOOKUP', park_ext='', park_file_name='', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='FULLDATE_AGENT', campaign_script='', get_call_launch='NONE', am_message_exten='' where campaign_id='CCONFIRM'|N| -Mon, 23 Jan 2006 12:16:16 -0500|RESET LIST CALLED |123456|10.10.6.19|list_name='CPConfirm Jan28-29 E'| -Mon, 23 Jan 2006 12:16:16 -0500|MODIFY LIST INFO |123456|10.10.6.19|list_name='CPConfirm Jan28-29 E',campaign_id='CCONFIRM',active='Y' where list_id='80204'| -Mon, 23 Jan 2006 12:16:37 -0500|RESET LIST CALLED |123456|10.10.6.19|list_name='CPConfirm Jan28-29 W'| -Mon, 23 Jan 2006 12:16:37 -0500|MODIFY LIST INFO |123456|10.10.6.19|list_name='CPConfirm Jan28-29 W',campaign_id='CCONFIRM',active='Y' where list_id='80304'| -Mon, 23 Jan 2006 12:18:31 -0500|RESET LIST CALLED |123456|10.10.6.19|list_name='CPConfirm Jan28-29 W'| -Mon, 23 Jan 2006 12:18:31 -0500|MODIFY LIST INFO |123456|10.10.6.19|list_name='CPConfirm Jan28-29 W',campaign_id='CCONFIRM',active='Y' where list_id='80304'| -Mon, 23 Jan 2006 12:18:42 -0500|RESET LIST CALLED |123456|10.10.6.19|list_name='CPConfirm Jan28-29 E'| -Mon, 23 Jan 2006 12:18:42 -0500|MODIFY LIST INFO |123456|10.10.6.19|list_name='CPConfirm Jan28-29 E',campaign_id='CCONFIRM',active='Y' where list_id='80204'| -Mon, 23 Jan 2006 12:21:01 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='College Partnership Confirm',active='Y',dial_status_a='NEW',dial_status_b='',dial_status_c='',dial_status_d='',dial_status_e='',lead_order='DOWN',allow_closers='Y',hopper_level='50', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='9am-9pm', voicemail_ext='', dial_timeout='30', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8367', web_form_address='http://10.10.10.196/vicidial/vicidial_college_partnership_confirm.php?STAGE=CONFIRMLOOKUP', park_ext='', park_file_name='', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='FULLDATE_AGENT', campaign_script='', get_call_launch='NONE', am_message_exten='' where campaign_id='CCONFIRM'|N| -Mon, 23 Jan 2006 12:21:13 -0500|CAMPAIGN HOPPERRESET|123456|10.10.6.19|campaign_name='College Partnership Confirm'| -Mon, 23 Jan 2006 12:21:13 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='College Partnership Confirm',active='Y',dial_status_a='NEW',dial_status_b='',dial_status_c='',dial_status_d='',dial_status_e='',lead_order='DOWN',allow_closers='Y',hopper_level='50', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='9am-9pm', voicemail_ext='', dial_timeout='30', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8367', web_form_address='http://10.10.10.196/vicidial/vicidial_college_partnership_confirm.php?STAGE=CONFIRMLOOKUP', park_ext='', park_file_name='', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='FULLDATE_AGENT', campaign_script='', get_call_launch='NONE', am_message_exten='' where campaign_id='CCONFIRM'|Y| -Tue, 24 Jan 2006 11:35:57 -0500|MODIFY CAMPAIGN INFO|123456|10.10.6.19|campaign_name='UMG Card on File',active='Y',dial_status_a='N',dial_status_b='B',dial_status_c='DROP',dial_status_d='A',dial_status_e='NA',lead_order='DOWN COUNT',hopper_level='500', auto_dial_level='4.0' where campaign_id='UMGCOF'|N| diff --git a/LANG_admin/vicidial_en/admin_modify_lead.php b/LANG_admin/vicidial_en/admin_modify_lead.php deleted file mode 100644 index 9dad4f62..00000000 --- a/LANG_admin/vicidial_en/admin_modify_lead.php +++ /dev/null @@ -1,476 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} - elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} -if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} - elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} -if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} - elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} - elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead - -# CHANGES -# -# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user -# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60609-1112 - Added DNC list addition if status changed to DNC -# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat -# - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Lead record modification - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "information modified

\n"; - echo "\n"; - - if ( ($dispo != $status) and ($dispo == 'CBHOLD') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - - if ( ($dispo != $status) and ($status == 'DNC') ) - { - ### add lead to the internal DNC list - $stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; - } - -} -else -{ - - if ($CBchangeUSERtoANY == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to ANYONE
\n"; - } - if ($CBchangeUSERtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record user changed to $CBuser
\n"; - } - if ($CBchangeANYtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; - } - - - - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Call information: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select * from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } - - - - - - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - -echo "

\n"; - -echo "
\n"; - -echo "CALLS TO THIS LEAD:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD
$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial_en/admin_search_lead.php b/LANG_admin/vicidial_en/admin_search_lead.php deleted file mode 100644 index a727e3a1..00000000 --- a/LANG_admin/vicidial_en/admin_search_lead.php +++ /dev/null @@ -1,224 +0,0 @@ - LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php -# -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead -# -# changes: -# 60620-1055 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - Changed results to multi-record -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Lead Search - -Lead Lookup - - - -
\n"; - echo "
\n"; - echo "\n"; - echo "Please enter a:
Vendor ID(vendor lead code): or \n"; - echo "
a Home Phone Number: or\n"; - echo "
a lead ID:

\n"; - echo "
\n"; - echo "\n
\n"; - echo "\n"; - exit; - } - -else - { - - if ($vendor_id) - { - $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000"; - } - else - { - if ($phone) - { - $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000"; - } - else - { - if ($lead_id) - { - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000"; - } - else - { - print "ERROR: you must search for something! Go back and search for something"; - exit; - } - } - } - if ($DB) - { - echo "\n\n$stmt\n\n"; - } - - $rslt=mysql_query($stmt, $link); - $results_to_print = mysql_num_rows($rslt); - if ($results_to_print < 1) - { - echo date("l F j, Y G:i:s A"); - echo "\n

\n"; - echo "The search variables you entered are not active in the system

\n"; - echo "Please go back and double check the information you entered and submit again\n"; - echo "
\n"; - echo "\n"; - exit; - } - else - { - echo "RESULTS: $results_to_print

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $o=0; - while ($results_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $o++; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "
#LEAD IDSTATUSVENDOR IDLAST AGENTLIST IDPHONENAMECITYSECURITYLAST CALL
$o$row[0]$row[3]$row[5]$row[4]$row[7]$row[11]$row[13] $row[15]$row[19]$row[28]$row[2]
\n"; - } - } - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\nNEW SEARCH"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; - - -?> - - - - - diff --git a/LANG_admin/vicidial_en/count.htm b/LANG_admin/vicidial_en/count.htm deleted file mode 100644 index 51f8a361..00000000 --- a/LANG_admin/vicidial_en/count.htm +++ /dev/null @@ -1 +0,0 @@ - diff --git a/LANG_admin/vicidial_en/dbconnect.php b/LANG_admin/vicidial_en/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_admin/vicidial_en/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_admin/vicidial_en/group_hourly_stats.php b/LANG_admin/vicidial_en/group_hourly_stats.php deleted file mode 100644 index b7eb1b31..00000000 --- a/LANG_admin/vicidial_en/group_hourly_stats.php +++ /dev/null @@ -1,252 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1014 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];} - elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$date_with_hour_default = date("Y-m-d H"); -$date_no_hour_default = $TODAY; - -if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} - $date_no_hour = $date_with_hour; - $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - -# $stmt="SELECT full_name from vicidial_users where user='$user';"; -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: Group Hourly Stats -\n"; -?> - - -
- - - - - -= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDtotal[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDday[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDcount[$o] = "$row[0]"; - $o++; - } - -echo "
  VICIDIAL ADMIN: Group Hourly Stats  
\n"; - -echo "
\n"; - -echo "TSR HOUR COUNTS: $group | $status | $date_with_hour | $date_no_hour\n"; - -echo "
\n"; -echo "\n"; - - $day_calls=0; - $hour_calls=0; - $total_calls=0; - $o=0; - while($o < $tsrs_to_print) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $VDtotal[$o]); - $hour_calls = ($hour_calls + $VDcount[$o]); - $day_calls = ($day_calls + $VDday[$o]); - - $o++; - } - -echo "\n"; - - -} - -echo "
TSR ID   $status   TOTAL CALLS   $status DAY    
$VDuser[$o] $VDname[$o] $VDcount[$o] $VDtotal[$o] $VDday[$o]MODIFY | STATS
TOTAL $status $hour_calls $total_calls $day_calls
\n"; -echo "

\n"; - - - echo "
Please enter the group you want to get hourly stats for:
\n"; - echo "\n"; - echo "group:
\n"; - echo "status:   (example: XFER)
\n"; - echo "date with hour:   (example: 2004-06-25 14)
\n"; - echo "\n"; - echo "


\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_en/help.gif b/LANG_admin/vicidial_en/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/vicidial_en/help.gif and /dev/null differ diff --git a/LANG_admin/vicidial_en/listloader.php b/LANG_admin/vicidial_en/listloader.php deleted file mode 100644 index 71dd25e4..00000000 --- a/LANG_admin/vicidial_en/listloader.php +++ /dev/null @@ -1,698 +0,0 @@ - LICENSE: GPLv2 -# -# AST Web GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1006 - added listID override and gmt_offset lookup while loading -# 60619-1652 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -# - -$version = '1.1.12'; -$build = '60619-1652'; - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];} -$list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - - -#$DB=1; -#$DBX=1; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('listloader.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HELP\""; - - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -?> - - - - - - method=post enctype="multipart/form-data"> -
- - - - - - - - - - - - - -
Load leads from this file:
List ID Override: (numbers only or leave blank for values in the file)
CLICK HERE TO GO TO THE SUPER LEAD LOADER (BETA VERSION)     BACK TO ADMIN
- -document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - $pulldate=date("Y-m-d H:i:s"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("./vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city = $row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) - { - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $gmt_offset = '0'; - $called_since_last_reset='N'; - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =='1') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### MEXICO ### - if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### AUSTRALIA ### - if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - print ""; -} else if (filesize($leadfile)>8388608) { - print "
ERROR: File exceeds the 8MB limit.
"; -} -?> - - diff --git a/LANG_admin/vicidial_en/listloaderMAIN.php b/LANG_admin/vicidial_en/listloaderMAIN.php deleted file mode 100644 index 67ee25bc..00000000 --- a/LANG_admin/vicidial_en/listloaderMAIN.php +++ /dev/null @@ -1,79 +0,0 @@ - LICENSE: GPLv2 -# -# this is the main frame page for the lead loading section. This is where you -# would upload a file and have it inserted into vicidial_list -# -# changes: -# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - -VICIDIAL: Lead Loader Module - - - - - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/new_listloader_superL.php b/LANG_admin/vicidial_en/new_listloader_superL.php deleted file mode 100644 index d9471182..00000000 --- a/LANG_admin/vicidial_en/new_listloader_superL.php +++ /dev/null @@ -1,1364 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60113-1603 - Fixed a few bugs in Excel import -# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1240 - added listID override -# 60616-1604 - added gmt lookup for each lead -# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. - -$version = '1.1.12-1'; -$build = '60619-1651'; - - -require("dbconnect.php"); - -### links used for testing -#$link=mysql_connect("10.10.10.15", "cron", "1234"); -#mysql_select_db("asterisk"); -#$WeBServeRRooT = '/home/www/htdocs'; - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} - elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} - elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} -if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} - elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} -if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} - elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} -if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} - elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} -if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} - elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} -if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} - elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} -if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} - elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} -if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} - elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} -if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} - elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} -if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} - elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} -if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} - elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} -if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} - elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} -if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} - elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} -if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} - elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} -if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} - elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} -if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} - elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} -if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} - elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} -if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} - elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} -if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} - elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} -if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} - elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} -if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} - elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} -if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} - elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} -if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} - elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} -if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} - elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} -if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} - elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} -if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} - elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} -if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} - elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); - -# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HELP\""; - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -function macfontfix($fontsize) { - - $browser = getenv("HTTP_USER_AGENT"); - $pctype = explode("(", $browser); - if (ereg("Mac",$pctype[1])) { - /* Browser is a Mac. If not Netscape 6, raise fonts */ - - $blownbrowser = explode('/', $browser); - $ver = explode(' ', $blownbrowser[1]); - $ver = $ver[0]; - if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); - - } else return $fontsize; /* Browser is not a Mac - don't touch fonts */ -} - -echo "\n"; - -?> - - - -VICIDIAL ADMIN: Super Lead Loader - - -
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - - - - - - - - - - - - - - - - - - - - -
Load leads from this file:
List ID Override: (numbers only or leave blank for values in the file)
File layout to use:Standard VICIDIAL    Custom layout
        
CLICK HERE TO GO TO THE BASIC LEAD LOADER         BACK TO ADMIN
SUPER LIST LOADER-     VERSION:     BUILD:
- - -document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - $total=0; $good=0; $bad=0; - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Processing $delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - print "
Processing Excel file... \n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

\n"; - } - # print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override"); - } else { - # copy($leadfile, "./vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - } - print ""; - } - -if ($leadfile && filesize($LF_path)<=8388608) { - $total=0; $good=0; $bad=0; - if ($file_layout=="standard") { - - print ""; - flush(); - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } - print ""; - - } else { - print "
"; - flush(); - print "\r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Processing $delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - $total=0; $good=0; $bad=0; - $row=fgetcsv($file, 1000, ","); - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print "
VICIDIAL ColumnFile data
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
        
\r\n"; - # } - print ""; - } -} else if (filesize($leadfile)>8388608) { - print "
ERROR: File exceeds the 8MB limit.
"; -} -?> - - - - - - - - - 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### MEXICO ### -if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### AUSTRALIA ### -if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### ALL OTHER COUNTRY CODES ### -if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - -### Find out if DST to raise the gmt offset ### -$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); -$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - -$AC_processed=0; -if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } -if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - -return $gmt_offset; -} \ No newline at end of file diff --git a/LANG_admin/vicidial_en/project_auth_entries.txt b/LANG_admin/vicidial_en/project_auth_entries.txt deleted file mode 100644 index b152bf1c..00000000 --- a/LANG_admin/vicidial_en/project_auth_entries.txt +++ /dev/null @@ -1,129 +0,0 @@ -VICIDIAL|GOOD|Thu, 22 Sep 2005 17:42:07 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:04 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:14 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:15 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:16 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:17 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:18 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:19 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:20 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:35 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:37 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:03:39 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 13:14:51 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 16:18:06 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:48 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:47:57 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:48:00 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:48:01 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 30 Sep 2005 15:48:43 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 30 Sep 2005 15:50:19 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Tue, 04 Oct 2005 10:57:45 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -LIST_LOAD|GOOD|Tue, 04 Oct 2005 10:57:52 -0400|lead|load|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|| -VICIDIAL|GOOD|Tue, 04 Oct 2005 10:57:54 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:02:12 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:09:17 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:02:48 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 13 Dec 2005 17:44:00 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 13 Dec 2005 17:44:50 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 13 Dec 2005 17:53:06 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 13 Dec 2005 17:53:08 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 13 Dec 2005 17:53:11 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Wed, 14 Dec 2005 10:17:14 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Wed, 14 Dec 2005 10:17:51 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Wed, 14 Dec 2005 17:01:30 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Wed, 14 Dec 2005 17:02:01 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Wed, 14 Dec 2005 17:02:06 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Wed, 14 Dec 2005 17:04:05 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Wed, 14 Dec 2005 17:04:07 -0500|6666|sales|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Wed, 14 Dec 2005 17:04:25 -0500|123456|bob5|10.10.6.19|Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)|1 - TESTCAMP remote agent| -VICIDIAL|GOOD|Wed, 14 Dec 2005 17:04:33 -0500|123456|bob5|10.10.6.19|Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)|1 - TESTCAMP remote agent| -VICIDIAL|GOOD|Wed, 14 Dec 2005 17:04:36 -0500|123456|bob5|10.10.6.19|Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)|1 - TESTCAMP remote agent| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:09:08 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Fri, 23 Dec 2005 14:39:26 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Fri, 23 Dec 2005 14:39:37 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Tue, 03 Jan 2006 11:33:11 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Tue, 03 Jan 2006 11:33:15 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Tue, 03 Jan 2006 11:33:18 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Tue, 03 Jan 2006 11:33:22 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Tue, 03 Jan 2006 11:33:25 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:37:53 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:04 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:06 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:55 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:47:46 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:47:48 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:44:44 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:45:26 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:46:09 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:47:08 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:47:14 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:47:47 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:47:54 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:06 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:10 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:14 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:22 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:23 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:25 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:27 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:39 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:42 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:49 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:48:52 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 10:49:01 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 11:07:57 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:06:18 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:06:20 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:06:23 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:06:43 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:09:37 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:10:13 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:14:26 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:14:31 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:14:36 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:14:48 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:14:51 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:14:56 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:15:45 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:15:57 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:16:04 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:16:16 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:16:31 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:16:34 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:16:37 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:18:31 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:18:36 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:18:39 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:18:42 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:18:43 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:18:49 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:21:01 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Mon, 23 Jan 2006 12:21:13 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 10:01:26 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 10:01:30 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 10:08:30 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 10:08:33 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 11:34:58 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 11:35:04 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 11:35:10 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 11:35:22 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 11:35:49 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Tue, 24 Jan 2006 11:35:57 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 03 Mar 2006 16:14:19 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:03:05 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:21:23 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:21:45 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:21:47 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:21:49 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:21:52 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:21:56 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:21:57 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:21:59 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:22:00 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:22:01 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:41:20 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 10:05:32 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 10:05:35 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 10:06:06 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:35:54 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| diff --git a/LANG_admin/vicidial_en/remote_dispo.php b/LANG_admin/vicidial_en/remote_dispo.php deleted file mode 100644 index da249fba..00000000 --- a/LANG_admin/vicidial_en/remote_dispo.php +++ /dev/null @@ -1,327 +0,0 @@ - LICENSE: GPLv2 -### -# this is the remote agent disposition screen for calls sent to remote agents. This allows the remote agent to modify customer information and disposition the call - -# CHANGES -# -# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat -# - - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -VICIDIAL REMOTE: Call Disposition -\n"; -?> - - -
- -"; - -if ($end_call > 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Call has been dispositioned       $NOW_TIME\n

\n"; - - echo "
\n"; - -} -else -{ - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Call information: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Campaign ID: $campaign_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial_en/server_stats.php b/LANG_admin/vicidial_en/server_stats.php deleted file mode 100644 index a427f5c0..00000000 --- a/LANG_admin/vicidial_en/server_stats.php +++ /dev/null @@ -1,96 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: Server Stats and Reports -VICIDIAL: Server Stats and Reports                           -BACK TO ADMIN

- - -

-
- $o)
-	{
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	$o++;
-	}
-
-?>
-
SERVERDESCRIPTIONIP ADDRESSACTIVEVDAD timeVDcall timePARK timeCLOSER/INBOUND time
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_en/user_stats.php b/LANG_admin/vicidial_en/user_stats.php deleted file mode 100644 index bdada227..00000000 --- a/LANG_admin/vicidial_en/user_stats.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: User Stats -\n"; -?> - - -
- - - - - -\n"; -echo "
  VICIDIAL ADMIN: User Stats for  
  \n"; - -echo "
\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - -echo "
\n"; - -echo "TALK TIME AND STATUS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - -echo "\n"; -echo "
STATUSCOUNTHOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LOGIN/LOGOUT TIME:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); - $event_minutes = ($event_hours - $event_hours_int); - $event_minutes = ($event_minutes * 60); - $event_minutes_int = round($event_minutes, 0); - if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - } - - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - -$total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); -$total_login_minutes = ($total_login_hours - $total_login_hours_int); -$total_login_minutes = ($total_login_minutes * 60); -$total_login_minutes_int = round($total_login_minutes, 0); -if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} - -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "
EVENT DATE CAMPAIGNHOURS:MINUTES
$row[0] $row[2] $row[3]
$row[0] $row[2] $row[3] $event_hours_int:$event_minutes_int
$row[0] $row[2] $row[3]
TOTAL $total_login_hours_int:$total_login_minutes_int
\n"; - - -echo "

\n"; - -echo "
\n"; - -echo "LAST 50 CALLS:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS PHONE CAMPAIGN LIST LEAD
$row[4] $row[7] $row[8] $row[10] $row[3] $row[2] $row[1]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_en/user_status.php b/LANG_admin/vicidial_en/user_status.php deleted file mode 100644 index 8efe670f..00000000 --- a/LANG_admin/vicidial_en/user_status.php +++ /dev/null @@ -1,238 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $change_agent_campaign=$row[1]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - $stmt="SELECT * from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $agents_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $agents_to_print) - { - $row=mysql_fetch_row($rslt); - $Aserver_ip = $row[2]; - $Asession_id = $row[3]; - $Aextension = $row[4]; - $Astatus = $row[5]; - $Acampaign = $row[7]; - $Alast_call = $row[14]; - $Acl_campaigns = $row[15]; - $i++; - } - - } - -$stmt="select * from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - - - -?> - - -VICIDIAL ADMIN: User Status -\n"; -?> - - -
-
- - - - -\n"; -echo "
  VICIDIAL ADMIN: User Status for  
  \n"; - -if ($stage == "live_campaign_change") -{ - $stmt="UPDATE vicidial_live_agents set campaign_id='" . mysql_real_escape_string($group) . "' where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name changed to $group campaign
\n"; - - exit; -} - -if ($stage == "log_agent_out") -{ - $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser
\n"; - - exit; -} - -if ($agents_to_print > 0) -{ - echo "
";
-	echo "Agent Logged in at server:  $Aserver_ip\n";
-	echo "               in session:  $Asession_id\n";
-	echo "               from phone:  $Aextension\n";
-	echo "Agent is in campaign:       $Acampaign\n";
-	echo "              status:       $Astatus\n";
-	echo " hungup last call at:       $Alast_call\n";
-	echo "       Closer groups:       $Acl_campaigns\n\n";
-
-	echo "
"; - - - if ($change_agent_campaign > 0) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "Current Campaign: \n"; - echo "
\n"; - - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - } -} - -else -{ - echo "Agent is not logged in\n
"; - -} - - -echo "           $user - $full_name - \n"; - -echo "VICIDIAL Time Sheet\n"; - -echo "
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - -echo "|$stage|$group|"; - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_en/vdremote.php b/LANG_admin/vicidial_en/vdremote.php deleted file mode 100644 index dfe11fa3..00000000 --- a/LANG_admin/vicidial_en/vdremote.php +++ /dev/null @@ -1,602 +0,0 @@ - LICENSE: GPLv2 -# -# Changes -# 50307-1721 - First version -# 51123-1502 - removed requirement of PHP Globals=on -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time - -$version = '1.1.12'; -$build = '60619-1603'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($force_logout)) {$force_logout = 0;} - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$popup_page = './closer_popup.php'; -$STARTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - $stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $authx=$row[0]; - - if($authx>0) - { - $stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id=$row[0]; - $server_ip=$row[1]; - if (!$number_of_lines) {$number_of_lines=$row[2];} - - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; - exit; - } - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -if ($ADD==61111) - { - echo"\n"; - } -echo "\n"; -?> - -VICIDIAL REMOTE AGENTS: $LOGfullname - $PHP_AUTH_USER "; - -if (!$ADD) {$ADD="31111";} -if ($ADD==31111) {echo "Modify Remote Agents";} -if ($ADD==41111) {echo "Modify Remote Agents";} -if ($ADD==61111) {echo "Remote Agent Status";} -if ($ADD==71111) {echo "Remote Agent Closer Stats";} - - -if (strlen($ADD)>4) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "2) {$groups_value .= " -";} - } - -?> - - - -
-
- - - -
  VICIDIAL REMOTE AGENTS:   Logout  
  MODIFY | ">STATUS | ">INBOUND STATS
-"; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: $user_start
Number of Lines: (numbers only)
Server IP: $row[3]
External Extension: (number dialed to reach agents [i.e. 913125551212])
Status:
Campaign: $campaign_id
Inbound Groups: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) - {echo "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - $stmt="UPDATE vicidial_remote_agents set number_of_lines='" . mysql_real_escape_string($number_of_lines) . "', conf_exten='" . mysql_real_escape_string($conf_exten) . "', status='" . mysql_real_escape_string($status) . "', closer_campaigns='" . mysql_real_escape_string($groups_value) . "' where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - -# echo "$stmt\n"; - echo "
REMOTE AGENTS MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - - } - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: $user_start
Number of Lines: (numbers only)
Server IP: $row[3]
External Extension: (number dialed to reach agents [i.e. 913125551212])
Status:
Campaign: $campaign_id
Inbound Groups: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - - - -###################### -# ADD=61111 status of remote agent in the system and active calls and queue -###################### - -if ($ADD==61111) -{ - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'" . mysql_real_escape_string($nextuser) . "',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - echo "VICIDIAL: Remote Agent Time On Calls $NOW_TIME\n\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $leadlink=0; - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[3]=''; - $row[5]=' - WAITING - '; - $row[6]=$row[7]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $leadid = sprintf("%-12s", $row[2]); - if ($row[2] > 0) - { - $leadidLINK=$row[2]; - $leadlink++; - if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;} - $leadid = "$leadid"; - } - $channel = sprintf("%-10s", $row[3]); - $cc=0; - while ( (strlen($channel) > 10) and ($cc < 100) ) - { - $channel = eregi_replace(".$","",$channel); - $cc++; - if (strlen($channel) <= 10) {$cc=101;} - } - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = ($STARTtime - $row[6]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} - if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo " $i agents logged in on server $server_ip\n\n"; - - echo " - 5 minutes or more on call\n"; - echo " - Over 10 minutes on call\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "********************************* NO AGENTS ON CALLS *********************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - -###################### -# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log) -###################### - -if ($ADD==71111) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'$nextuser',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $in_calls = $row[0]; - $in_time = $row[1]; - $in_time_M = ($in_time / 60); - $in_time_M = round($in_time_M, 2); - $in_time_M_int = intval("$in_time_M"); - $in_time_SEC = ($in_time_M - $in_time_M_int); - $in_time_SEC = ($in_time_SEC * 60); - $in_time_SEC = round($in_time_SEC, 0); - if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";} - $in_time_MS = "$in_time_M_int:$in_time_SEC"; - $in_time_MS = sprintf("%7s", $in_time_MS); - - echo "VICIDIAL: Remote Agent inbound stats $NOW_TIME\n\n"; - echo "\n"; - echo "Total calls taken $query_date: $in_calls\n"; - echo "Total talk time on $query_date: $in_time_MS (minutes:seconds)\n"; - echo "\n"; - echo "\n"; - echo "Call list for $query_date:\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - $user = sprintf("%-8s", $row[0]); - $leadid = sprintf("%-10s", $row[1]); - $group = sprintf("%-14s", $row[2]); - $phone = sprintf("%-10s", $row[3]); - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = $row[6]; - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - # if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - # echo " $i agents logged in on server $server_ip\n\n"; - - # echo " - 5 minutes or more on call\n"; - # echo " - Over 10 minutes on call\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "********************************* NO CALLS ON THIS DAY *******************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_es/AST_CLOSERstats.php b/LANG_admin/vicidial_es/AST_CLOSERstats.php deleted file mode 100644 index 495856fb..00000000 --- a/LANG_admin/vicidial_es/AST_CLOSERstats.php +++ /dev/null @@ -1,396 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select group_id from vicidial_inbound_groups;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Estadísticas de VDAD Closer\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICAR | INFORMES \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "SELECCIONE POR FAVOR Una CAMPAÚA Y La FECHA ARRIBA Y El TECLEO SOMETEN\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Llamadas dentro de esta campaña $TOTALcalls\n";
-echo "Longitud media para las llamadas en segundos: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total DROP Calls: $DROPcalls  $DROPpercent%\n";
-echo "Longitud media para las llamadas DROP en segundos:    $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- ESTADÍSTICAS DEL USUARIO\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USUARIO                  | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- ESTADÍSTICAS DEL TIEMPO\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LAS LLAMADAS TOTALES PUESTAS DE ESTA CAMPAÚA\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/AST_VDADstats.php b/LANG_admin/vicidial_es/AST_VDADstats.php deleted file mode 100644 index 478ccef7..00000000 --- a/LANG_admin/vicidial_es/AST_VDADstats.php +++ /dev/null @@ -1,417 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICAR | INFORMES \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "SELECCIONE POR FAVOR Una CAMPAÚA Y La FECHA ARRIBA Y El TECLEO SOMETEN\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Llamadas dentro de esta campaña $TOTALcalls\n";
-echo "Longitud media para las llamadas en segundos: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total DROP Calls: $DROPcalls  $DROPpercent%\n";
-echo "Longitud media para las llamadas DROP en segundos:    $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- AUTO-DIAL SIN RESPUESTA\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='NA' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$NAcalls =	sprintf("%10s", $row[0]);
-$NApercent = (($NAcalls / $TOTALcalls) * 100);
-$NApercent = round($NApercent, 0);
-
-$average_na_seconds = ($row[1] / $row[0]);
-$average_na_seconds = round($average_na_seconds, 0);
-$average_na_seconds =	sprintf("%10s", $average_na_seconds);
-
-echo "Llamadas sin Respuesta - ocupado, desconexión,..:  $NAcalls  $NApercent%\n";
-echo "Longitud media para las Llamadas sin Respuesta en segundos:       $average_na_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- ESTADÍSTICAS DEL USUARIO\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USUARIO                  | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- ESTADÍSTICAS DEL TIEMPO\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRÁFICO EN 15 INCREMENTOS MINUCIOSOS DE LAS LLAMADAS TOTALES PUESTAS DE ESTA CAMPAÚA\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/AST_VICIDIAL_hopperlist.php b/LANG_admin/vicidial_es/AST_VICIDIAL_hopperlist.php deleted file mode 100644 index 1f2ca7cd..00000000 --- a/LANG_admin/vicidial_es/AST_VICIDIAL_hopperlist.php +++ /dev/null @@ -1,161 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.10.15';} - -$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $campaign_id[$i] =$row[0]; - $campaign_name[$i] =$row[1]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Lista De Hopper\n"; -echo "
\n"; -#echo "\n"; -#echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICAR \n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "SELECCIONE POR FAVOR Una CAMPAÚA ARRIBA Y El TECLEO SOMETE\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Live Current Lista De Hopper                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-
-echo "Total de Leads en el hopper ahora mismo:       $TOTALcalls\n";
-
-
-##############################
-#########  LEAD STATS
-
-echo "\n";
-echo "---------- LEADS IN HOPPER\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-echo "|      | LEAD_ID   | PHONE NUM  | STATE | STATUS | COUNT | GMT    |\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$FMT_i =		sprintf("%-4s", $i);
-	$lead_id =		sprintf("%-9s", $row[0]);
-	$phone_number =	sprintf("%-10s", $row[1]);
-	$state =		sprintf("%-5s", $row[2]);
-	$status =		sprintf("%-6s", $row[3]);
-	$count =		sprintf("%-5s", $row[4]);
-	$gmt =			sprintf("%-6s", $row[5]);
-
-	echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt |\n";
-
-	$i++;
-	}
-
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/AST_admin_log_display.php b/LANG_admin/vicidial_es/AST_admin_log_display.php deleted file mode 100644 index 6d89ee3e..00000000 --- a/LANG_admin/vicidial_es/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n\n";
-
-
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
-
-#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
-passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/AST_agent_performance.php b/LANG_admin/vicidial_es/AST_agent_performance.php deleted file mode 100644 index 5c58d6f8..00000000 --- a/LANG_admin/vicidial_es/AST_agent_performance.php +++ /dev/null @@ -1,232 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Agent Performance\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICAR | INFORMES \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVIDOR AND DATE-TIME ABOVE AND CLICK ENVIAR\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:33:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:33:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:33:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:33:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_es/AST_agent_performance_detail.php b/LANG_admin/vicidial_es/AST_agent_performance_detail.php
deleted file mode 100644
index 45a7f5f8..00000000
--- a/LANG_admin/vicidial_es/AST_agent_performance_detail.php
+++ /dev/null
@@ -1,406 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
-	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($group)) {$group = '';}
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-$stmt="select campaign_id from vicidial_campaigns;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$campaigns_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $campaigns_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFICAR | INFORMES \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK ENVIAR\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 03:45:00";   
-	$query_date_END = "$query_date 15:15:00";
-	$time_BEGIN = "03:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:15:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$TOTtotWAIT=($TOTtotWAIT + $row[7]);
-	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
-	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-	$USERtotPAUSE =	$row[5];
-	$USERavgPAUSE =	$row[6];
-	$USERtotWAIT =	$row[7];
-	$USERavgWAIT =	$row[8];
-	$USERtotDISPO =	$row[9];
-	$USERavgDISPO =	$row[10];
-
-	$USERtime_M = ($USERtime / 60);
-	$USERtime_M = round($USERtime_M, 2);
-	$USERtime_M_int = intval("$USERtime_M");
-	$USERtime_S = ($USERtime_M - $USERtime_M_int);
-	$USERtime_S = ($USERtime_S * 60);
-	$USERtime_S = round($USERtime_S, 0);
-	if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
-	$USERtime_MS = "$USERtime_M_int:$USERtime_S";
-	$pfUSERtime_MS[$i] =		sprintf("%7s", $USERtime_MS);
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-
-	$USERtotPAUSE_M = ($USERtotPAUSE / 60);
-	$USERtotPAUSE_M = round($USERtotPAUSE_M, 2);
-	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M");
-	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
-	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
-	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
-	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
-	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
-	$pfUSERtotPAUSE_MS[$i] =		sprintf("%6s", $USERtotPAUSE_MS);
-
-	$USERavgPAUSE_M = ($USERavgPAUSE / 60);
-	$USERavgPAUSE_M = round($USERavgPAUSE_M, 2);
-	$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M");
-	$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
-	$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
-	$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
-	if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
-	$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
-	$pfUSERavgPAUSE_MS[$i] =		sprintf("%6s", $USERavgPAUSE_MS);
-
-	$USERtotWAIT_M = ($USERtotWAIT / 60);
-	$USERtotWAIT_M = round($USERtotWAIT_M, 2);
-	$USERtotWAIT_M_int = intval("$USERtotWAIT_M");
-	$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
-	$USERtotWAIT_S = ($USERtotWAIT_S * 60);
-	$USERtotWAIT_S = round($USERtotWAIT_S, 0);
-	if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
-	$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
-	$pfUSERtotWAIT_MS[$i] =		sprintf("%6s", $USERtotWAIT_MS);
-
-	$USERavgWAIT_M = ($USERavgWAIT / 60);
-	$USERavgWAIT_M = round($USERavgWAIT_M, 2);
-	$USERavgWAIT_M_int = intval("$USERavgWAIT_M");
-	$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
-	$USERavgWAIT_S = ($USERavgWAIT_S * 60);
-	$USERavgWAIT_S = round($USERavgWAIT_S, 0);
-	if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
-	$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
-	$pfUSERavgWAIT_MS[$i] =		sprintf("%6s", $USERavgWAIT_MS);
-	
-	$USERtotDISPO_M = ($USERtotDISPO / 60);
-	$USERtotDISPO_M = round($USERtotDISPO_M, 2);
-	$USERtotDISPO_M_int = intval("$USERtotDISPO_M");
-	$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
-	$USERtotDISPO_S = ($USERtotDISPO_S * 60);
-	$USERtotDISPO_S = round($USERtotDISPO_S, 0);
-	if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
-	$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
-	$pfUSERtotDISPO_MS[$i] =		sprintf("%6s", $USERtotDISPO_MS);
-
-	$USERavgDISPO_M = ($USERavgDISPO / 60);
-	$USERavgDISPO_M = round($USERavgDISPO_M, 2);
-	$USERavgDISPO_M_int = intval("$USERavgDISPO_M");
-	$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
-	$USERavgDISPO_S = ($USERavgDISPO_S * 60);
-	$USERavgDISPO_S = round($USERavgDISPO_S, 0);
-	if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
-	$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
-	$pfUSERavgDISPO_MS[$i] =		sprintf("%6s", $USERavgDISPO_MS);
-
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]);	$TOT_CB = ($TOT_CB + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtime_M = ($TOTtime / 60);
-	$TOTtime_M = round($TOTtime_M, 2);
-	$TOTtime_M_int = intval("$TOTtime_M");
-	$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
-	$TOTtime_S = ($TOTtime_S * 60);
-	$TOTtime_S = round($TOTtime_S, 0);
-	if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
-	$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
-	$TOTtime_MS =		sprintf("%7s", $TOTtime_MS);
-		while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOTtotDISPO_M = ($TOTtotDISPO / 60);
-	$TOTtotDISPO_M = round($TOTtotDISPO_M, 2);
-	$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M");
-	$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
-	$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
-	$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
-	if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
-	$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
-	$TOTtotDISPO_MS =		sprintf("%7s", $TOTtotDISPO_MS);
-		while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
-
-	$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
-	$TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2);
-	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M");
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
-	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
-	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
-	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
-	$TOTtotPAUSE_MS =		sprintf("%7s", $TOTtotPAUSE_MS);
-		while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
-
-	$TOTtotWAIT_M = ($TOTtotWAIT / 60);
-	$TOTtotWAIT_M = round($TOTtotWAIT_M, 2);
-	$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M");
-	$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
-	$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
-	$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
-	if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
-	$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
-	$TOTtotWAIT_MS =		sprintf("%7s", $TOTtotWAIT_MS);
-		while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
-
-
-	$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);
-	$TOTavgTALK_M = round($TOTavgTALK_M, 2);
-	$TOTavgTALK_M_int = intval("$TOTavgTALK_M");
-	$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
-	$TOTavgTALK_S = ($TOTavgTALK_S * 60);
-	$TOTavgTALK_S = round($TOTavgTALK_S, 0);
-	if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
-	$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
-	$TOTavgTALK_MS =		sprintf("%6s", $TOTavgTALK_MS);
-		while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
-
-	$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);
-	$TOTavgDISPO_M = round($TOTavgDISPO_M, 2);
-	$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M");
-	$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
-	$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
-	$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
-	if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
-	$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
-	$TOTavgDISPO_MS =		sprintf("%6s", $TOTavgDISPO_MS);
-		while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
-
-	$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);
-	$TOTavgPAUSE_M = round($TOTavgPAUSE_M, 2);
-	$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M");
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
-	$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
-	if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
-	$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
-	$TOTavgPAUSE_MS =		sprintf("%6s", $TOTavgPAUSE_MS);
-		while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
-
-	$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);
-	$TOTavgWAIT_M = round($TOTavgWAIT_M, 2);
-	$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M");
-	$TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int);
-	$TOTavgWAIT_S = ($TOTavgWAIT_S * 60);
-	$TOTavgWAIT_S = round($TOTavgWAIT_S, 0);
-	if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";}
-	$TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S";
-	$TOTavgWAIT_MS =		sprintf("%6s", $TOTavgWAIT_MS);
-		while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
-
-	
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_CB = sprintf("%-5s", $TOT_CB);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_es/AST_agent_time_sheet.php b/LANG_admin/vicidial_es/AST_agent_time_sheet.php
deleted file mode 100644
index a01653c9..00000000
--- a/LANG_admin/vicidial_es/AST_agent_time_sheet.php
+++ /dev/null
@@ -1,281 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
-	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["calls_summary"]))				{$calls_summary=$_GET["calls_summary"];}
-	elseif (isset($_POST["calls_summary"]))		{$calls_summary=$_POST["calls_summary"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
-	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN AGENTE ID AND DATE-TIME ABOVE AND CLICK ENVIAR\n";
-echo " NOTE: stats taken from available agent log data\n";
-}
-
-else
-{
-$query_date_BEGIN = "$query_date 00:00:00";   
-$query_date_END = "$query_date 23:59:59";
-$time_BEGIN = "00:00:00";   
-$time_END = "23:59:59";
-
-$stmt="select full_name from vicidial_users where user='$agent';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$full_name = $row[0];
-
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTE TIME SHEET: $agent - $full_name -------------\n\n";
-
-if ($calls_summary)
-	{
-	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
-
-		$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "LLAMADAS TOTALES TAKEN: $row[0]\n";
-	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
-	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
-	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
-	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
-	echo "----------------------------------------------------------------\n";
-	echo "TOTAL ACTIVE AGENTE TIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_admin/vicidial_es/AST_server_performance.php b/LANG_admin/vicidial_es/AST_server_performance.php
deleted file mode 100644
index e7b7a022..00000000
--- a/LANG_admin/vicidial_es/AST_server_performance.php
+++ /dev/null
@@ -1,310 +0,0 @@
-    LICENSE: GPLv2
-#
-# CHANGES
-#
-# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
-if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
-	elseif (isset($_POST["ENVIAR"]))	{$ENVIAR=$_POST["ENVIAR"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-# path from root to where ploticus files will be stored
-$DOCroot = "$WeBServeRRooT/vicidial/ploticus/";
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-if (!isset($group)) {$group = '';}
-
-$stmt="select server_ip from servers;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$servers_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $servers_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Server Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "             INFORMES \n"; -echo "\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVIDOR AND DATE-TIME ABOVE AND CLICK ENVIAR\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:32:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:32:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- TOTALS, PEAKS and AVERAGES\n";
-
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGload =	sprintf("%10s", $row[0]);
-$AVGchannels =	sprintf("%10s", $row[1]);
-
-$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGcpuUSER =	sprintf("%10s", $row[0]);
-$AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
-$AVGcpuIDLE =	sprintf("%10s", $row[2]);
-
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-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','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
-
-
-echo "Total Calls in/out on this server:        $TOTALcalls\n";
-echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
-echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
-echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
-echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
-
-echo "\n";
-echo "---------- LINE GRAPH:\n";
-
-
-
-##############################
-#########  Graph stats
-
-$DAT = '.dat';
-$HTM = '.htm';
-$PNG = '.png';
-$filedate = date("Y-m-d_His");
-$DATfile = "$group$query_date$shift$filedate$DAT";
-$HTMfile = "$group$query_date$shift$filedate$HTM";
-$PNGfile = "$group$query_date$shift$filedate$PNG";
-
-$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
-$DATfp = fopen ("$DOCroot/$DATfile", "a");
-
-$stmt="select DATE_FORMAT(start_time,'%H:%i:%s') as timex,sysload,processes,channels_total,live_recordings,cpu_user_percent,cpu_system_percent from server_performance where server_ip='" . mysql_real_escape_string($group) . "' and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' order by timex;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$row[5] = intval(($row[5] + $row[6]) * $HIGHmulti);
-	$row[6] = intval($row[6] * $HIGHmulti);
-	fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
-	$i++;
-	}
-fclose($DATfp);
-
-$rows_to_max = ($rows_to_print + 100);
-
-
-
-$HTMcontent  = '';
-$HTMcontent .= "#proc page\n";
-$HTMcontent .= "#if @DEVICE in png,gif\n";
-$HTMcontent .= "   scale: 0.6\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#endif\n";
-$HTMcontent .= "#proc getdata\n";
-$HTMcontent .= "file: $DOCroot/$DATfile\n";
-$HTMcontent .= "fieldnames: userproc sysproc time load processes channels\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc areadef\n";
-$HTMcontent .= "title: Server $group   $query_date_BEGIN to $query_date_END\n";
-$HTMcontent .= "titledetails: size=14  align=C\n";
-$HTMcontent .= "rectangle: 1 1 14 7\n";
-$HTMcontent .= "xscaletype: time hh:mm:ss\n";
-$HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
-$HTMcontent .= "stubformat: hh:mm:ssa\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc yaxis\n";
-$HTMcontent .= "stubs: inc 50\n";
-$HTMcontent .= "grid: color=yellow\n";
-$HTMcontent .= "gridskip: min\n";
-$HTMcontent .= "ticincrement: 100 1000\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: userproc\n";
-$HTMcontent .= "linedetails: color=purple width=.5\n";
-$HTMcontent .= "fill: lavender\n";
-$HTMcontent .= "legendlabel: user proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: sysproc\n";
-$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
-$HTMcontent .= "fill: dullyellow\n";
-$HTMcontent .= "legendlabel: system proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: load\n";
-$HTMcontent .= "linedetails: color=blue width=.5\n";
-$HTMcontent .= "legendlabel: load\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: processes\n";
-$HTMcontent .= "linedetails: color=red width=.5\n";
-$HTMcontent .= "legendlabel: processes\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: channels\n";
-$HTMcontent .= "linedetails: color=green width=.5\n";
-$HTMcontent .= "legendlabel: channels\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc legend\n";
-$HTMcontent .= "location: max-2 max\n";
-$HTMcontent .= "seglen: 0.2\n";
-$HTMcontent .= "\n";
-
-fwrite ($HTMfp, "$HTMcontent");
-fclose($HTMfp);
-
-
-passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
-
-sleep(1);
-
-echo "
\n"; -echo "\n"; -echo "\n"; - - -echo ""; - -} - - - -?> - - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/AST_timeonVDAD.php b/LANG_admin/vicidial_es/AST_timeonVDAD.php deleted file mode 100644 index 2fb623d0..00000000 --- a/LANG_admin/vicidial_es/AST_timeonVDAD.php +++ /dev/null @@ -1,255 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 60620-1040 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Tiempo de los  Agentes En Llamadas        $NOW_TIME    INFORMES\n\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL    | STATUS | START TIME          | MINUTES |\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	$agentcount=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- ESPERANDO -';
-			$row[6]=$row[7];
-			}
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$sessionid =		sprintf("%-9s", $row[2]);
-		$channel =			sprintf("%-10s", $row[3]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[4]);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 5) {$G=''; $EG='';}
-		if ($call_time_M_int >= 10) {$G=''; $EG='';}
-		if (eregi("PAUSED",$row[4])) 
-			{
-			if ($call_time_M_int >= 1) 
-				{$i++; continue;} 
-			else
-				{$G=''; $EG='';}
-			}
-
-		$agentcount++;
-		echo "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-		echo "  $agentcount agentes identificados en el servidor $server_ip\n\n";
-
-		echo "             - Agentes detenidos brevemente\n";
-		echo "             - Llamadas de 5 minutos o más\n";
-		echo "             - Sobre 10 minutos en llamada\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "*********************************AGENTES SIN LLAMADAS*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-echo "| CHANNEL    | STATUS | CAMPAIGN | PHONE NUMBER       | START TIME          | MINUTES |\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-8s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-		echo "  $i llamadas en el servidor $server_ip\n\n";
-
-		echo "             - LLAMADAS ACTUALES EN ESPERA\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "*******************************LLAMADAS EN ESPERA*********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - diff --git a/LANG_admin/vicidial_es/AST_timeonVDAD_closer.php b/LANG_admin/vicidial_es/AST_timeonVDAD_closer.php deleted file mode 100644 index 9850f4ed..00000000 --- a/LANG_admin/vicidial_es/AST_timeonVDAD_closer.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# CHANGES -# -# 60620-1037 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - -\n"; -echo " - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Tiempo de los  Agentes En Llamadas        $NOW_TIME    INFORMES\n\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
-			}
-		$extension[$i] =		sprintf("%-10s", $row[0]);
-		$user[$i] =				sprintf("%-6s", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
-			$cc[$i]=0;
-		while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
-			{
-			$channel[$i] = eregi_replace(".$","",$channel[$i]);   
-			$cc[$i]++;
-			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
-			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
-			$cd[$i]=0;
-		while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
-			{
-			$start_time[$i] = eregi_replace("^.","",$start_time[$i]);   
-			$cd[$i]++;
-			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
-			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
-
-		$call_time_M[$i] = ($call_time_S[$i] / 60);
-		$call_time_M[$i] = round($call_time_M[$i], 2);
-		$call_time_M_int[$i] = intval("$call_time_M[$i]");
-		$call_time_SEC[$i] = ($call_time_M[$i] - $call_time_M_int[$i]);
-		$call_time_SEC[$i] = ($call_time_SEC[$i] * 60);
-		$call_time_SEC[$i] = round($call_time_SEC[$i], 0);
-		if ($call_time_SEC[$i] < 10) {$call_time_SEC[$i] = "0$call_time_SEC[$i]";}
-		$call_time_MS[$i] = "$call_time_M_int[$i]:$call_time_SEC[$i]";
-		$call_time_MS[$i] =		sprintf("%7s", $call_time_MS[$i]);
-		$i++;
-		}
-		$ext_count = $i;
-		$i=0;
-	while ($i < $ext_count)
-		{
-
-		$stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$camp_to_print = mysql_num_rows($rslt);
-		if ($camp_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$campaign = sprintf("%-12s", $row[0]);
-			$camp_color = $row[0];
-			}
-		else
-			{$campaign = 'DEAD        ';   	$camp_color = 'DEAD';}
-		if (eregi("READY|PAUSED|CLOSER",$status[$i]))
-			{$campaign = '            ';   	$camp_color = '';}
-
-		$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$xfer_to_print = mysql_num_rows($rslt);
-		if ($xfer_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$fronter = sprintf("%-6s", $row[0]);
-			}
-		else
-			{$fronter = '      ';}
-
-		$G = '';		$EG = '';
-		$G=""; $EG='';
-	#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
-	#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-
-		echo "| $G$extension[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-		echo "  $i agentes identificados en el servidor $server_ip\n\n";
-
-	#	echo "             - Llamadas de 5 minutos o más\n";
-	#	echo "             - Sobre 10 minutos en llamada\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "*********************************AGENTES SIN LLAMADAS*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-#echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-echo "| CHANNEL             | STATUS | CAMPAIGN     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-19s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 19) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 19) {$cc=101;}
-			}
-		$start_time =		sprintf("%-8s", $row[5]);
-			$cd=0;
-		while ( (strlen($start_time) > 8) and ($cd < 100) )
-			{
-			$start_time = eregi_replace("^.","",$start_time);   
-			$cd++;
-			if (strlen($start_time) <= 8) {$cd=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-12s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-		echo "  $i llamadas en el servidor $server_ip\n\n";
-
-		echo "             - LLAMADAS ACTUALES EN ESPERA\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "*******************************LLAMADAS EN ESPERA*********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/AST_timeonVDADall.php b/LANG_admin/vicidial_es/AST_timeonVDADall.php deleted file mode 100644 index 428c8d56..00000000 --- a/LANG_admin/vicidial_es/AST_timeonVDADall.php +++ /dev/null @@ -1,349 +0,0 @@ - LICENSE: GPLv2 -# -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60511-1343 - Added leads and drop info at the top of the screen -# 60608-1539 - Fixed CLOSER tallies for active calls -# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -if (!isset($group)) {$group='';} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -$rslt=mysql_query($stmt, $link); -if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!isset($RR)) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if (!isset($reset_counter)) {$reset_counter=0;} -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaña: $group\n"; -echo "
\n"; -echo "VICIDIAL: Realtime Campaña: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFICAR | INFORMES \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$HOPlev = $row[8]; - -echo "
"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$VDhop = $row[0]; - -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
DIAL LEVEL:  $row[0]    STATUSES:  $row[1], $row[2], $row[3], $row[4], $row[5]     ORDER:  $row[6]     FILTER:  $row[7]    
HOPPER LEVEL:  $HOPlev     LEADS IN HOPPER:  $VDhop     DIALABLE LEADS:  $DAleads       TIME:
CALLS TODAY:  $callsTODAY     CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
"; - - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; - } -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo "LLAMADAS EN ESPERA\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaña: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVIDOR IP | CALL SERVIDOR IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n\n"; - - $Aecho .= " - Agentes detenidos brevemente\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo "AGENTES SIN LLAMADAS\n";
-	}
-
-?>
-
- - diff --git a/LANG_admin/vicidial_es/AST_timeonVDADall_SIPmonitor.php b/LANG_admin/vicidial_es/AST_timeonVDADall_SIPmonitor.php deleted file mode 100644 index 27281fb1..00000000 --- a/LANG_admin/vicidial_es/AST_timeonVDADall_SIPmonitor.php +++ /dev/null @@ -1,301 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$ENVIAR=$_GET["ENVIAR"]; if (!$ENVIAR) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VF DIALER: Time On VDAD Campaña: $group\n"; -echo "
\n"; -echo "VF DIALER: Realtime Campaña: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFICAR | INFORMES \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo "LLAMADAS EN ESPERA\n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Campaña: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVIDOR IP | CALL SERVIDOR IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTERN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Agentes detenidos brevemente\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo "AGENTES SIN LLAMADAS\n";
-	}
-
-?>
-
- - - - - - - diff --git a/LANG_admin/vicidial_es/AST_timeoncall.php b/LANG_admin/vicidial_es/AST_timeoncall.php deleted file mode 100644 index c417350c..00000000 --- a/LANG_admin/vicidial_es/AST_timeoncall.php +++ /dev/null @@ -1,180 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Call\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Call                                          $NOW_TIME\n\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-echo "| STATION    | SESSIONID | CHANNEL   | NUMBER DIALED    | START TIME          | MINUTES |\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-
-$stmt="SELECT count(*) from live_sip_channels where server_ip='$server_ip';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="select extension from live_channels where server_ip='$server_ip';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$ext_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_zap_counter=0;
-	$sessions = '';
-	while ($i < $ext_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if (preg_match("/^8600/i",$row[0]))
-			{
-			$sessions .= "$row[0]|";
-			}
-		$i++;
-		}
-	$sessions = preg_replace("/\|$/",'',$sessions);
-
-	if ($DB) {echo "SESSIONS: -$sessions-\n";}
-
-	$stmt="select * from live_sip_channels where server_ip='$server_ip' order by channel;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_calls_counter=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ( (preg_match("/Zap\/|internal|ring/i",$row[3])) or (preg_match("/Local\//i",$row[0])) )
-			{
-			if ($DB) {echo "NOT STATION |$row[0]|$row[3]|\n";}
-			$session_id = '';
-			}
-		else 
-			{
-			if (preg_match("/$row[3]/i",$sessions))
-				{
-				if ($DB) {echo "LIVE STATION|$row[0]|$row[3]|\n";}
-				$session_id = $row[3];
-				$station = preg_replace("/SIP\//",'',$row[0]);
-				$station = preg_replace("/-.*/",'',$station);
-			
-				$LIVE_sessions[$live_calls_counter] =			"$session_id";
-				$LIVE_sessions_FORMAT[$live_calls_counter] =	sprintf("%-9s", $session_id);
-				$LIVE_stations[$live_calls_counter] =			"$station";
-				$LIVE_stations_FORMAT[$live_calls_counter] =	sprintf("%-10s", $station);
-
-		#		echo "| $station | $session_id | \n";
-
-				$live_calls_counter++;
-				}
-			else
-				{
-				if ($DB) {echo "NOT STATIONZ|$row[0]|$row[3]|\n";}
-				$session_id = '';
-				}
-			}
-
-		$i++;
-		}
-
-		if ($live_calls_counter > 0)
-		{
-		$i=0;
-		$LC_counter = $live_calls_counter;
-
-		while ($i < $live_calls_counter)
-			{
-			$stmt="select channel,extension,number_dialed,start_time,start_epoch from call_log where extension='$LIVE_stations[$i]' and server_ip='$server_ip' order by uniqueid desc LIMIT 1;";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$parked_to_print = mysql_num_rows($rslt);
-			$row=mysql_fetch_row($rslt);
-
-			$channel =			sprintf("%-9s", $row[0]);
-			$number_dialed =	sprintf("%-16s", $row[2]);
-			$start_time =		sprintf("%-19s", $row[3]);
-			$call_time_S = ($STARTtime - $row[4]);
-
-			$call_time_M = ($call_time_S / 60);
-			$call_time_M = round($call_time_M, 2);
-			$call_time_M_int = intval("$call_time_M");
-			$call_time_SEC = ($call_time_M - $call_time_M_int);
-			$call_time_SEC = ($call_time_SEC * 60);
-			$call_time_SEC = round($call_time_SEC, 0);
-			if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-			$call_time_MS = "$call_time_M_int:$call_time_SEC";
-			$call_time_MS =		sprintf("%7s", $call_time_MS);
-			$G = '';		$EG = '';
-			if ($call_time_M_int >= 12) {$G=''; $EG='';}
-			if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-			echo "| $G$LIVE_stations_FORMAT[$i]$EG | $G$LIVE_sessions_FORMAT[$i]$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-			$i++;
-			}
-
-		echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-		echo "  $i stations on live calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on live call\n";
-		echo "             - Over 30 minutes on live call\n";
-
-		}
-		else
-		{
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*************************************** NO LIVE STATIONS ********************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		}
-
-	}
-	else
-	{
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*************************************** NO LIVE STATIONS ********************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	}
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/AST_timeonpark.php b/LANG_admin/vicidial_es/AST_timeonpark.php deleted file mode 100644 index d098a8a4..00000000 --- a/LANG_admin/vicidial_es/AST_timeonpark.php +++ /dev/null @@ -1,197 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$timeONEhoursAGO = ($STARTtime - 3600); -$epochHALFhoursAGO = ($STARTtime - 1860); -$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO); -$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - $stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Park\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Park                       $NOW_TIME\n\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 1) {$G=''; $EG='';}
-		if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+-----------------+---------------------+---------+\n";
-		echo "  $i callers waiting on server $server_ip\n\n";
-
-		echo "             - 1 minute or more on hold\n";
-		echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	echo "********************LLAMADAS EN ESPERA*********************\n";
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	}
-
-###################################################################################
-###### TIME ON INBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Agents Time On Inbound Calls                             $NOW_TIME\n\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-echo "| STATION    | USER   | CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='$server_ip' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 12) {$G=''; $EG='';}
-		if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-		echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-		echo "  $i agents on calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on call\n";
-		echo "             - Over 30 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "*********************************AGENTES SIN LLAMADAS*********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/admin.php b/LANG_admin/vicidial_es/admin.php deleted file mode 100644 index 558e011c..00000000 --- a/LANG_admin/vicidial_es/admin.php +++ /dev/null @@ -1,6514 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["user_level"])) {$user_level=$_GET["user_level"];} - elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];} -if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} - elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["campaign_name"])) {$campaign_name=$_GET["campaign_name"];} - elseif (isset($_POST["campaign_name"])) {$campaign_name=$_POST["campaign_name"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["park_ext"])) {$park_ext=$_GET["park_ext"];} - elseif (isset($_POST["park_ext"])) {$park_ext=$_POST["park_ext"];} -if (isset($_GET["park_file_name"])) {$park_file_name=$_GET["park_file_name"];} - elseif (isset($_POST["park_file_name"])) {$park_file_name=$_POST["park_file_name"];} -if (isset($_GET["web_form_address"])) {$web_form_address=$_GET["web_form_address"];} - elseif (isset($_POST["web_form_address"])) {$web_form_address=$_POST["web_form_address"];} -if (isset($_GET["allow_closers"])) {$allow_closers=$_GET["allow_closers"];} - elseif (isset($_POST["allow_closers"])) {$allow_closers=$_POST["allow_closers"];} -if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} - elseif (isset($_POST["hopper_level"])) {$hopper_level=$_POST["hopper_level"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["next_agent_call"])) {$next_agent_call=$_GET["next_agent_call"];} - elseif (isset($_POST["next_agent_call"])) {$next_agent_call=$_POST["next_agent_call"];} -if (isset($_GET["local_call_time"])) {$local_call_time=$_GET["local_call_time"];} - elseif (isset($_POST["local_call_time"])) {$local_call_time=$_POST["local_call_time"];} -if (isset($_GET["voicemail_ext"])) {$voicemail_ext=$_GET["voicemail_ext"];} - elseif (isset($_POST["voicemail_ext"])) {$voicemail_ext=$_POST["voicemail_ext"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} - elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} -if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} - elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["group_color"])) {$group_color=$_GET["group_color"];} - elseif (isset($_POST["group_color"])) {$group_color=$_POST["group_color"];} -if (isset($_GET["fronter_display"])) {$fronter_display=$_GET["fronter_display"];} - elseif (isset($_POST["fronter_display"])) {$fronter_display=$_POST["fronter_display"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["dial_status_a"])) {$dial_status_a=$_GET["dial_status_a"];} - elseif (isset($_POST["dial_status_a"])) {$dial_status_a=$_POST["dial_status_a"];} -if (isset($_GET["dial_status_b"])) {$dial_status_b=$_GET["dial_status_b"];} - elseif (isset($_POST["dial_status_b"])) {$dial_status_b=$_POST["dial_status_b"];} -if (isset($_GET["dial_status_c"])) {$dial_status_c=$_GET["dial_status_c"];} - elseif (isset($_POST["dial_status_c"])) {$dial_status_c=$_POST["dial_status_c"];} -if (isset($_GET["dial_status_d"])) {$dial_status_d=$_GET["dial_status_d"];} - elseif (isset($_POST["dial_status_d"])) {$dial_status_d=$_POST["dial_status_d"];} -if (isset($_GET["dial_status_e"])) {$dial_status_e=$_GET["dial_status_e"];} - elseif (isset($_POST["dial_status_e"])) {$dial_status_e=$_POST["dial_status_e"];} -if (isset($_GET["lead_order"])) {$lead_order=$_GET["lead_order"];} - elseif (isset($_POST["lead_order"])) {$lead_order=$_POST["lead_order"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["campaign_vdad_exten"])) {$campaign_vdad_exten=$_GET["campaign_vdad_exten"];} - elseif (isset($_POST["campaign_vdad_exten"])) {$campaign_vdad_exten=$_POST["campaign_vdad_exten"];} -if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec_exten"];} - elseif (isset($_POST["campaign_rec_exten"])) {$campaign_rec_exten=$_POST["campaign_rec_exten"];} -if (isset($_GET["campaign_recording"])) {$campaign_recording=$_GET["campaign_recording"];} - elseif (isset($_POST["campaign_recording"])) {$campaign_recording=$_POST["campaign_recording"];} -if (isset($_GET["campaign_rec_filename"])) {$campaign_rec_filename=$_GET["campaign_rec_filename"];} - elseif (isset($_POST["campaign_rec_filename"])) {$campaign_rec_filename=$_POST["campaign_rec_filename"];} -if (isset($_GET["hotkey"])) {$hotkey=$_GET["hotkey"];} - elseif (isset($_POST["hotkey"])) {$hotkey=$_POST["hotkey"];} -if (isset($_GET["reset_list"])) {$reset_list=$_GET["reset_list"];} - elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} -if (isset($_GET["old_campaign_id"])) {$old_campaign_id=$_GET["old_campaign_id"];} - elseif (isset($_POST["old_campaign_id"])) {$old_campaign_id=$_POST["old_campaign_id"];} -if (isset($_GET["OLDuser_group"])) {$OLDuser_group=$_GET["OLDuser_group"];} - elseif (isset($_POST["OLDuser_group"])) {$OLDuser_group=$_POST["OLDuser_group"];} -if (isset($_GET["status_name"])) {$status_name=$_GET["status_name"];} - elseif (isset($_POST["status_name"])) {$status_name=$_POST["status_name"];} -if (isset($_GET["selectable"])) {$selectable=$_GET["selectable"];} - elseif (isset($_POST["selectable"])) {$selectable=$_POST["selectable"];} -if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} - elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["delete_users"])) {$delete_users=$_GET["delete_users"];} - elseif (isset($_POST["delete_users"])) {$delete_users=$_POST["delete_users"];} -if (isset($_GET["delete_user_groups"])) {$delete_user_groups=$_GET["delete_user_groups"];} - elseif (isset($_POST["delete_user_groups"])) {$delete_user_groups=$_POST["delete_user_groups"];} -if (isset($_GET["delete_lists"])) {$delete_lists=$_GET["delete_lists"];} - elseif (isset($_POST["delete_lists"])) {$delete_lists=$_POST["delete_lists"];} -if (isset($_GET["delete_campaigns"])) {$delete_campaigns=$_GET["delete_campaigns"];} - elseif (isset($_POST["delete_campaigns"])) {$delete_campaigns=$_POST["delete_campaigns"];} -if (isset($_GET["delete_ingroups"])) {$delete_ingroups=$_GET["delete_ingroups"];} - elseif (isset($_POST["delete_ingroups"])) {$delete_ingroups=$_POST["delete_ingroups"];} -if (isset($_GET["delete_remote_agents"])) {$delete_remote_agents=$_GET["delete_remote_agents"];} - elseif (isset($_POST["delete_remote_agents"])) {$delete_remote_agents=$_POST["delete_remote_agents"];} -if (isset($_GET["load_leads"])) {$load_leads=$_GET["load_leads"];} - elseif (isset($_POST["load_leads"])) {$load_leads=$_POST["load_leads"];} -if (isset($_GET["campaign_detail"])) {$campaign_detail=$_GET["campaign_detail"];} - elseif (isset($_POST["campaign_detail"])) {$campaign_detail=$_POST["campaign_detail"];} -if (isset($_GET["ast_admin_access"])) {$ast_admin_access=$_GET["ast_admin_access"];} - elseif (isset($_POST["ast_admin_access"])) {$ast_admin_access=$_POST["ast_admin_access"];} -if (isset($_GET["ast_delete_phones"])) {$ast_delete_phones=$_GET["ast_delete_phones"];} - elseif (isset($_POST["ast_delete_phones"])) {$ast_delete_phones=$_POST["ast_delete_phones"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} -if (isset($_GET["delete_scripts"])) {$delete_scripts=$_GET["delete_scripts"];} - elseif (isset($_POST["delete_scripts"])) {$delete_scripts=$_POST["delete_scripts"];} -if (isset($_GET["script_id"])) {$script_id=$_GET["script_id"];} - elseif (isset($_POST["script_id"])) {$script_id=$_POST["script_id"];} -if (isset($_GET["script_name"])) {$script_name=$_GET["script_name"];} - elseif (isset($_POST["script_name"])) {$script_name=$_POST["script_name"];} -if (isset($_GET["script_comments"])) {$script_comments=$_GET["script_comments"];} - elseif (isset($_POST["script_comments"])) {$script_comments=$_POST["script_comments"];} -if (isset($_GET["script_text"])) {$script_text=$_GET["script_text"];} - elseif (isset($_POST["script_text"])) {$script_text=$_POST["script_text"];} -if (isset($_GET["reset_hopper"])) {$reset_hopper=$_GET["reset_hopper"];} - elseif (isset($_POST["reset_hopper"])) {$reset_hopper=$_POST["reset_hopper"];} -if (isset($_GET["get_call_launch"])) {$get_call_launch=$_GET["get_call_launch"];} - elseif (isset($_POST["get_call_launch"])) {$get_call_launch=$_POST["get_call_launch"];} -if (isset($_GET["am_message_exten"])) {$am_message_exten=$_GET["am_message_exten"];} - elseif (isset($_POST["am_message_exten"])) {$am_message_exten=$_POST["am_message_exten"];} -if (isset($_GET["amd_send_to_vmx"])) {$amd_send_to_vmx=$_GET["amd_send_to_vmx"];} - elseif (isset($_POST["amd_send_to_vmx"])) {$amd_send_to_vmx=$_POST["amd_send_to_vmx"];} -if (isset($_GET["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_GET["xferconf_a_dtmf"];} - elseif (isset($_POST["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_POST["xferconf_a_dtmf"];} -if (isset($_GET["xferconf_a_number"])) {$xferconf_a_number=$_GET["xferconf_a_number"];} - elseif (isset($_POST["xferconf_a_number"])) {$xferconf_a_number=$_POST["xferconf_a_number"];} -if (isset($_GET["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_GET["xferconf_b_dtmf"];} - elseif (isset($_POST["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_POST["xferconf_b_dtmf"];} -if (isset($_GET["xferconf_b_number"])) {$xferconf_b_number=$_GET["xferconf_b_number"];} - elseif (isset($_POST["xferconf_b_number"])) {$xferconf_b_number=$_POST["xferconf_b_number"];} -if (isset($_GET["modify_leads"])) {$modify_leads=$_GET["modify_leads"];} - elseif (isset($_POST["modify_leads"])) {$modify_leads=$_POST["modify_leads"];} -if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} - elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} -if (isset($_GET["change_agent_campaign"])) {$change_agent_campaign=$_GET["change_agent_campaign"];} - elseif (isset($_POST["change_agent_campaign"])) {$change_agent_campaign=$_POST["change_agent_campaign"];} -if (isset($_GET["agent_choose_ingroups"])) {$agent_choose_ingroups=$_GET["agent_choose_ingroups"];} - elseif (isset($_POST["agent_choose_ingroups"])) {$agent_choose_ingroups=$_POST["agent_choose_ingroups"];} -if (isset($_GET["alt_number_dialing"])) {$alt_number_dialing=$_GET["alt_number_dialing"];} - elseif (isset($_POST["alt_number_dialing"])) {$alt_number_dialing=$_POST["alt_number_dialing"];} -if (isset($_GET["scheduled_callbacks"])) {$scheduled_callbacks=$_GET["scheduled_callbacks"];} - elseif (isset($_POST["scheduled_callbacks"])) {$scheduled_callbacks=$_POST["scheduled_callbacks"];} -if (isset($_GET["lead_filter_id"])) {$lead_filter_id=$_GET["lead_filter_id"];} - elseif (isset($_POST["lead_filter_id"])) {$lead_filter_id=$_POST["lead_filter_id"];} -if (isset($_GET["lead_filter_name"])) {$lead_filter_name=$_GET["lead_filter_name"];} - elseif (isset($_POST["lead_filter_name"])) {$lead_filter_name=$_POST["lead_filter_name"];} -if (isset($_GET["lead_filter_comments"])) {$lead_filter_comments=$_GET["lead_filter_comments"];} - elseif (isset($_POST["lead_filter_comments"])) {$lead_filter_comments=$_POST["lead_filter_comments"];} -if (isset($_GET["lead_filter_sql"])) {$lead_filter_sql=$_GET["lead_filter_sql"];} - elseif (isset($_POST["lead_filter_sql"])) {$lead_filter_sql=$_POST["lead_filter_sql"];} -if (isset($_GET["agentonly_callbacks"])) {$agentonly_callbacks=$_GET["agentonly_callbacks"];} - elseif (isset($_POST["agentonly_callbacks"])) {$agentonly_callbacks=$_POST["agentonly_callbacks"];} -if (isset($_GET["agentcall_manual"])) {$agentcall_manual=$_GET["agentcall_manual"];} - elseif (isset($_POST["agentcall_manual"])) {$agentcall_manual=$_POST["agentcall_manual"];} -if (isset($_GET["vicidial_recording"])) {$vicidial_recording=$_GET["vicidial_recording"];} - elseif (isset($_POST["vicidial_recording"])) {$vicidial_recording=$_POST["vicidial_recording"];} -if (isset($_GET["vicidial_transfers"])) {$vicidial_transfers=$_GET["vicidial_transfers"];} - elseif (isset($_POST["vicidial_transfers"])) {$vicidial_transfers=$_POST["vicidial_transfers"];} -if (isset($_GET["delete_filters"])) {$delete_filters=$_GET["delete_filters"];} - elseif (isset($_POST["delete_filters"])) {$delete_filters=$_POST["delete_filters"];} -if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_options=$_GET["alter_agent_interface_options"];} - elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];} -if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];} - elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];} -if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];} - elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];} -if (isset($_GET["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} -if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];} - elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];} -if (isset($_GET["drop_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} -if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];} - elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];} -if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];} - elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];} -if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];} - elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];} -if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];} - elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];} -if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];} - elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];} -if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];} - elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];} -if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];} - elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];} -if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];} - elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];} -if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];} - elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];} -if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];} - elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];} -if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];} - elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];} -if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];} - elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];} -if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];} - elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];} -if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];} - elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];} -if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];} - elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];} -if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];} - elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];} -if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];} - elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];} -if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];} - elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];} -if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];} - elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];} -if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];} - elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];} -if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];} - elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];} -if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];} - elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];} -if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];} - elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];} -if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];} - elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];} -if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];} - elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} -if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} - elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} -if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} - elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} -if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} - elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} - - if (isset($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS ONLY ### -$user_level = ereg_replace("[^0-9]","",$user_level); -$wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); -$drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); -$am_message_exten = ereg_replace("[^0-9]","",$am_message_exten); -$campaign_rec_exten = ereg_replace("[^0-9]","",$campaign_rec_exten); -$campaign_vdad_exten = ereg_replace("[^0-9]","",$campaign_vdad_exten); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); -$dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); -$park_ext = ereg_replace("[^0-9]","",$park_ext); -$hopper_level = ereg_replace("[^0-9]","",$hopper_level); -$agent_choose_ingroups = ereg_replace("[^0-9]","",$agent_choose_ingroups); -$hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); -$agentonly_callbacks = ereg_replace("[^0-9]","",$agentonly_callbacks); -$agentcall_manual = ereg_replace("[^0-9]","",$agentcall_manual); -$vicidial_recording = ereg_replace("[^0-9]","",$vicidial_recording); -$vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); -$closer_default_blended = ereg_replace("[^0-9]","",$closer_default_blended); -$alter_agent_interface_options = ereg_replace("[^0-9]","",$alter_agent_interface_options); -$delete_users = ereg_replace("[^0-9]","",$delete_users); -$delete_user_groups = ereg_replace("[^0-9]","",$delete_user_groups); -$delete_scripts = ereg_replace("[^0-9]","",$delete_scripts); -$delete_remote_agents = ereg_replace("[^0-9]","",$delete_remote_agents); -$delete_lists = ereg_replace("[^0-9]","",$delete_lists); -$delete_ingroups = ereg_replace("[^0-9]","",$delete_ingroups); -$delete_filters = ereg_replace("[^0-9]","",$delete_filters); -$delete_campaigns = ereg_replace("[^0-9]","",$delete_campaigns); -$delete_call_times = ereg_replace("[^0-9]","",$delete_call_times); -$load_leads = ereg_replace("[^0-9]","",$delete_call_times); -$campaign_detail = ereg_replace("[^0-9]","",$campaign_detail); -$ast_delete_phones = ereg_replace("[^0-9]","",$ast_delete_phones); -$ast_admin_access = ereg_replace("[^0-9]","",$ast_admin_access); -$modify_leads = ereg_replace("[^0-9]","",$modify_leads); -$change_agent_campaign = ereg_replace("[^0-9]","",$change_agent_campaign); -$modify_call_times = ereg_replace("[^0-9]","",$modify_call_times); -$ct_wednesday_stop = ereg_replace("[^0-9]","",$ct_wednesday_stop); -$ct_wednesday_start = ereg_replace("[^0-9]","",$ct_wednesday_start); -$ct_tuesday_stop = ereg_replace("[^0-9]","",$ct_tuesday_stop); -$ct_tuesday_start = ereg_replace("[^0-9]","",$ct_tuesday_start); -$ct_thursday_stop = ereg_replace("[^0-9]","",$ct_thursday_stop); -$ct_thursday_start = ereg_replace("[^0-9]","",$ct_thursday_start); -$ct_sunday_stop = ereg_replace("[^0-9]","",$ct_sunday_stop); -$ct_sunday_start = ereg_replace("[^0-9]","",$ct_sunday_start); -$ct_saturday_stop = ereg_replace("[^0-9]","",$ct_saturday_stop); -$ct_saturday_start = ereg_replace("[^0-9]","",$ct_saturday_start); -$ct_monday_stop = ereg_replace("[^0-9]","",$ct_monday_stop); -$ct_monday_start = ereg_replace("[^0-9]","",$ct_monday_start); -$ct_friday_stop = ereg_replace("[^0-9]","",$ct_friday_stop); -$ct_friday_start = ereg_replace("[^0-9]","",$ct_friday_start); -$ct_default_stop = ereg_replace("[^0-9]","",$ct_default_stop); -$ct_default_start = ereg_replace("[^0-9]","",$ct_default_start); -$number_of_lines = ereg_replace("[^0-9]","",$number_of_lines); -$user_start = ereg_replace("[^0-9]","",$user_start); -$phone_number = ereg_replace("[^0-9]","",$phone_number); -$remote_agent_id = ereg_replace("[^0-9]","",$remote_agent_id); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); -$attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); -$hotkey = ereg_replace("[^0-9]","",$hotkey); -$list_id = ereg_replace("[^0-9]","",$list_id); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); -$allow_closers = ereg_replace("[^NY]","",$allow_closers); -$reset_hopper = ereg_replace("[^NY]","",$reset_hopper); -$amd_send_to_vmx = ereg_replace("[^NY]","",$amd_send_to_vmx); -$alt_number_dialing = ereg_replace("[^NY]","",$alt_number_dialing); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); -$selectable = ereg_replace("[^NY]","",$selectable); -$reset_list = ereg_replace("[^NY]","",$reset_list); -$fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); -$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); - -### ALPHA-NUMERIC ONLY ### -$user = ereg_replace("[^0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^0-9a-zA-Z]","",$pass); -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); -$submit = ereg_replace("[^0-9a-zA-Z]","",$submit); -$CoNfIrM = ereg_replace("[^0-9a-zA-Z]","",$CoNfIrM); -$campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid); -$get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch); -$campaign_recording = ereg_replace("[^0-9a-zA-Z]","",$campaign_recording); -$ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD); -$dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix); -$state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state); -$scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); - -### DIGITS and Dots -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); - -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); - -### ALPHA-NUMERIC and underscore and dash -$dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); -$dial_status_d = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_d); -$dial_status_c = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_c); -$dial_status_b = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_b); -$dial_status_a = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_a); -$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage); -$lead_filter_id = ereg_replace("[^-\_0-9a-zA-Z]","",$lead_filter_id); -$campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id); -$old_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_campaign_id); -$park_file_name = ereg_replace("[^-\_0-9a-zA-Z]","",$park_file_name); -$next_agent_call = ereg_replace("[^-\_0-9a-zA-Z]","",$next_agent_call); -$local_call_time = ereg_replace("[^-\_0-9a-zA-Z]","",$local_call_time); -$call_time_id = ereg_replace("[^-\_0-9a-zA-Z]","",$call_time_id); -$phone_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_pass); -$phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); -$group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); -$user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); -$OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); -$state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); - -### ALPHA-NUMERIC and spaces -$lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); -### ALPHA-NUMERIC and hash -$group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); -$campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); -$status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); -$HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); -$status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); -$script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); -$script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); -$list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); -$lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); -$lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); -$campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); -$call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); -$call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - -### remove semi-colons ### -$lead_filter_sql = ereg_replace(";","",$lead_filter_sql); - -### VARIABLES TO BE mysql_real_escape_string ### -# $web_form_address -# $script_text - -##### END VARIABLE FILTERING FOR SECURITY ##### - - -# AST GUI database administration -# admin.php -# -# CHANGES -# 50315-1110 - Added Custom Campaign Statuses -# 50317-1438 - Added Fronter Display var to inbound groups -# 50322-1355 - Added custom callerID per campaign -# 50517-1356 - Added user_groups sections and user_group to vicidial_users -# 50517-1440 - Added ability to logout (must click OK with empty user/pass) -# 50602-1622 - Added lead loader pages to load new files into vicidial_list -# 50620-1351 - Added custom vdad transfer AGI extension per campaign -# 50810-1414 - modified in groups to kick out spaces and dashes -# 50908-2136 - Added Custom Campaign HotKeys -# 50914-0950 - Fixed user search by user_group -# 50926-1358 - Modified to allow for language translation -# 50926-1615 - Added WeBRooTWritablE write controls -# 51020-1008 - Added editable web address and park ext - NEW dial campaigns -# 51020-1056 - Added fields and help for campaign recording control -# 51123-1335 - Altered code to function in php globals=off -# 51208-1038 - Added user_level changes, function controls and default user phones -# 51208-1556 - Added deletion of users/lists/campaigns/in groups/remote agents -# 51213-1706 - Added add/delete/modify vicidial scripts -# 51214-1737 - Added preview of vicidial script in popup window -# 51219-1225 - Added campaign and ingroups script selector and get_call_launch field -# 51222-1055 - Added am_message_exten to campaigns to allow for AM Message button -# 51222-1125 - Fixed new vicidial_campaigns default values not being assigned bug -# 51222-1156 - Added LOG OUT ALL AGENTS ON THIS CAMPAIGN button to campaign screen -# 60204-0659 - Fixed hopper reset bug -# 60207-1413 - Added AMD send to voicemail extension and xfer-conf dtmf presets -# 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 -# 60417-1416 - Added vicidial_lead_filters sections -# - Changed the header links to color-coded sectional with sublinks below -# - Added filter name and script name to campaign and in-group modify sections -# - Added callback and alt dial options to campaigns section -# - Added callback, alt dial and other options to users section -# 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered -# 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60425-2355 - Added agent options to vicidial_users, reformatted user page -# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen -# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen -# 60505-1117 - Added initial framework for new local_call_times tables and definitions -# 60506-1033 - More revisions to the local_call_time section -# 60508-1354 - Finished call_times and state_call_times sections -# - Added modify/delete options for call_times -# 60509-1311 - Functionalize campaign dialable leads calculation -# - Change state_call_times selection from call_times to only allow one per state -# - Added dialable leads count popup to campaign screen if auto-calc is disabled -# - Added test dialable leads count popup to filter screen -# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen -# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen -# 60609-1051 - Added add-to-dnc in LISTS section -# 60613-1415 - Added lead recycling options to campaign detail screen -# 60619-1523 - Added variable filtering to eliminate SQL injection attack threat -# 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug -# - -# 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.12-3'; -$build = '60623-1159'; - -$STARTtime = date("U"); - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Usted ahora ha salido. Gracias\n"; - exit; -} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGuser_level =$row[4]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN: "; - -if (!isset($ADD)) {$ADD=0;} - -if ($ADD==1) {$hh='users'; echo "Añadir un Usuario";} -if ($ADD==11) {$hh='campaigns'; echo "Añadir una Campaña";} -if ($ADD==111) {$hh='lists'; echo "Añadir una Lista";} -if ($ADD==121) {$hh='lists'; echo "Agregue DNC Nuevo";} -if ($ADD==1111) {$hh='ingroups'; echo "Añadir un Grupo-Entrantes";} -if ($ADD==11111) {$hh='remoteagent'; echo "Añadir Agentes Remotos";} -if ($ADD==111111) {$hh='usergroups'; echo "Añadir un Grupo De Usuarios";} -if ($ADD==1111111) {$hh='scripts'; echo "Agregue La Nueva Escritura";} -if ($ADD==11111111) {$hh='filters'; echo "Agregue El Filtro Nuevo";} -if ($ADD==111111111) {$hh='times'; echo "Agregue El Nuevo Tiempo De la Llamada";} -if ($ADD==1111111111) {$hh='times'; echo "Agregue El Nuevo Tiempo De la Llamada Del Estado";} -if ($ADD==2) {$hh='users'; echo "Nueva Adición De Usuario";} -if ($ADD==21) {$hh='campaigns'; echo "Nueva Adición De la Campaña";} -if ($ADD==22) {$hh='campaigns'; echo "Nueva Adición Del Estado De la Campaña";} -if ($ADD==23) {$hh='campaigns'; echo "Nueva Adición De Tecla De Acceso Directo De la Campaña";} -if ($ADD==25) {$hh='campaigns'; echo "El Nuevo Plomo De la Campaña Recicla La Adición";} -if ($ADD==211) {$hh='lists'; echo "Nueva Adición De la Lista";} -if ($ADD==2111) {$hh='ingroups'; echo "Nueva Adición Del Grupo de Entrantes";} -if ($ADD==21111) {$hh='remoteagent'; echo "Nueva Adición de Agentes Remotos";} -if ($ADD==211111) {$hh='usergroups'; echo "Nueva Adición Del Grupo De Usuarios";} -if ($ADD==2111111) {$hh='scripts'; echo "Nueva Adición De la Escritura";} -if ($ADD==21111111) {$hh='filters'; echo "Nueva Adición Del Filtro";} -if ($ADD==211111111) {$hh='times'; echo "Nueva Adición Del Tiempo De la Llamada";} -if ($ADD==2111111111) {$hh='times'; echo "Nueva Adición Del Tiempo De la Llamada Del Estado";} -if ($ADD==3) {$hh='users'; echo "Modificar Usuario";} -if ($ADD==31) {$hh='campaigns'; echo "Modifcar Campaña";} -if ($ADD==34) {$hh='campaigns'; echo "Modificar Campaña - Vista Básica";} -if ($ADD==311) {$hh='lists'; echo "Modificar Lista";} -if ($ADD==3111) {$hh='ingroups'; echo "Modificar In-Group";} -if ($ADD==31111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} -if ($ADD==311111) {$hh='usergroups'; echo "Modificar Grupos De Usuarios";} -if ($ADD==3111111) {$hh='scripts'; echo "Modifique La Escritura";} -if ($ADD==31111111) {$hh='filters'; echo "Modifique El Filtro";} -if ($ADD==311111111) {$hh='times'; echo "Modifique El Tiempo De la Llamada";} -if ($ADD==321111111) {$hh='times'; echo "Modifique La Lista De las Definiciones Del Estado Del Tiempo De laLlamada";} -if ($ADD==3111111111) {$hh='times'; echo "Modifique El Tiempo De la Llamada Del Estado";} -if ($ADD=="4A") {$hh='users'; echo "Modificar Usuario - Admin";} -if ($ADD=="4B") {$hh='users'; echo "Modificar Usuario - Admin";} -if ($ADD==4) {$hh='users'; echo "Modificar Usuario";} -if ($ADD==41) {$hh='campaigns'; echo "Modifcar Campaña";} -if ($ADD==42) {$hh='campaigns'; echo "Modifcar Campaña Status";} -if ($ADD==43) {$hh='campaigns'; echo "Modifcar Campaña HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Modificar Campaña - Vista Básica";} -if ($ADD==45) {$hh='campaigns'; echo "Modifique El Plomo De la Campaña Reciclan";} -if ($ADD==411) {$hh='lists'; echo "Modificar Lista";} -if ($ADD==4111) {$hh='ingroups'; echo "Modificar In-Group";} -if ($ADD==41111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} -if ($ADD==411111) {$hh='usergroups'; echo "Modificar Grupos De Usuarios";} -if ($ADD==4111111) {$hh='scripts'; echo "Modifique La Escritura";} -if ($ADD==41111111) {$hh='filters'; echo "Modifique El Filtro";} -if ($ADD==411111111) {$hh='times'; echo "Modifique El Tiempo De la Llamada";} -if ($ADD==4111111111) {$hh='times'; echo "Modifique El Tiempo De la Llamada Del Estado";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Campaña";} -if ($ADD==52) {$hh='campaigns'; echo "Agentes Del Registro de estado de la máquina";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==51111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} -if ($ADD==511111) {$hh='usergroups'; echo "Usuarios de la cancelación Group";} -if ($ADD==5111111) {$hh='scripts'; echo "Escritura De la Cancelación";} -if ($ADD==51111111) {$hh='filters'; echo "Filtro De la Cancelación";} -if ($ADD==511111111) {$hh='times'; echo "Delete Call Time";} -if ($ADD==5111111111) {$hh='times'; echo "Tiempo De la Llamada Del Estado De la Cancelación";} -if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Campaña";} -if ($ADD==62) {$hh='campaigns'; echo "Agentes Del Registro de estado de la máquina";} -if ($ADD==65) {$hh='campaigns'; echo "El Plomo De la Cancelación Recicla";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==61111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} -if ($ADD==611111) {$hh='usergroups'; echo "Usuarios de la cancelación Group";} -if ($ADD==6111111) {$hh='scripts'; echo "Escritura De la Cancelación";} -if ($ADD==61111111) {$hh='filters'; echo "Filtro De la Cancelación";} -if ($ADD==611111111) {$hh='times'; echo "Delete Call Time";} -if ($ADD==6111111111) {$hh='times'; echo "Tiempo De la Llamada Del Estado De la Cancelación";} -if ($ADD==73) {$hh='campaigns'; echo "Cuenta Del Plomo De Dialable";} -if ($ADD==7111111) {$hh='scripts'; echo "Escritura De la Inspección previo";} -if ($ADD==0) {$hh='users'; echo "Lista De Usuarios";} -if ($ADD==8) {$hh='users'; echo "Servicios repetidos Dentro Del Agente";} -if ($ADD==81) {$hh='campaigns'; echo "Servicios repetidos Dentro De la Campaña";} -if ($ADD==811) {$hh='campaigns'; echo "Servicios repetidos Dentro De la Lista";} -if ($ADD==10) {$hh='campaigns'; echo "Campañas";} -if ($ADD==100) {$hh='lists'; echo "Listas";} -if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} -if ($ADD==10000) {$hh='remoteagent'; echo "Agentes Remotos";} -if ($ADD==100000) {$hh='usergroups'; echo "Grupos De Usuario";} -if ($ADD==1000000) {$hh='scripts'; echo "Escrituras";} -if ($ADD==10000000) {$hh='filters'; echo "Filtros";} -if ($ADD==100000000) {$hh='times'; echo "Tiempos De la Llamada";} -if ($ADD==1000000000) {$hh='times'; echo "Tiempos De la Llamada Del Estado";} -if ($ADD==55) {$hh='users'; echo "Formulario De Búsqueda";} -if ($ADD==66) {$hh='users'; echo "RESULTADOS DE LA BÚSQUEDA";} -if ($ADD==99999) {$hh='users'; echo "AYUDA";} - -if ( ($ADD>9) && ($ADD < 99998) ) - { - ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $scripts_to_print = mysql_num_rows($rslt); - $scripts_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($scripts_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $scriptname_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - $filters_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($filters_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $filtername_list["$rowx[0]"] = "$rowx[1]"; - $filtersql_list["$rowx[0]"] = "$rowx[2]"; - $o++; - } - - ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $times_to_print = mysql_num_rows($rslt); - - $o=0; - while ($times_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $call_timename_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - } - -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD==31) or ($ADD==41) or ($ADD=="4A") or ($ADD=="4B") ) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ($ADD==31) - { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ($ADD==3) - { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) - { - if ($group_id_value == $groups[$p]) - { - $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; - } - $p++; - } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; - $o++; - } - if (strlen($groups_value)>2) {$groups_value .= " -";} - } - - - - - -$NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AYUDA\" ALIGN=TOP></A>"; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
VICIDIAL ADMIN: AYUDA


\n"; - -?> -VICIDIAL_USUARIOS TABLA

- -
-Identificación del usuario - este campo es donde usted pone el número de la identificación del usuario de VICIDIAL, puede ser hasta 8 dígitos en longitud, debe ser por lo menos 2 caracteres en longitud. - -
-
-
-Contraseña - este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. - -
-
-
-Nombre completo - este campo es donde usted pone el nombre completo de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. - -
-
-
-Nivel de usuario - este menú es donde usted selecciona el nivel de usuario de los usuarios de VICIDIAL. Debe ser un nivel de 1 a registrar en VICIDIAL, debe ser llano mayor de 2 a abrirse una sesión como más cercano, deben ser el nivel de usuario 8 o mayor conseguir en la sección de la tela del admin. - -
-
-
-Grupo de usuario - este menú es donde usted selecciona a grupo de usuarios de VICIDIAL que este usuario pertenecerá a. Esto no tiene ninguna restricciones en este tiempo, éste es justo subdividir a usuarios y permitir las características futuras basadas sobre él. - -
-
-
-Conexión del teléfono - aquí es para donde usted puede fijar un valor de la conexión del teléfono del defecto cuando los registros del usuario en vicidial.php. Este valor poblará el phone_login automáticamente cuando el usuario entra con su usuario-pasar-campaña en la pantalla de la conexión de vicidial.php. - -
-
-
-Paso del teléfono - aquí es para donde usted puede fijar un valor del paso del teléfono del defecto cuando los registros del usuario en vicidial.php. Este valor poblará los phone_pass automáticamente cuando el usuario entra con su usuario-pasar-campaña en la pantalla de la conexión de vicidial.php. - -
-
-
-HotKeys activo - esta opción si el sistema a 1 permite que el usuario utilice la función ra'pida-dispositioning de HotKeys adentro vicidial.php. - -
-
-
-El agente elige Ingroups - esta opción si el sistema a 1 permite que el usuario elija los ingroups de los cuales recibirán llamadas cuando ellos conexión a una campaña MÁS CERCANA o DE ENTRADA. Si no el encargado necesitará fijar esto en su pantalla del detalle del usuario de la página del admin. - -
-
-
-Grupos de entrada - aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. - -
-
-
-Servicios repetidos programar - esta opción no prohibe a agente a la disposición una llamada como CALLBK y elige los datos y el tiempo en los cuales el plomo será reactivado. - -
-
-
-Servicios repetidos del Agente-Solamente - esta opción permite que un agente fije un servicio repetido de modo que sean el único agente que puede llamar la parte posteriora del cliente. Esto también permite que el agente vea sus listados del servicio repetido y los llame detrás cualquier momento desean a. - -
-
-
-Manual de la llamada del agente - esta opción permite que un agente incorpore manualmente un nuevo plomo en el sistema y los llame. Esto también permite llamar de cualquier número de teléfono de su pantalla vicidial y pone esa llamada en su sesión. Utilice esta opción con la precaución. - -
-
-
-Grabación de Vicidial - esta opción puede evitar que un agente haga cualquier grabación después de que se abran una sesión a vicidial. Esta opción debe estar encendido para que vicidial siga la sesión de la grabación de la campaña. - -
-
-
-Vicidial transfiere - esta opción puede evitar que un agente abra la transferencia - la sesión de la conferencia de vicidial. Si esto es lisiado, el agente no puede llamada de los terceros o la transferencia oculta cualquiera llama. - -
-
-
-Un defecto más cercano mezclado - esta opción omite simplemente el checkbox mezclado en una pantalla MÁS CERCANA de la conexión. - -
-
-
-Altere las opciones de interfaz del agente - esta opción si el sistema a 1 permite que el usuario administrativo modifique las opciones de interfaz de los agentes en admin.php. - -
-
-
-Usuarios de la cancelación - esta opción si el sistema a 1 permite que el usuario suprima a otros usuarios del igual o de poco nivel de usuario del sistema. - -
-
-
-Suprima a grupos de usuario - esta opción si el sistema a 1 permite que el usuario suprima a grupos de usuario del sistema. - -
-
-
-La cancelación enumera - esta opción si el sistema a 1 permite que el usuario suprima listas vicidial del sistema. - -
-
-
-La cancelación hace campaña - esta opción si el sistema a 1 permite que el usuario suprima campañas vicidial del sistema. - -
-
-
-En-Grupos de la cancelación - esta opción si el sistema a 1 permite que el usuario suprima a En-Grupos vicidial del sistema. - -
-
-
-Suprima los agentes alejados - esta opción si el sistema a 1 permite que el usuario suprima agentes alejados vicidial del sistema. - -
-
-
-La carga conduce - esta opción si el sistema a 1 permite que el usuario cargue los plomos vicidial en la tabla del vicidial_list por el cargador basado tela del plomo. - -
-
-
-Detalle de la campaña - esta opción si el sistema a 1 permite que el usuario visión y modifique los elementos de la pantalla del detalle de la campaña. - -
-
-
-Acceso de AGC Admin - esta opción si el sistema a 1 permite a usuario a la conexión a las páginas astGUIclient del admin. - -
-
-
-La cancelación de AGC telefona - esta opción si el sistema a 1 permite que el usuario suprima entradas del teléfono en las páginas astGUIclient del admin. - -
-
-
-Escrituras de la cancelación - esta opción si el sistema a 1 permite que el usuario suprima las escrituras de la campaña en la pantalla de la modificación de la escritura. - -
-
-
-Modifique los plomos - esta opción si el sistema a 1 permite que el usuario modifique los plomos en la página de los resultados de la búsqueda del plomo de la sección del admin. - -
-
-
-Cambie la campaña del agente - esta opción si el sistema a 1 permite que el usuario altere la campaña que un agente está registrado en mientras que se registran en él. - -
-
-
-La cancelación se filtra - esta opción permite que el usuario pueda suprimir los filtros vicidial del plomo del sistema. - -
-
-
-Tiempos de la llamada de la cancelación - esta opción permite que elusuario pueda suprimir expedientes vicidial de los tiempos de lallamada y expedientes vicidial de los tiempos de la llamada del estadodel sistema. - -
-
-
-Modifique los tiempos de la llamada - esta opción permite que elusuario visión y modifique los expedientes de los tiempos de lallamada y de los tiempos de la llamada del estado. Un usuario nonecesita esta opción permitida si necesitan solamente cambiar laopción de los tiempos de la llamada en la pantalla de las campañas. - - - - -



- -VICIDIAL_CAMPAÑAS TABLA

-
-
-Identificación de la campaña - Úste es el nombre corto de la campaña, él no es editable después de la sumisión inicial, no puede contener espacios y debe estar entre 2 y 8 caracteres en longitudh. - -
-
-
-Nombre de la campaña - Ésta es la descripción de la campaña, debe estar entre 6 y 40 caracteres en longitud. - -
-
-
-Activo - aquí es adonde usted fija la campaña a activo o a inactivo. Si es inactivo, noone puede registrar en él. - -
-
-
-Extensión del parque - aquí es donde usted puede modificar para requisitos particulares en-sostiene la música para VICIDIAL. Cerciórese de que la extensión esté en lugar en el extensions.conf y eso que señala al nombre de fichero abajo. - -
-
-
-Nombre del archivo del parque - aquí es donde usted puede modificar para requisitos particulares en-sostiene la música para VICIDIAL. Cerciórese de que el nombre de fichero sea 10 caracteres en longitud o menos y que el archivo está en lugar en el directorio de /var/lib/asterisk/sounds. - -
-
-
-Forma del Web - aquí es donde usted puede fijar el Web page de encargo que será abierto cuando el usuario chasca encendido el botón de la FORMA del WEB. - -
-
-
-Permita Closers - aquí es donde usted puede fijar si los usuarios de esta campaña tendrán la opción para enviar la llamada a un más cercano. - -
-
-
-Estado del dial - aquí es adonde usted fija los estados que usted está deseando marcar encendido dentro de las listas que son activas para la campaña abajo - -
-
-
-Orden de la lista - Este menú es donde usted selecciona cómo los plomos que emparejan los estados seleccionados arriba serán puestos en la tolva del plomo: -
  - DOWN: seleccione los primeros plomos cargados en la tabla del vicidial_list -
  - UP: seleccione los plomos pasados cargados en la tabla del vicidial_list -
  - UP PHONE: seleccione el número y los trabajos más altos de teléfono su manera abajo -
  - DOWN PHONE: seleccione el número y los trabajos más bajos de teléfono su manera para arriba -
  - UP LAST NAME: comienzo con los nombres pasados comenzando con Z y trabajos su manera abajo -
  - DOWN LAST NAME: comienzo con los nombres pasados comenzando con A y trabajos su manera para arriba -
  - UP COUNT: comienzo con los plomos y los trabajos llamados su manera abajo -
  - DOWN COUNT: comienzo con menos plomos y trabajos llamados su manera para arriba -
  - DOWN COUNT 2nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada otro lead(Must para no tener NEW seleccionado en los estados del dial) -
  - DOWN COUNT 3nd NEW: comienzo con menos plomos y trabajos llamados su manera para arriba que inserta un NEW plomo en cada tercer lead(Must para no tener NEW seleccionado en los estados del dial) -
  - DOWN COUNT 4th NEW: comienzo con menos plomos y trabajos llamados que su manera para arriba que inserta un NEW plomo en cada adelante conduzca (no debe tener NEW seleccionado en los estados del dial) - -
-
-
-Tolva llana - éste es cuántos conducen los intentos de la escritura de VDhopper para mantener la tabla del vicidial_hopper para esta campaña. Si funciona la escritura de VDhopper cada minuto, haga esto levemente mayor que el número de plomos que usted entra a través en un minuto. - -
-
-
-Filtro del plomo - éste es un método de filtrar sus plomos usando un fragmento de una pregunta del SQL. Utilice esta característica con la precaución, él es fácil de parar el marcar accidentalmente con la alteración más leve a la declaración del SQL. El defecto no es NINGUNO. - -
-
-
-Reajuste de la fuerza de la tolva - esto permite que usted limpie fuera del contenido de la tolva sobre la sumisión de la forma. Debe ser llenada otra vez cuando la escritura de VDhopper funciona. - -
-
-
-Nivel auto del dial - aquí es adonde usted fija cuántos alinea VICIDIAL debe utilizar por medios del agente activo cero 0 que el marcar del automóvil está apagado y los agentes chascarán para marcar cada número. Si no VICIDIAL mantendrá líneas que marcan iguales a los agentes activos multiplicados por el nivel del dial para llegar cuántas líneas debe permitir esta campaña en cada servidor. - -
-
-
-Llamada siguiente del agente - esto se determina qué agente recibe la llamada siguiente que está disponible: -
  - random: órdenes por el valor al azar de la actualización en la tabla de los vicidial_live_agents -
  - oldest_call_start: las órdenes por la vez última un agente fueron enviadas una llamada. Resultados en los agentes que reciben el número casi igual de llamadas cabalmente. -
  - oldest_call_finish: las órdenes por la vez última un agente acabaron una llamada. El agente de AKA que espera lo más de largo posible recibe la primera llamada. -
  - overall_user_level: las órdenes por el user_level del agente según lo definido en los vicidial_users tabulan un user_level más alto recibirán más llamadas. - -
-
-
-Tiempo de la llamada local - aquí es adonde usted fijó durante qué horas usted quisiera marcar, según lo determinado por el tiempo local en está en cuál usted está llamando. Esto es controlada por código de área y ajustada por tiempo de los ahorros de la luz del día si es aplicable. Las pautas generales en los E.E.U.U. para el negocio al negocio son los 9am a los 5pm y el negocio a las llamadas del consumidor es los 9am a los 9pm. - -
-
-
-Descanso del dial - si está definido, llamadas que normalmente retraso después de que el descanso definido en extensions.conf en lugar de otro descanso en esta cantidad de segundos si es menos que el descanso de extensions.conf. Esto permite descansos del dial rápidamente que cambian del servidor al servidor y a limitar los efectos a una sola campaña. Si usted está teniendo muchos de llamadas del contestador automático o de Buzón de Voz usted puede desear intentar cambiar este valor entre a 21-26 y ver si los resultados mejoran. - -
-
-
-Prefijo del dial - este campo permite más fácilmente cambiar una trayectoria de marcar a salir con un diverso método sin hacer una recarga en asterisco. El defecto es 9 basados sobre un 91NXXNXXXXXX en el dialplan - extensions.conf. - -
-
-
-CallerID de la Campaña - This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID. - -
-
-
-Extensión de la campaña VDAD - este campo permite una extensión de la transferencia del costumbre VDAD. Esto permite que usted utilice diversas escrituras del agi de VDADtransfer... dependiendo de su campaña. La transferencia AGI(exten 8365 agi-VDADtransfer.agi del defecto) apenas envía inmediatamente invita a los agentes tan pronto como él se tome. Una encuesta sobre política AGI la muestra adicional es también (8366 agi-VDADtransferSURVEY.agi ) ese ahora incluido los juegos un mensaje a la persona llamada y permite que él haga una opción presionando buttons(effectively la pre-investigacio'n el plomo). Observe por favor eso a excepción de los exámenes, llamadas políticas y las caridades esta forma de llamar son ilegales en los Estados Unidos. - -
-
-
-Extensión de Rec de la Campaña - este campo permite para que una extensión de encargo de la grabación sea utilizada con VICIDIAL. Esto permite que usted utilice diversas extensiones dependiendo sobre cuánto tiempo usted desea permitir una grabación máxima y qué tipo de codec usted desea registrar adentro. El defecto exten es 8309 que si usted sigue los ejemplos de SCRATCH_INSTALL registrarán en el formato de WAV para hasta que una hora. Otra opción incluida en los ejemplos es 8310 que registrarán en el formato del GSM para hasta que una hora. - -
-
-
-Grabación de la campaña - este menú permite que usted elija qué nivel de la grabación se permite en esta campaña. NEVER inhabilitará la grabación en el cliente. ONDEMAND es el defecto y permite que el agente comience y pare a registrar según lo necesitado. ALLCALLS comenzará la grabación en el cliente siempre que una llamada se envíe a un agente. - -
-
-
-Nombre de fichero de Rec de la campaña - este campo permite que usted modifique el nombre para requisitos particulares de la grabación cuando la grabación de la campaña es ONDEMAND o ALLCALLS. Las variables permitidas son CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. El defecto es FULLDATE_AGENTE y parecería este 20051020-103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que parecería este TESTCAMP_51020103108_3125551212. 50 char max. - -
-
-
-Escritura de la campaña - este menú permite que usted elija la escritura que aparecerá en la pantalla de los agentes para esta campaña. No seleccione NONE no demostrar ninguna escritura para esta campaña. - -
-
-
-Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. - -
-
-
-Mensaje del contestador automático - este campo está para entrar en una extensión para cegar llamadas de la transferencia a cuando el agente consigue un contestador automático y chasca encendido el botón del mensaje del contestador automático en el marco de la conferencia de la transferencia. Usted debe fijar esto exten para arriba en el dialplan - extensions.conf - y se cerciora de que juega un archivo audio después que cuelga para arriba. - -
-
-
-AMD envían a la VM exten - este menú permite que usted defina si un mensaje esté dejado en un contestador automático cuando se detecta la llamada será remitido inmediatamente a la extensión del Contestar-Ma'quina-Mensaje si AMD es activo y se determina que la llamada es un contestador automático. - -
-
-
-Xfer-Conf DTMF - Estos cuatro campos permiten para que usted tenga dos sistemas de conferencia de la transferencia y de precolocaciones de DTMF. Cuando se carga la llamada o la campaña, la escritura de vicidial.php demostrará dos botones en el marco de la transferir-conferencia y automo'vil-poblara' el nu'mero-a-dial y los campos del enviar-dtmf cuando está presionada. - -
-
-
-El marcar numérico del Alt del agente - esta opción permite que un agente marque manualmente el número de teléfono o el campo alterno address3 después de que se haya llamado el número principal. - -
-
-
-Servicios repetidos programar - esta opción no prohibe a agente a la disposición una llamada como CALLBK y elige los datos y el tiempo en los cuales el plomo será reactivado. - -
-
-
-Segundos de la llamada de la gota - el número de segundos a partirdel tiempo que la línea de cliente se escoge encima de hasta que lallamada se considera una GOTA, sólo se aplica a las llamadas desalida. - -
-
-
-Buzón de Voz - si estuvieron definidas, las llamadas que CAERÍAN normalmente en lugar de otro serían ordenadas a esta caja del voicemail para oír y para dejar un mensaje. - -
-
-
-seguro puerto mensaje - si fijar y juego uno mensaje clientedespués gota llamar segundo descanso ser alcanzar sin ser transferiruno agente. _ este fijar eliminar sending uno voicemail caja si esteser fijar y. - -
-
-
-seguro puerto Exten - este ser dialplan extensión que desear seguropuerto audio archivo ser localizar en en su servidor. - -
-
-
-Segundos de Wrapup - el número de los segundos para forzar un agenteesperar antes de permitir que reciban o que marquen otra llamada. Elcontador de tiempo comienza tan pronto como un agente cuelgue paraarriba en su cliente - o en el caso del número alterno que marcacuando el agente acaba el plomo - defecto sea los segundos 0. Si elcontador de tiempo funciona hacia fuera antes de que el agente tengadispositioned la llamada, el agente todavía no se mueve encendido ala llamada siguiente hasta que seleccionan una disposición. - -
-
-
-Mensaje de Wrapup - esto es un mensaje campaña-especi'fico que seexhibirá en la pantalla del wrapup si se fijan los segundos delwrapup. - -
-
-
-Mensaje de Wrapup - esto es un mensaje campaña-especi'fico que seexhibirá en la pantalla del wrapup si se fijan los segundos delwrapup. - -
-
-
-Lista interna del uso DNC - esto define si esta campaña es filtrarlos plomos contra la lista interna de DNC. Si se fija a Y, la tolvabuscará cada número de teléfono en la lista de DNC antes de ponerlaen la tolva. Si está en la lista de DNC entonces que cambiará eseconduce estado a DNCL así que no puede ser marcada. El defecto es N. - -
-
-
-Grupos De entrada Permitidos - For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. - - - -



- -VICIDIAL_LISTAS TABLA

-
-
-Identificación de la lista - Úste es el nombre numérico de la lista, él no es editable después de la sumisión inicial, debe contener solamente números y debe estar entre 2 y 8 caracteres en longitud. - -
-
-
-Nombre de la lista - Ésta es la descripción de la lista, debe estar entre 2 y 20 caracteres en longitud. - -
-
-
-Campaña - Ésta es la campaña que esta lista pertenece a. Una lista se puede marcar solamente en una sola campaña contemporáneamente. - -
-
-
-Activo - esto define si la lista debe ser marcada encendido o no. - -
-
-
-Reajuste el Conducir-Llamar-Estado para esta lista - esto reajusta todos los plomos en esta lista a N para "no llamado puesto que reajuste pasado" y significa que cualquier plomo puede ahora ser llamado si es el estado derecho según lo definido en la pantalla de la campaña. - -
-
-
-Lista de VICIDIAL DNC - esto no llama la lista contiene cada plomo quese ha fijado a un estado de DNC en el sistema. A través de las LISTAS- AGREGUE EL NÚMERO a la página de DNC que usted puede agregarmanualmente un número a esta lista de modo que no sea llamada por lascampañas que utilizan la lista interna de DNC. - - - -



- -VICIDIAL_INBOUND_GROUPS TABLA

-
-
-Identificación de grupo - Úste es el nombre corto del grupo de entrada, él no es editable después de la sumisión inicial, no debe contener cualquier espacio y debe estar entre 2 y 20 caracteres en longitud. - -
-
-
-Nombre de grupo - Ésta es la descripción del grupo, debe estar entre 2 y 30 caracteres en longitud. No puede incluir rociadas -, plusses + o espacios . - -
-
-
-Color del grupo - éste es el color que exhibe en el cliente app de VICIDIAL cuando una llamada viene adentro en este grupo. Debe estar entre 2 y 7 caracteres de largo. Si esto es una definición del color de la tuerca hexagonal usted debe recordar poner a # al principio de la secuencia o VICIDIAL no trabajará correctamente. - -
-
-
-Activo - esto se determina si este grupo demuestra para arriba en la caja de la selección cuando un agente de VICIDIAL entra. - -
-
-
-Forma del Web - Ésta es la dirección de encargo que el chascar en el botón de la FORMA del WEB en VICIDIAL le llevará para las llamadas que vienen adentro en este grupo. - -
-
-
-Llamada siguiente del agente - esto se determina qué agente recibe la llamada siguiente que está disponible: -
  - random: órdenes por el valor al azar de la actualización en la tabla de los vicidial_live_agents -
  - oldest_call_start: las órdenes por la vez última un agente fueron enviadas una llamada. Resultados en los agentes que reciben el número casi igual de llamadas cabalmente. -
  - oldest_call_finish: las órdenes por la vez última un agente acabaron una llamada. El agente de AKA que espera lo más de largo posible recibe la primera llamada. -
  - overall_user_level: las órdenes por el user_level del agente según lo definido en los vicidial_users tabulan un user_level más alto recibirán más llamadas. - -
-
-
-Exhibición de Fronter - este campo se determina si el agente de entrada de VICIDIAL tendría el name(if del fronter allí es uno) exhibido en el campo del estado cuando la llamada viene al agente. - -
-
-
-Escritura de la campaña - este menú permite que usted elija la escritura que aparecerá en la pantalla de los agentes para esta campaña. No seleccione NONE no demostrar ninguna escritura para esta campaña. - -
-
-
-Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. - -
-
-
-Xfer-Conf DTMF - Estos cuatro campos permiten para que usted tenga dos sistemas de conferencia de la transferencia y de precolocaciones de DTMF. Cuando se carga la llamada o la campaña, la escritura de vicidial.php demostrará dos botones en el marco de la transferir-conferencia y automo'vil-poblara' el nu'mero-a-dial y los campos del enviar-dtmf cuando está presionada. - -
-
-
-Segundos de la llamada de la gota - el número de segundos a partirdel tiempo que la línea de cliente se escoge encima de hasta que lallamada se considera una GOTA, sólo se aplica a las llamadas desalida. - -
-
-
-Buzón de Voz - si estuvieron definidas, las llamadas que CAERÍAN normalmente en lugar de otro serían ordenadas a esta caja del voicemail para oír y para dejar un mensaje. - -
-
-
-Mensaje de la gota - si el sistema a Y juega un mensaje al clientedespués de que el descanso de los segundos de la llamada de la gotase alcance sin la transferencia a un agente. Este ajuste eliminaráenviar a una caja del voicemail si esto se fija a Y. - -
-
-
-Gota Exten - ésta es la extensión dialplan que el archivo audiocaído deseado de la llamada está situado en en su servidor. - - - -



- -VICIDIAL_REMOTE_AGENTS TABLA

-
-
-Comienzo de la identificación del usuario - Ésta es la identificación del usuario que comienza se utiliza que cuando las entradas alejadas del agente se insertan en el sistema. Si el número de líneas se fija más altamente de 1, este número es incrementado por uno hasta que cada línea tiene una entrada. Se cerciora de usted crear una nueva cuenta del usuario de VICIDIAL con un nivel de usuario de 4 o grande si usted quisiera que pudieran utilizar la página de vdremote.php para el acceso alejado de la tela de esta cuenta. - -
-
-
-Número de líneas - el define cuánto crea el agente alejado las entradas el sistema, y se determina cuántas líneas piensa que puede enviar con seguridad al número debajo. - -
-
-
-IP del servidor - Una entrada alejada del agente es solamente buena para un servidor específico, aquí es donde usted selecciona a que el servidor usted desea. - -
-
-
-Extensión externa - éste es el número que usted desea las llamadas remitidas a. Cerciórese de que sea un número dialplan completo y que si usted necesita 9 al principio usted lo pone adentro aquí. Pruebe marcando este número de un teléfono en el sistema. - -
-
-
-Estado - aquí es donde usted da vuelta al agente alejado por intervalos. Tan pronto como el agente sea activo el sistema asume que puede enviarle llamadas. Puede tomar hasta 30 segundos una vez que usted cambie el estado a inactivo para parar el recibir de llamadas. - -
-
-
-Campaña - aquí es donde usted selecciona la campaña que estos agentes alejados serán registrados en. Necesidades de entrada de utilizar la campaña MÁS CERCANA y de seleccionar las campañas de entrada debajo de ésa que usted desea recibir llamadas de. - -
-
-
-Grupos de entrada - aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. - - -



- -VICIDIAL_CAMPAIGN_LISTAS

-
-
-Las listas dentro de esta campaña se enumeran aquí, si son activas son denotadas por la Y o N y usted pueden ir a la pantalla de la lista chascando en la identificación de la lista en la primera columna. - - -



- -VICIDIAL_CAMPAIGN_STATUSES TABLA

-
-
-Con el uso de los estados de encargo de la campaña, usted puede tener estados que existan solamente para una campaña específica. El estado debe ser 1-8 caracteres en longitud, la descripción debe ser 2-30 caracteres en longitud y seleccionable define si demuestra para arriba en VICIDIAL como disposición. - - - -



- -VICIDIAL_CAMPAIGN_HOTKEYS TABLA

-
-
-Con el uso de los hotkeys de encargo de la campaña, los agentes que utilizan el retraso vicidial de la lata del tela-cliente y la disposición llama apenas presionando una sola llave en su teclado. - - - - -



- -VICIDIAL_LEAD_RECYCLE TABLA

-
-
-Con el uso del plomo que recicla, usted puede llamar estadosespecíficos de plomos otra vez en un intervalo especificado sin elreajuste de la lista entera. El reciclaje del plomo escampaña-especi'fico y no tiene que ser un estado dialableseleccionado en su campaña. La tentativa retrasa el campo es elnúmero de segundos hasta que el plomo se puede poner detrás en latolva, este número debe ser por lo menos 120 segundos. El campomáximo de la tentativa es el número máximo de las épocas que unplomo de este estado se puede procurar antes de que la lista necesiteser reajustada, este número puede ser a partir la 1 a 10. Usted puedeactivar y desactivar un plomo recicle la entrada con los acoplamientosproporcionados. Esta característica trabaja solamente en modo delautomo'vil-dial, donde está mayor el nivel del dial de 0. - - - - - -



- -VICIDIAL_USER_GROUPS TABLA

-
-
-Grupo de usuario - éste es el nombre corto de un grupo de usuario de Vicidial, intento para no utilizar ningunos espacios o puntuación para los caracteres de este máximo 20 del campo, mínimo de 2 caracteres. - -
-
-
-Nombre de grupo - Ésta es la descripción del máximo vicidial del grupo de usuario de 40 caracteres. - - - - - -



- -VICIDIAL_ESCRITURAS TABLA

-
-
-Identificación de la escritura - Éste es el nombre corto de una escritura de Vicidial. Éste necesita ser un identificador único. Intente no utilizar ningunos espacios o puntuación para los caracteres de este máximo 10 del campo, mínimo de 2 caracteres. - -
-
-Nombre de la escritura - éste es el título de una escritura de Vicidial. Éste es un resumen corto de los caracteres del máximo 50 de la escritura, mínimo de 2 caracteres. No debe haber espacios o puntuación de la clase en campo de los theis. - -
-
-Comentarios de la escritura - éste es tal como donde usted puede poner los comentarios para una escritura de Vicidial - cambiantes para liberar mejora de sept. el 23 -. caracteres del máximo 255, mínimo de 2 caracteres. - -
-
-Texto de la escritura - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today? - -
-
-
-Activo - esto se determina si esta escritura se puede seleccionar para ser utilizado por una campaña. - - - - - -



- -VICIDIAL_LEAD_FILTROS TABLA

-
-
-Identificación del filtro - Éste es el nombre corto de un filtro del plomo de Vicidial. Éste necesita ser un identificador único. No utilice ningunos espacios o puntuación para los caracteres de este máximo 10 del campo, mínimo de 2 caracteres. - -
-
-Nombre del filtro - éste es un nombre más descriptivo del filtro. Éste es un resumen corto de los caracteres del máximo 30 del filtro, mínimo de 2 caracteres. - -
-
-El filtro comenta - aquí es tal como donde usted puede poner los comentarios para un filtro de Vicidial - las llamadas todos los plomos de California -. los caracteres del máximo 255, mínimo de 2 caracteres. - -
-
-Filtro SQL - Aquí es adonde usted pone el fragmento de la pregunta del SQL que usted desea filtrar cerca no comienza o el extremo con Y, eso será agregado por la escritura del cron de la tolva automáticamente. una pregunta del SQL del ejemplo que trabajaría aquí es el called_count 4 y called_count. - - - - - -



- -VICIDIAL_TIEMPOS DE LA LLAMADA TABLA

-
-
-Identificación del tiempo de la llamada - éste es el nombre corto deuna definición del tiempo de la llamada de Vicidial. Éste necesitaser un identificador único. No utilice ningunos espacios opuntuación para los caracteres de este máximo 10 del campo, mínimode 2 caracteres. - -
-
-Nombre del tiempo de la llamada - éste es un nombre más descriptivode la definición del tiempo de la llamada. Éste es un resumen cortode los caracteres del máximo 30 de la definición del tiempo de lallamada, mínimo de 2 caracteres. - -
-
-El tiempo de la llamada comenta - aquí es donde usted puede poner loscomentarios para una definición del tiempo de la llamada de Vicidialtal como -10am hasta los 4pm con restricciones adicionales del estadode la llamada -. los caracteres del máximo 255. - -
-
-Tiempos del comienzo y de parada del defecto - éste es el tiempo dedefecto paran que el llamar será permitido que sea comenzado o dentrode esta definición del tiempo de la llamada si la hora de salida dela di'a-de-$$$-SEMANA no se define. 0 es medianoche. Evitar el llamarfijó totalmente este campo a 2400 y fijó el tiempo de parada deldefecto a 2400. Permitir el llamar 24 horas al día fijó la hora desalida a 0 y el tiempo de parada a 2400. - -
-
-Tiempos del comienzo y de parada del día laborable - éstos son lostiempos de encargo por el día que se puede fijar para la definicióndel tiempo de la llamada que las mismas reglas se aplican como con lostiempos del comienzo y de parada del defecto. - -
-
-Definiciones del tiempo de la llamada del estado - ésta es la listade las definiciones específicas del tiempo de la llamada del estadoque se siguen en esta definición del tiempo de la llamada. - -
-
-Estado del tiempo de la llamada del estado - éste es el código dedos letras para el estado que esta definición del tiempo que llamaestá para. Para que esto sea en efecto la llamada local mida eltiempo que se fija en la campaña debe tener este expediente deltiempo de la llamada del estado en él así como todos los plomos quetienen dos códigos del estado de la letra en ellos. - - - - -



- -FUNCIONALIDAD DEL CARGADOR DE LA LISTA DE VICIDIAL

-
-
-El VICIDIAL tela-baso' cargador del plomo se diseña simplemente llevar un file(up del plomo 8MB de tamaño) que es lengüeta o pipa delimitada y cargarlo en la tabla del vicidial_list. Hay también un cargador estupendo nuevo del plomo de la versión beta que permite para el campo que elige y de TXT- el texto claramente, los valores separados coma de CSV- y XLS- sobresalen formatos del archivo. El cargador del plomo no hace la validación de datos o la comprobación para duplicados en sí mismo u otras listas, de modo que esté algo usted necesita hacer antes de usted la carga los plomos. También, cerciórese de que usted haya creado la lista que estos plomos son estar debajo de modo que usted pueda utilizarlos. Hay también la materia de la tiempo-zona-codificacio'n estos plomos. Usted puede desear aumentar la frecuencia que el ADMIN_adjust_GMTnow_on_leads.pl se está funcionando en el cron en su servidor del asterisco para poder cifrar cualquier plomo cargado más rápidamente. Aquí está una lista de los campos en su orden apropiada para los archivos del plomo: -
    -
  1. Código del plomo del vendedor - demuestra para arriba en el campo de la identificación del vendedor del GUI -
  2. Código de fuente - uso interno solamente para los admins y DBAs -
  3. Identificación de la lista - el número de la lista que estos plomos demostrarán para arriba debajo -
  4. Código del teléfono - el prefijo para el teléfono number(1 para los E.E.U.U., 01144 para Reino Unido, 01161 para AUS, el etc) -
  5. Número de teléfono - debe ser por lo menos 8 dígitos de largo -
  6. Título - título del customer(Mr. Ms señ., etc...) -
  7. Nombre -
  8. Inicial Media -
  9. Apellidos -
  10. Dirección, línea 1 -
  11. Dirección, línea 2 -
  12. Dirección, línea 3 -
  13. Ciudad -
  14. Estado - limitado a 2 caracteres -
  15. Provincia -
  16. Código Postal -
  17. País -
  18. Sexo -
  19. Fecha de nacimiento -
  20. Número De Teléfono Alternativo -
  21. Dirección Email -
  22. Frase De Seguridad -
  23. Comentarios -
- -
NOTAS: La funcionalidad del cargador del plomo del sobresalir es permitida por una serie de escrituras del Perl y necesita tener un archivo correctamente configurado de /home/cron/AST_SERVER_conf.pl en lugar en el web server. También, los módulos de un Perl de los pares se deben cargar para ella para trabajar también - oLE-Storage_Lite-Storage_Lite y la Hoja de balance-ParseExcel. Usted puede comprobar para saber si hay errores runtime en éstos mirando su archivo del error_log de apache. - -







-







-EL EXTREMO -
-\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$dial_status_a = $row[3]; -$dial_status_b = $row[4]; -$dial_status_c = $row[5]; -$dial_status_d = $row[6]; -$dial_status_e = $row[7]; -$local_call_time = $row[16]; -if ($lead_filter_id=='') - { - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') - { - $lead_filter_id='NONE'; - } - } - -$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; -$rslt=mysql_query($stmt, $link); -$lists_to_print = mysql_num_rows($rslt); -$camp_lists=''; -$o=0; -while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; -if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} -} -$camp_lists = eregi_replace(".$","",$camp_lists); - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - -echo "

\n"; -echo "Demuestre La Cuenta De los Plomos De Dialable -

\n"; -echo "CAMPAIGN: $campaign_id
\n"; -echo "LISTAS: $camp_lists
\n"; -echo "STATUSES: $dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e
\n"; -echo "FILTER: $lead_filter_id
\n"; -echo "CALL TIME: $local_call_time

\n"; - -### call function to calculate and print dialable leads -dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - -echo "

\n"; -echo "\n"; - -exit; -} - - -###################### -# ADD=7111111 view sample script with test variables -###################### - -if ($ADD==7111111) -{ - ##### TEST VARIABLES ##### - $vendor_lead_code = 'VENDORLEADCODE'; - $list_id = 'LISTID'; - $gmt_offset_now = 'GMTOFFSET'; - $phone_code = '1'; - $phone_number = '7275551212'; - $title = 'Mr.'; - $first_name = 'JOHN'; - $middle_initial = 'Q'; - $last_name = 'PUBLIC'; - $address1 = '1234 Main St.'; - $address2 = 'Apt. 3'; - $address3 = 'ADDRESS3'; - $city = 'CHICAGO'; - $state = 'IL'; - $province = 'PROVINCE'; - $postal_code = '33760'; - $country_code = 'USA'; - $gender = 'M'; - $date_of_birth = '1970-01-01'; - $alt_phone = '3125551212'; - $email = 'test@test.com'; - $security_phrase = 'SECUTIRY'; - $comments = 'COMMENTS FIELD'; - $RGfullname = 'JOE AGENT'; - $RGuser = '6666'; - -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; - -$script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); -$script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); -$script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); -$script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); -$script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); -$script_text = eregi_replace('--A--title--B--',"$title",$script_text); -$script_text = eregi_replace('--A--first_name--B--',"$first_name",$script_text); -$script_text = eregi_replace('--A--middle_initial--B--',"$middle_initial",$script_text); -$script_text = eregi_replace('--A--last_name--B--',"$last_name",$script_text); -$script_text = eregi_replace('--A--address1--B--',"$address1",$script_text); -$script_text = eregi_replace('--A--address2--B--',"$address2",$script_text); -$script_text = eregi_replace('--A--address3--B--',"$address3",$script_text); -$script_text = eregi_replace('--A--city--B--',"$city",$script_text); -$script_text = eregi_replace('--A--state--B--',"$state",$script_text); -$script_text = eregi_replace('--A--province--B--',"$province",$script_text); -$script_text = eregi_replace('--A--postal_code--B--',"$postal_code",$script_text); -$script_text = eregi_replace('--A--country_code--B--',"$country_code",$script_text); -$script_text = eregi_replace('--A--gender--B--',"$gender",$script_text); -$script_text = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$script_text); -$script_text = eregi_replace('--A--alt_phone--B--',"$alt_phone",$script_text); -$script_text = eregi_replace('--A--email--B--',"$email",$script_text); -$script_text = eregi_replace('--A--security_phrase--B--',"$security_phrase",$script_text); -$script_text = eregi_replace('--A--comments--B--',"$comments",$script_text); -$script_text = eregi_replace('--A--fullname--B--',"$RGfullname",$script_text); -$script_text = eregi_replace('--A--user--B--',"$RGuser",$script_text); -$script_text = eregi_replace("\n","
",$script_text); - - -echo ""; - -echo "Escritura De la Inspección previo: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') {$users_hh='bgcolor ="#FFFF99"'; $users_fc='BLACK';} # yellow - else {$users_hh=''; $users_fc='WHITE';} -if ($hh=='campaigns') {$campaigns_hh='bgcolor ="#FFCC99"'; $campaigns_fc='BLACK';} # orange - else {$campaigns_hh=''; $campaigns_fc='WHITE';} -if ($hh=='lists') {$lists_hh='bgcolor ="#FFCCCC"'; $lists_fc='BLACK';} # red - else {$lists_hh=''; $lists_fc='WHITE';} -if ($hh=='ingroups') {$ingroups_hh='bgcolor ="#CC99FF"'; $ingroups_fc='BLACK';} # purple - else {$ingroups_hh=''; $ingroups_fc='WHITE';} -if ($hh=='remoteagent') {$remoteagent_hh='bgcolor ="#CCFFCC"'; $remoteagent_fc='BLACK';} # green - else {$remoteagent_hh=''; $remoteagent_fc='WHITE';} -if ($hh=='usergroups') {$usergroups_hh='bgcolor ="#CCFFFF"'; $usergroups_fc='BLACK';} # cyan - else {$usergroups_hh=''; $usergroups_fc='WHITE';} -if ($hh=='scripts') {$scripts_hh='bgcolor ="#99FFCC"'; $scripts_fc='BLACK';} # light teal - else {$scripts_hh=''; $scripts_fc='WHITE';} -if ($hh=='filters') {$filters_hh='bgcolor ="#CCCCCC"'; $filters_fc='BLACK';} # grey - else {$filters_hh=''; $filters_fc='WHITE';} -if ($hh=='times') {$times_hh='bgcolor ="#99FF33"'; $times_fc='BLACK';} # hard teal - else {$times_hh=''; $times_fc='WHITE';} - -?> - - - - -\n"; -echo "
English Español
- - - - - - - - - - - - - - - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - - - - -
  VICIDIAL ADMIN - Salir  
> SIZE=1> USUARIOS > SIZE=1> CAMPAÑAS > SIZE=1> LISTAS > SIZE=1> ESCRITURAS > SIZE=1> FILTROS > SIZE=1> EN-GROUPOS > SIZE=1> TIEMPOS DE LA LLAMADA > SIZE=1> GRUPOS DE USUARIO > SIZE=1> AGENTES REMOTOS > INFORMES
  MOSTRAR USUARIOS     |     NUEVO USUARIO     |     BUSCAR UN USUARIO
  NUEVA CAMPAÑA     |     MOSTRAR CAMPAÑAS
  MOSTRAR LISTAS     |     NUEVA LISTA     |     BÚSCAR UN LEAD |     AGREGUE EL NÚMERO A DNC           |     CARGAR LEADS
  AGREGUE LA ESCRITURA     |     ESCRITURAS DE LA VISIÓN
  AGREGUE EL FILTRO     |     FILTROS DE LA VISIÓN
  MOSTRAR EN-GROUPOS     |     NUEVO IN-GROUP
  DEMUESTRE LOS TIEMPOS DE LA LLAMADA     |     AGREGUE EL NUEVO TIEMPO DE LA LLAMADA     |     DEMUESTRE LOS TIEMPOS DE LA LLAMADA DEL ESTADO     |     AGREGUE EL NUEVO TIEMPO DE LA LLAMADA DEL ESTADO  
  NUEVO GRUPO DE USUARIO     |     MOSTRAR GRUPOS DE USUARIO     |     GRUPO POR HORA
  MOSTRAR LOS AGENTES REMOTOS     |     NUEVO AGENTE REMOTO
 
-
\n"; -echo ""; - -echo "
NUEVO USUARIO
\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "$NWB#vicidial_users-user_group$NWE\n"; -echo "\n"; -echo "
NÚmero De Usuario: $NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Nombre Completo: $NWB#vicidial_users-full_name$NWE
Nivel Del Usuario: $NWB#vicidial_users-user_level$NWE
Grupo Del Usuario:
Conexión Del Teléfono: $NWB#vicidial_users-phone_login$NWE
Contraseña Del Teléfono: $NWB#vicidial_users-phone_pass$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN -###################### - -if ($ADD==11) -{ -echo "
\n"; -echo ""; - -echo "
NUEVA CAMPAÑA\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID De la Campaña: $NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: $NWB#vicidial_campaigns-park_ext$NWE
Nombre de fichero Del Parking: $NWB#vicidial_campaigns-park_file_name$NWE
Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE
Franja horaria de llamada: $NWB#vicidial_campaigns-local_call_time$NWE
Buzón de Voz: $NWB#vicidial_campaigns-voicemail_ext$NWE
Escritura: $NWB#vicidial_campaigns-campaign_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID De la Lista: (Solamente dígitos)$NWB#vicidial_lists-list_id$NWE
Nombre De la Lista: $NWB#vicidial_lists-list_name$NWE
Campaña: $NWB#vicidial_lists-campaign_id$NWE
Activo: $NWB#vicidial_lists-active$NWE
\n"; - -} - - -###################### -# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number -###################### - -if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) - { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NO AGREGADO - este número de teléfono está en no llama ya lalista: $phone_number

\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC AGREGADO: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); - } - } - } - -echo "
AGREGUE Un NÚMERO A la LISTA De DNC\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Número De Teléfono: (Solamente dígitos)$NWB#vicidial_list-dnc$NWE
\n"; - -} - - -###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN -###################### - -if ($ADD==1111) -{ -echo "
\n"; -echo ""; - -echo "
NUEVO GRUPO DE ENTRADA\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID De Grupo: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Color Del Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Activo: $NWB#vicidial_inbound_groups-active$NWE
Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Buzón de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Escritura: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN -###################### - -if ($ADD==11111) -{ -echo "
\n"; -echo ""; - -echo "
NUEVO AGENTE REMOTO\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Comienzo Del ID del usuario: (Solamente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Del Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensión Externa: (número del dialplan para alcanzar agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Estado: $NWB#vicidial_remote_agents-status$NWE
Campaña: $NWB#vicidial_remote_agents-campaign_id$NWE
Grupos De entrada: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTA: Puede tomar hasta 30 segundos para los cambios sometidos en esta pantalla para ir viva\n"; - -} - - -###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN -###################### - -if ($ADD==111111) -{ -echo "
\n"; -echo ""; - -echo "
NUEVO GRUPO DE USUARIOS\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Grupo: (sin espacios o signos de puntuación)$NWB#vicidial_user_groups-user_group$NWE
Descripción: (Descripción del grupo)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -} - - -###################### -# ADD=1111111 display the ADD NEW SCRIPT SCREEN -###################### - -if ($ADD==1111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW SCRIPT\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Identificación De la Escritura:: (sin espacios o signos de puntuación)$NWB#vicidial_scripts-script_id$NWE
Nombre de la escritura: (título de la escritura)$NWB#vicidial_scripts-script_name$NWE
Comentarios de la escritura: $NWB#vicidial_scripts-script_comments$NWE
Activo: $NWB#vicidial_scripts-active$NWE
Texto de la escritura: $NWB#vicidial_scripts-script_text$NWE
\n"; - -} - - -###################### -# ADD=11111111 display the ADD NEW FILTER SCREEN -###################### - -if ($ADD==11111111) -{ -echo "
\n"; -echo ""; - -echo "
AGREGUE EL FILTRO NUEVO\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Identificación Del Filtro: (sin espacios o signos de puntuación)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nombre Del Filtro: (descripción corta del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Comentarios Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; -} - - -###################### -# ADD=111111111 display the ADD NEW CALL TIME SCREEN -###################### - -if ($ADD==111111111) -{ -echo "
\n"; -echo ""; - -echo "
AGREGUE EL NUEVO TIEMPO DE LA LLAMADA\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
Identificación Del Tiempo De la Llamada: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-call_time_id$NWE
Nombre Del Tiempo De la Llamada: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada: $NWB#vicidial_call_times-call_time_comments$NWE
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definición del tiempo de la llamada
\n"; -} - - -###################### -# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN -###################### - -if ($ADD==1111111111) -{ -echo "
\n"; -echo ""; - -echo "
AGREGUE EL NUEVO TIEMPO DE LA LLAMADA DEL ESTADO\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
Identificación Del Tiempo De la Llamada Del Estado: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (sin espacios o signos de puntuación)$NWB#vicidial_call_times-state_call_time_state$NWE
_ Estado Llamar Tiempo Nombre: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
Las opciones del día y del tiempo aparecerán una vez que usted hayacreado la definición del tiempo de la llamada
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 2 series, validates form data and inserts the new record into the database -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=2 adds the new user to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USUARIO NO AGREGADO - hay ya un usuario en el sistema con este número del usuario\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
USUARIO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
la ID del usuario debe estar entre 2 y 8 caracteres de largo\n"; - echo "
el nombre completo y la contraseña deben ser por lo menos 2 caracteres de largo\n"; - } - else - { - echo "
EL USUARIOAÑADIDO: $user\n"; - - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); - } - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new campaign to the system -###################### - -if ($ADD==21) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAÚA NO AGREGADA - hay ya una campaña en el sistema con esta identificación\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) ) - { - echo "
CAMPAÚA NO AGREGADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
la ID de la campaña debe estar entre 2 y 8 caracteres en longitud\n"; - echo "
el nombre de la campaña debe estar entre 6 y 40 caracteres en longitud\n"; - } - else - { - echo "
CAMPAÑA AÑADIDA: $campaign_id\n"; - - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch) values('$campaign_id','$campaign_name','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVA CAMPAÑA |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - } - } -$ADD=31; -} - -###################### -# ADD=22 adds the new campaign status to the system -###################### - -if ($ADD==22) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ESTADO de la CAMPAÚA - hay ya una campaña - estado NO AGREGADO en el sistema con este nombre\n";} - else - { - $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ESTADO de la CAMPAÚA NO AGREGADO - hay ya un global-estado en el sistema con este nombre\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
ESTADO de la CAMPAÚA NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el estado debe estar entre 1 y 8 caracteres en longitud\n"; - echo "
el nombre del estado debe estar entre 2 y 30 caracteres en longitud\n"; - } - else - { - echo "
ESTADO DE LA CAMPAÑA AÑADIDA: $campaign_id - $status\n"; - - $stmt="INSERT INTO vicidial_campaign_statuses values('$status','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVA CAMPAÑA STATUS |$PHP_AUTH_USER|$ip|'$status','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } - } -$ADD=31; -} - - -###################### -# ADD=23 adds the new campaign hotkey to the system -###################### - -if ($ADD==23) -{ - $HKstatus_data = explode('-----',$HKstatus); - $status = $HKstatus_data[0]; - $status_name = $HKstatus_data[1]; - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAÚA HOTKEY NO AGREGADA - hay ya una campaña-hotkey en el sistema con este hotkey\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
CAMPAÚA HOTKEY NO AGREGADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el hotkey debe ser un solo carácter entre 1 y 9 \n"; - echo "
el estado debe estar entre 1 y 8 caracteres en longitud\n"; - } - else - { - echo "
ACCESO DIRECTO A LA CAMPAÑA AÑADIDO: $campaign_id - $status - $hotkey\n"; - - $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVA CAMPAÑA HOTKEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=25 adds the new campaign lead recycle entry to the system -###################### - -if ($ADD==25) -{ - $status = eregi_replace("-----.*",'',$status); - echo ""; - $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
El PLOMO de la CAMPAÑA RECICLA NO AGREGADO - hay ya unconducir-reciclaje para esta campaña con este estado\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; - echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; - } - else - { - echo "
EL PLOMO DE LA CAMPAÑA RECICLA AGREGADO: $campaign_id - $status - $attempt_delay\n"; - - $stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new list to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
LISTA NO AGREGADA - hay ya una lista en el sistema con esta ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or (strlen($list_id) < 2) or (strlen($list_id) > 8) ) - { - echo "
LISTA NO AGREGADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La ID de la lista debe estar entre 2 y 8 caracteres en longitud\n"; - echo "
El nombre de la lista debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - echo "
LISTA AÑADIDA: $list_id\n"; - - $stmt="INSERT INTO vicidial_lists values('$list_id','$list_name','$campaign_id','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|'$list_id','$list_name','$campaign_id','$active'|\n"); - fclose($fp); - } - } - } -$ADD=311; -} - - - -###################### -# ADD=2111 adds the new inbound group to the system -###################### - -if ($ADD==2111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
GRUPO NO AGREGADO - hay ya un grupo en el sistema con esta ID\n";} - else - { - if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) ) - { - echo "
GRUPO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La ID de grupo debe estar entre 2 y 20 caracteres en longitud y contener no ' -+'.\n"; - echo "
El color del nombre de grupo y del grupo debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - echo "
GRUPO AÑADIDO: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000; -} - - -###################### -# ADD=21111 adds new remote agents to the system -###################### - -if ($ADD==21111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
AGENTES ALEJADOS NO AGREGADOS - hay ya una entrada alejada de los agentes comenzando con esta ID del usuario\n";} - else - { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
AGENTES ALEJADOS NO AGREGADOS - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
El comienzo de la ID del usuario y la extensión externa deben ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; - $rslt=mysql_query($stmt, $link); - - echo "
AGENTES REMOTO AÑADIDO: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW AGENTES REMOTOS ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } - } - } -$ADD=10000; -} - -###################### -# ADD=211111 adds new user group to the system -###################### - -if ($ADD==211111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
GRUPO de USUARIO NO AGREGADO - hay ya una entrada del grupo de usuario con este nombre\n";} - else - { - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
GRUPO de USUARIO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
El nombre y la descripción de grupo deben ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="INSERT INTO vicidial_user_groups values('$user_group','$group_name');"; - $rslt=mysql_query($stmt, $link); - - echo "
GRUPO DE USUARIO AÑADIDO: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|NUEVO USUARIO GROUP ENTRY |$PHP_AUTH_USER|$ip|'$user_group','$group_name'|\n"); - fclose($fp); - } - } - } -$ADD=100000; -} - -###################### -# ADD=2111111 adds new script to the system -###################### - -if ($ADD==2111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
ESCRITURA NO AGREGADA - hay ya una entrada de la escritura con este nombre\n";} - else - { - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
ESCRITURA NO AGREGADA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
El nombre, la descripción y el texto de la escritura deben ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; - $rslt=mysql_query($stmt, $link); - - echo "
ESCRITURA AGREGADA: $script_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000000; -} - - -###################### -# ADD=21111111 adds new filter to the system -###################### - -if ($ADD==21111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
FILTRO NO AGREGADO - hay ya una entrada del filtro con esta identificación\n";} - else - { - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTRO NO AGREGADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Filtre la identificación, nombre y el SQL debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='$lead_filter_sql';"; - $rslt=mysql_query($stmt, $link); - - echo "
EL FILTRO AGREGÓ: $lead_filter_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=10000000; -} - - -###################### -# ADD=211111111 adds new call time definition to the system -###################### - -if ($ADD==211111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DEFINICIÓN DEL TIEMPO DE LA LLAMADA NO AGREGADA - hay ya una entrada de tiempo de la llamada con esta identificación\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
DEFINICIÓN DEL TIEMPO DE LA LLAMADA NO AGREGADA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La identificación del tiempo de la llamada y el nombre deben ser porlo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments';"; - $rslt=mysql_query($stmt, $link); - - echo "
TIEMPO DE LA LLAMADA AGREGADO: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - } -$ADD=311111111; -} - - -###################### -# ADD=2111111111 adds new state call time definition to the system -###################### - -if ($ADD==2111111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DEFINICIÓN DEL TIEMPO DE LA LLAMADA DEL ESTADO NO AGREGADA - hay ya una entrada de tiempo de la llamada con esta identificación\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
DEFINICIÓN DEL TIEMPO DE LA LLAMADA DEL ESTADO NO AGREGADA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Indique que identificación del tiempo de la llamada, nombre y estadodebe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="INSERT INTO vicidial_state_call_times SET state_call_time_id='$call_time_id',state_call_time_name='$call_time_name',state_call_time_comments='$call_time_comments',state_call_time_state='$state_call_time_state';"; - $rslt=mysql_query($stmt, $link); - - echo "
TIEMPO DE LA LLAMADA DEL ESTADO AGREGADO: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=3111111111; -} - - - - -###################################################################################################### -###################################################################################################### -####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below -###################################################################################################### -###################################################################################################### - - - -###################### -# ADD=4A submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4A") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USUARIO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La contraseña y el nombre completo cada ot de la necesidad sean por lo menos 2 caracteres en longitud\n"; - } - else - { - echo "
USUARIO MODIFICADO - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - -###################### -# ADD=4B submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4B") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USUARIO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La contraseña y el nombre completo cada ot de la necesidad sean por lo menos 2 caracteres en longitud\n"; - } - else - { - echo "
USUARIO MODIFICADO - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - - -###################### -# ADD=4 submit user modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USUARIO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La contraseña y el nombre completo cada ot de la necesidad sean por lo menos 2 caracteres en longitud\n"; - } - else - { - echo "
USUARIO MODIFICADO: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - -###################### -# ADD=41 submit campaign modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAÚA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; - } - else - { - echo "
CAMPAÑA MODIFICADA: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; - echo "
- Espera 1 minuto antes de marcar el número siguiente\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=42 delete campaign status in the system -###################### - -if ($ADD==42) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
ESTADO de la CAMPAÚA NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
la ID de la campaña necesita ser por lo menos 2 caracteres en longitud\n"; - echo "
el estado de la campaña necesita ser por lo menos los caracteres 1 en longitud\n"; - } - else - { - echo "
ESTADO DE ENCARGO DE LA CAMPAÚA SUPRIMIDO: $campaign_id - $status\n"; - - $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=43 delete campaign hotkey in the system -###################### - -if ($ADD==43) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
CAMPAÚA HOTKEY NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
la ID de la campaña necesita ser por lo menos 2 caracteres en longitud\n"; - echo "
el estado de la campaña necesita ser por lo menos los caracteres 1 en longitud\n"; - echo "
el hotkey de la campaña necesita ser por lo menos los caracteres 1 en longitud\n"; - } - else - { - echo "
LA CAMPAÚA DE ENCARGO HOTKEY SUPRIMIÚ: $campaign_id - $status - $hotkey\n"; - - $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=44 submit campaign modifications to the system - Basic View -###################### - -if ($ADD==44) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAÚA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el nombre de la campaña necesita ser por lo menos 6 caracteres en longitud\n"; - } - else - { - echo "
CAMPAÑA MODIFICADA: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
REAJUSTE DE LA TOLVA DEL PLOMO DE LA CAMPAÚA\n"; - echo "
- Espera 1 minuto antes de marcar el número siguiente\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=34; # go to campaign modification form below -} - -###################### -# ADD=45 modify campaign lead recycle in the system -###################### - -if ($ADD==45) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; - echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; - } - else - { - echo "
CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=411 submit list modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) - { - echo "
LISTA NO MODIFICADA - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el nombre de la lista debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - echo "
LISTA MODIFICADA: $list_id\n"; - - $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') - { - echo "
REAJUSTANDO LA LISTA - LLAMADA - ESTADO\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } - } - if ($campaign_id != "$old_campaign_id") - { - echo "
QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id'|\n"); - fclose($fp); - } - } - -$ADD=311; # go to list modification form below -} - - -###################### -# ADD=4111 modify in-group info in the system -###################### - -if ($ADD==4111) -{ - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) - { - echo "
GRUPO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el color del nombre de grupo y del grupo debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - echo "
GRUPO MODIFICADO: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_message='$drop_message',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111; # go to in-group modification form below -} - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
AGENTES ALEJADOS NO MODIFICADOS - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
El comienzo de la ID del usuario y la extensión externa deben ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
LOS AGENTES ALEJADOS SE MODIFICARON\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY AGENTES REMOTOS ENTRY |$PHP_AUTH_USER|$ip|set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - } - -$ADD=31111; # go to remote agents modification form below -} - - - -###################### -# ADD=411111 modify user group info in the system -###################### - -if ($ADD==411111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
GRUPO de USUARIO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
El nombre y la descripción de grupo deben ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); - - echo "
GRUPO DE USUARIO MODIFICADO\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group'|\n"); - fclose($fp); - } - } - -$ADD=311111; # go to user group modification form below -} - -###################### -# ADD=4111111 modify script in the system -###################### - -if ($ADD==4111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
ESCRITURA NO MODIFICADA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
El nombre, la descripción y el texto de la escritura deben ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
LA ESCRITURA SE MODIFICÓ\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111; # go to script modification form below -} - - -###################### -# ADD=41111111 modify filter in the system -###################### - -if ($ADD==41111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTRO NO MODIFICADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Filtre la identificación, nombre y el SQL debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='$lead_filter_sql' where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTRO MODIFICADO\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31111111; # go to filter modification form below -} - - -###################### -# ADD=411111111 modify call time in the system -###################### - -if ($ADD==411111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
TIEMPO DE LA LLAMADA NO MODIFICADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La identificación del tiempo de la llamada y el nombre deben ser porlo menos 2 caracteres en longitud\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
TIEMPO DE LA LLAMADA MODIFICADO\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - -$ADD=311111111; # go to call time modification form below -} - - -###################### -# ADD=4111111111 modify state call time in the system -###################### - -if ($ADD==4111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
TIEMPO DE LA LLAMADA DEL ESTADO NO MODIFICADO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Indique que identificación del tiempo de la llamada, nombre y estadodebe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
TIEMPO DE LA LLAMADA DEL ESTADO MODIFICADO\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111111; # go to state call time modification form below -} - - - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of user -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) - { - echo "
USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DEL USUARIO: $user\n"; - echo "

Chasque aquí para suprimir a usuario $user


\n"; - } - -$ADD='3'; # go to user modification below -} - -###################### -# ADD=51 confirmation before deletion of campaign -###################### - -if ($ADD==51) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) ) - { - echo "
CAMPAÑA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Campaña_id be at least 2 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DE LA CAMPAÑA: $campaign_id\n"; - echo "

Chasque aquí para suprimir campaña $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=52 confirmation before logging all agents out of campaign of campaign -###################### - -if ($ADD==52) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
AGENTES NO REGISTRADOS FUERA DE CAMPAÑA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Campaña_id be at least 2 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN DEL REGISTRO DE ESTADO DE LA MÁQUINA DEL AGENTE: $campaign_id\n"; - echo "

Chasque aquí para registrar todos los agentes fuera de $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=511 confirmation before deletion of list -###################### - -if ($ADD==511) -{ - echo ""; - - if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) ) - { - echo "
LISTA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DE LA LISTA: $list_id\n"; - echo "

Chasque aquí para suprimir la lista y todos sus plomos $list_id


\n"; - } - -$ADD='311'; # go to campaign modification below -} - -###################### -# ADD=5111 confirmation before deletion of in-group -###################### - -if ($ADD==5111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) ) - { - echo "
EN-GRUPO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DE EN-GRUPO: $group_id\n"; - echo "

Chasque aquí para suprimir a en-grupo $group_id


\n"; - } - -$ADD='3111'; # go to in-group modification below -} - -###################### -# ADD=51111 confirmation before deletion of remote agent record -###################### - -if ($ADD==51111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) ) - { - echo "
AGENTE ALEJADO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN ALEJADA DE LA CANCELADURA DEL AGENTE: $remote_agent_id\n"; - echo "

Chasque aquí para suprimir el agente alejado $remote_agent_id


\n"; - } - -$ADD='31111'; # go to remote agent modification below -} - -###################### -# ADD=511111 confirmation before deletion of user group record -###################### - -if ($ADD==511111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) - { - echo "
GRUPO DE USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DEL GRUPO DE USUARIO: $user_group\n"; - echo "

Chasque aquí para suprimir a grupo de usuario $user_group


\n"; - } - -$ADD='311111'; # go to user group modification below -} - -###################### -# ADD=5111111 confirmation before deletion of script record -###################### - -if ($ADD==5111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) ) - { - echo "
ESCRITURA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Script_id must be at least 2 characters in length\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DE LA ESCRITURA: $script_id\n"; - echo "

Chasque aquí para suprimir la escritura $script_id


\n"; - } - -$ADD='3111111'; # go to script modification below -} - -###################### -# ADD=51111111 confirmation before deletion of filter record -###################### - -if ($ADD==51111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) ) - { - echo "
FILTRO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La identificación del filtro debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; - echo "

Chasque aquí para suprimir el filtro$lead_filter_id


\n"; - } - -$ADD='31111111'; # go to filter modification below -} - -###################### -# ADD=511111111 confirmation before deletion of call time record -###################### - -if ($ADD==511111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
TIEMPO DE LA LLAMADA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
_ llamar tiempo identificación deber ser por lo menos 2 carácter enlongitud\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DEL TIEMPO DE LA LLAMADA: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; - } - -$ADD='311111111'; # go to call time modification below -} - -###################### -# ADD=5111111111 confirmation before deletion of call time record -###################### - -if ($ADD==5111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
TIEMPO DE LA LLAMADA DEL ESTADO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
_ llamar tiempo identificación deber ser por lo menos 2 carácter enlongitud\n"; - } - else - { - echo "
CONFIRMACIÓN DE LA CANCELADURA DEL TIEMPO DE LA LLAMADA DEL ESTADO: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; - } - -$ADD='3111111111'; # go to state call time modification below -} - - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete user record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) - { - echo "
USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|user='$user'|\n"); - fclose($fp); - } - echo "
CANCELADURA DEL USUARIO TERMINADA: $user\n"; - echo "

\n"; - } - -$ADD='0'; # go to user list -} - -###################### -# ADD=61 delete campaign record -###################### - -if ($ADD==61) -{ - echo ""; - - if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) - { - echo "
CAMPAÑA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Campaña_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
LA CANCELADURA DE LA CAMPAÑA TERMINÓ: $campaign_id\n"; - echo "

\n"; - } - -$ADD='10'; # go to campaigns list -} - -###################### -# ADD=62 Logout all agents fro a campaign -###################### - -if ($ADD==62) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
AGENTES NO REGISTRADOS FUERA DE CAMPAÑA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Campaña_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!AGENTE LOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
EL REGISTRO DE ESTADO DE LA MÁQUINA DEL AGENTE TERMINÓ: $campaign_id\n"; - echo "

\n"; - } - -$ADD='31'; # go to campaign modification below -} - - -###################### -# ADD=65 delete campaign lead recycle in the system -###################### - -if ($ADD==65) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
EL PLOMO DE LA CAMPAÑA RECICLA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
el estado debe estar entre 1 y 6 caracteres en longitud\n"; - echo "
la tentativa retrasa debe ser por lo menos 120 segundos\n"; - echo "
las tentativas máximas deben ser a partir la 1 a 10\n"; - } - else - { - echo "
EL PLOMO DE LA CAMPAÑA RECICLA SUPRIMIDO: $campaign_id - $status - $attempt_delay\n"; - - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=611 delete list record and all leads within it -###################### - -if ($ADD==611) -{ - echo ""; - - if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) - { - echo "
LISTA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
QUITAR LOS PLOMOS DE LA LISTA DE LA TABLA DE VICIDIAL_LIST\n"; - $stmt="DELETE from vicidial_list where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } - echo "
LA CANCELADURA DE LA LISTA TERMINÓ: $list_id\n"; - echo "

\n"; - } - -$ADD='100'; # go to lists list -} - -###################### -# ADD=6111 delete in-group record -###################### - -if ($ADD==6111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) - { - echo "
EN-GRUPO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } - echo "
CANCELADURA DE EN-GRUPO TERMINADA: $group_id\n"; - echo "

\n"; - } - -$ADD='1000'; # go to in-group list -} - -###################### -# ADD=61111 delete remote agent record -###################### - -if ($ADD==61111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) - { - echo "
AGENTE ALEJADO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - echo "
CANCELADURA ALEJADA DEL AGENTE TERMINADA: $remote_agent_id\n"; - echo "

\n"; - } - -$ADD='10000'; # go to remote agents list -} - -###################### -# ADD=611111 delete user group record -###################### - -if ($ADD==611111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) - { - echo "
GRUPO DE USUARIO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } - echo "
CANCELADURA DEL GRUPO DE USUARIO TERMINADA: $user_group\n"; - echo "

\n"; - } - -$ADD='100000'; # go to user group list -} - -###################### -# ADD=6111111 delete script record -###################### - -if ($ADD==6111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) - { - echo "
ESCRITURA NO SUPRIMIDA - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Script_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } - echo "
CANCELADURA DE LA ESCRITURA TERMINADA: $script_id\n"; - echo "

\n"; - } - -$ADD='1000000'; # go to script list -} - - -###################### -# ADD=61111111 delete filter record -###################### - -if ($ADD==61111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) - { - echo "
FILTRO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
La identificación del filtro debe ser por lo menos 2 caracteres en longitud\n"; - } - else - { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } - echo "
CANCELADURA DEL FILTRO TERMINADA: $lead_filter_id\n"; - echo "

\n"; - } - -$ADD='10000000'; # go to filter list -} - - -###################### -# ADD=611111111 delete call times record -###################### - -if ($ADD==611111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
TIEMPO DE LA LLAMADA NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
_ llamar tiempo identificación deber ser por lo menos 2 carácter enlongitud\n"; - } - else - { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
_ LLAMAR TIEMPO CANCELADURA TERMINAR: $call_time_id\n"; - echo "

\n"; - } - -$ADD='100000000'; # go to call times list -} - - -###################### -# ADD=6111111111 delete call times record -###################### - -if ($ADD==6111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
TIEMPO DE LA LLAMADA DEL ESTADO NO SUPRIMIDO - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
_ llamar tiempo identificación deber ser por lo menos 2 carácter enlongitud\n"; - } - else - { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; - $rslt=mysql_query($stmt, $link); - $sct_to_print = mysql_num_rows($rslt); - $sct_list=''; - - $o=0; - while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_ids[$o] = "$rowx[0]"; - $sct_states[$o] = "$rowx[1]"; - $o++; - } - $o=0; - - while ($sct_to_print > $o) { - $sct_states[$o] = eregi_replace("\|$call_time_id\|",'|',$sct_states[$o]); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$sct_states[$o]' where call_time_id='$sct_ids[$o]';"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - echo "Regla Del Estado Quitada: $sct_ids[$o]
\n"; - $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
CANCELADURA DEL TIEMPO DE LA LLAMADA DEL ESTADO TERMINADA: $call_time_id\n"; - echo "

\n"; - } - -$ADD='1000000000'; # go to call times list -} - - - - - - -###################################################################################################### -###################################################################################################### -####### 3 series, record modification forms -###################################################################################################### -###################################################################################################### - - - - -###################### -# ADD=3 modify user info in the system -###################### - -if ($ADD==3) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_level = $row[4]; - $user_group = $row[5]; - $phone_login = $row[6]; - $phone_pass = $row[7]; - $delete_users = $row[8]; - $delete_user_groups = $row[9]; - $delete_lists = $row[10]; - $delete_campaigns = $row[11]; - $delete_ingroups = $row[12]; - $delete_remote_agents = $row[13]; - $load_leads = $row[14]; - $campaign_detail = $row[15]; - $ast_admin_access = $row[16]; - $ast_delete_phones = $row[17]; - $delete_scripts = $row[18]; - $modify_leads = $row[19]; - $hotkeys_active = $row[20]; - $change_agent_campaign =$row[21]; - $agent_choose_ingroups =$row[22]; - $scheduled_callbacks = $row[24]; - $agentonly_callbacks = $row[25]; - $agentcall_manual = $row[26]; - $vicidial_recording = $row[27]; - $vicidial_transfers = $row[28]; - $delete_filters = $row[29]; - $alter_agent_interface_options =$row[30]; - $closer_default_blended = $row[31]; - $delete_call_times = $row[32]; - $modify_call_times = $row[33]; - -if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) - { - echo "
Usted no tiene permisos de modificar a este usuario: $row[1]\n"; - } -else - { - echo "
MODIFIQUE Un EXPEDIENTE De los USUARIOS: $row[1]\n"; - if ($LOGuser_level > 8) - {echo "\n";} - else - { - if ($LOGalter_agent_interface == "1") - {echo "\n";} - else - {echo "\n";} - } - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - if ($LOGuser_level > 8) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
NÚmero De Usuario: $row[1]$NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Nombre Completo: $NWB#vicidial_users-full_name$NWE
Nivel Del Usuario: $NWB#vicidial_users-user_level$NWE
Grupo Del Usuario: $NWB#vicidial_users-user_group$NWE
Conexión Del Teléfono: $NWB#vicidial_users-phone_login$NWE
Contraseña Del Teléfono: $NWB#vicidial_users-phone_pass$NWE
OPCIONES DE INTERFAZ DEL AGENTE:
El Agente Elige Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
HotKeys Activo: $NWB#vicidial_users-hotkeys_active$NWE
Servicios repetidos Programar: $NWB#vicidial_users-scheduled_callbacks$NWE
Servicios repetidos Del Agente-Solamente: $NWB#vicidial_users-agentonly_callbacks$NWE
Manual de la llamada del agente: $NWB#vicidial_users-agentcall_manual$NWE
Grabación de Vicidial: $NWB#vicidial_users-vicidial_recording$NWE
Vicidial transfiere: $NWB#vicidial_users-vicidial_transfers$NWE
Un Defecto Más cercano Mezclado: $NWB#vicidial_users-closer_default_blended$NWE
Grupos De entrada: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_users-closer_campaigns$NWE
OPCIONES DE INTERFAZ DEL ADMIN:
Altere Las Opciones De Interfaz Del Agente: $NWB#vicidial_users-alter_agent_interface_options$NWE
Usuarios de la cancelación: $NWB#vicidial_users-delete_users$NWE
Suprima a grupos de usuario: $NWB#vicidial_users-delete_user_groups$NWE
La cancelación enumera: $NWB#vicidial_users-delete_lists$NWE
La cancelación hace campaña: $NWB#vicidial_users-delete_campaigns$NWE
En-Grupos de la cancelación: $NWB#vicidial_users-delete_ingroups$NWE
Suprima los agentes alejados: $NWB#vicidial_users-delete_remote_agents$NWE
Escritura De la Cancelacións: $NWB#vicidial_users-delete_scripts$NWE
La carga conduce: $NWB#vicidial_users-load_leads$NWE
Detalle de la campaña: $NWB#vicidial_users-campaign_detail$NWE
Acceso de AGC Admin: $NWB#vicidial_users-ast_admin_access$NWE
La cancelación de AGC telefona: $NWB#vicidial_users-ast_delete_phones$NWE
Modifique Los Plomos: $NWB#vicidial_users-modify_leads$NWE
Cambie La Campaña Del Agente: $NWB#vicidial_users-change_agent_campaign$NWE
Filtro De la Cancelacións: $NWB#vicidial_users-delete_filters$NWE
Delete Tiempos De la Llamada: $NWB#vicidial_users-delete_call_times$NWE
Modifique El Tiempo De la Llamadas: $NWB#vicidial_users-modify_call_times$NWE
\n"; - - if ($LOGdelete_users > 0) - { - echo "

SUPRIMA A ESTE USUARIO\n"; - } - echo "

Chasque aquí para la hoja de tiempo del usuario\n"; - echo "

Chasque aquí para el estado del usuario\n"; - echo "

Clique aquí para ver las estadísticas del usuario\n"; - echo "

Chasque aquí para los asimientos del servicio repetido del usuario\n"; - } - -} - - -###################### -# ADD=31 modify campaign info in the system - Detail view -###################### - -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed - -if ($ADD==31) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $campaign_rec_exten = $row[22]; - $campaign_recording = $row[23]; - $campaign_rec_filename = $row[24]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $am_message_exten = $row[27]; - $amd_send_to_vmx = $row[28]; - $xferconf_a_dtmf = $row[29]; - $xferconf_a_number = $row[30]; - $xferconf_b_dtmf = $row[31]; - $xferconf_b_number = $row[32]; - $alt_number_dialing = $row[33]; - $scheduled_callbacks = $row[34]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; - $safe_harbor_exten = $row[38]; - $display_dialable_count = $row[39]; - $wrapup_seconds = $row[40]; - $wrapup_message = $row[41]; -# $closer_campaigns = $row[42]; - $use_internal_dnc = $row[43]; - -echo "
MODIFIQUE Un EXPEDIENTE De las CAMPAÚAS: $row[0] - Vista Básica"; -echo " | Vista Detallada | "; -echo "Pantalla En tiempo real\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -if (eregi("CLOSER", $campaign_id)) - { - echo "\n"; - } - - - -echo "\n"; -echo "
ID De la Campaña: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Estado del dial 1: $NWB#vicidial_campaigns-dial_status$NWE
Estado del dial 2: $NWB#vicidial_campaigns-dial_status$NWE
Estado del dial 3: $NWB#vicidial_campaigns-dial_status$NWE
Estado del dial 4: $NWB#vicidial_campaigns-dial_status$NWE
Estado del dial 5: $NWB#vicidial_campaigns-dial_status$NWE
Orden De la Lista: $NWB#vicidial_campaigns-lead_order$NWE
Filtro del plomo: $NWB#vicidial_campaigns-lead_filter_id$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Llamar al Siguiente Agente: $NWB#vicidial_campaigns-next_agent_call$NWE
Franja horaria de llamada: $NWB#vicidial_campaigns-local_call_time$NWE
Tiempo de espera Del Dial: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Prefijo al marcar: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
CallerID de la Campaña: $NWB#vicidial_campaigns-campaign_cid$NWE
Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Extensión de Rec de la campaña: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Grabación De la Campaña: $NWB#vicidial_campaigns-campaign_recording$NWE
Nombre de fichero De Rec De la Campaña: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
Mensaje del contestador automático: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD envían a la VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
Transfiera -Conf DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfiera -Conf DTMF 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
El Marcar Del Número Del Alt: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Servicios repetidos Programar: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Segundos De la Llamada De la Gota: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Buzón de Voz: $NWB#vicidial_campaigns-voicemail_ext$NWE
Utilice El Mensaje Seguro Del Puerto: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Puerto Seguro Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Segundos De Wrapup: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Mensaje De Wrapup: $NWB#vicidial_campaigns-wrapup_message$NWE
Utilice La Lista Interna de DNC: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Grupos De entrada Permitidos:
"; - echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; - echo "$groups_list"; - echo "
\n"; - -echo "
\n"; -echo "
LISTAS DENTRO DE ESTA CAMPAÑA:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ID DE LA LISTANOMBRE DE LA LISTAACTIVO
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Esta campaña tiene $active_lists listas activas y $inactive_lists listas inactivas

\n"; - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - PIEL

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - DEMOSTRACIÓN

"; - } - - - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "Esta campaña tiene $hopper_leads Leads en el Hopper

\n"; -echo "Chasque aquí para ver qué plomos están en la tolva ahora

\n"; -echo "Chasque aquí para ver todos los asimientos del servicio repetido en esta campaña

\n"; -echo "
\n"; - - - - -echo "
\n"; -echo "
ESTADOS DE ENCARGO DENTRO DE ESTA CAMPAÚA:   $NWB#vicidial_campaign_statuses$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ESTADODESCRIPCIÓNSELECCIONABLEELIMINAR
$rowx[0]$rowx[1]$rowx[2]ELIMINAR
\n"; - -echo "
AGREGAR ESTADO PERSONALIZADO A LA CAMPAÑA
\n"; -echo "\n"; -echo "\n"; -echo "Estado:   \n"; -echo "Descripción:   \n"; -echo "Seleccionable:   \n"; -echo "
\n"; - -echo "

\n"; - - - -echo "
PERSONALIZAR ACCEDOS DIRECTOS PARA ESTA CAMPAÑA:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ACCESO DIRECTOESTADODESCRIPCIÓNELIMINAR
$rowx[1]$rowx[0]$rowx[2]ELIMINAR
\n"; - -echo "
AÑADIR ACCESO DIRECTO A LA CAMPAÑA
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Acceso Directo:   \n"; -echo "Estado:   \n"; -echo "
\n"; -echo "

\n"; - - - -echo "

PLOMO QUE RECICLA DENTRO DE ESTA CAMPAÑA:   $NWB#vicidial_lead_recycle$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $recycle_to_print = mysql_num_rows($rslt); - $o=0; - while ($recycle_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - -echo "
ESTADOLA TENTATIVA RETRASAMÁXIMO DE LA TENTATIVAACTIVO ELIMINAR
$rowx[2]
\n"; - echo "\n"; - echo "\n"; - echo "
ELIMINAR
\n"; - -echo "
AGREGUE EL NUEVO PLOMO DE LA CAMPAÑA RECICLAN
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Estado:   \n"; -echo "La Tentativa Retrasa: \n"; -echo "Máximo De la Tentativa: \n"; -echo "
\n"; - -echo "

\n"; - -echo "REGISTRE TODOS LOS AGENTES FUERA DE ESTA CAMPAÑA

\n"; - -if ($LOGdelete_campaigns > 0) - { - echo "

SUPRIMA ESTA CAMPAÑA\n"; - } - -} - - -###################### -# ADD=34 modify campaign info in the system - Basic View -###################### - -if ($ADD==34) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $display_dialable_count = $row[39]; - -echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Vista Básica | "; -echo "Vista Detallada | "; -echo "Pantalla En tiempo real\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; -echo "
ID De la Campaña: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Formulario Web: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Estado del dial 1: $NWB#vicidial_campaigns-dial_status$NWE
Estado del dial 2: $NWB#vicidial_campaigns-dial_status$NWE
Estado del dial 3: $NWB#vicidial_campaigns-dial_status$NWE
Estado del dial 4: $NWB#vicidial_campaigns-dial_status$NWE
Estado del dial 5: $NWB#vicidial_campaigns-dial_status$NWE
Orden De la Lista: $NWB#vicidial_campaigns-lead_order$NWE
Filtro del plomo: $NWB#vicidial_campaigns-lead_filter_id$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Forzar el Reinicio del Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Nivel del Auto-Dial: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Script: $script_id
Consiga El Lanzamiento De la Llamada: $get_call_launch
\n"; - -echo "
\n"; -echo "
LISTAS DENTRO DE ESTA CAMPAÑA:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
ID DE LA LISTANOMBRE DE LA LISTAACTIVO
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "Esta campaña tiene $active_lists listas activas y $inactive_lists listas inactivas

\n"; - - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - PIEL

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - DEMOSTRACIÓN

"; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "Esta campaña tiene $hopper_leads Leads en el Hopper

\n"; -echo "Chasque aquí para ver qué plomos están en la tolva ahora

\n"; -echo "Chasque aquí para ver todos los asimientos del servicio repetido en esta campaña

\n"; -echo "
\n"; - -echo "
\n"; - -echo "REGISTRE TODOS LOS AGENTES FUERA DE ESTA CAMPAÑA

\n"; - - -if ($LOGdelete_campaigns > 0) - { - echo "

SUPRIMA ESTA CAMPAÑA\n"; - } - - -} - - -###################### -# ADD=311 modify list info in the system -###################### - -if ($ADD==311) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $Cstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($Cstatuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - # end grab status names - - -echo "
MODIFICAR UN REGISTRO DE LAS LISTAS: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
ID De la Lista: $row[0]$NWB#vicidial_lists-list_id$NWE
Nombre De la Lista: $NWB#vicidial_lists-list_name$NWE
Campaña: $NWB#vicidial_lists-campaign_id$NWE
Activo: $NWB#vicidial_lists-active$NWE
Reiniciar el Lead-Called-Status para esta lista: $NWB#vicidial_lists-reset_list$NWE
\n"; - -echo "
\n"; -echo "
ESTADOS DENTRO DE ESTA LISTA:
\n"; -echo "\n"; -echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $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($rslt); - - $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]] = ($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; - if ($lead_list['count'] > 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 ($dispo == 'CBHOLD') - { - $CLB=""; - $CLE=""; - } - else - { - $CLB=''; - $CLE=''; - } - - echo "\n"; - $o++; - } - } - -echo "\n"; -echo "\n"; - -echo "
ESTADONOMBRE DEL ESTADOLLAMADONO LLAMADO
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; -unset($lead_list); - - - - - -echo "
\n"; -echo "
ZONAS DE TIEMPO DENTRO DE ESTA LISTA:
\n"; -echo "\n"; -echo "\n"; - - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - $plus='+'; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $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]] = ($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++; - } - - if ($lead_list['count'] > 0) - { - while (list($tzone,) = each($lead_list[$since_reset])) - { - $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - - if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} - else {$DISPtzone = "$tzone";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - } - } - -echo "\n"; -echo "\n"; - -echo "
DESPLAZAMIENTO GMT AHORA (tiempo local)LLAMADONO LLAMADO
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALES$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; -unset($lead_list); - - - - - - - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; - $rslt=mysql_query($stmt, $link); - $status_called_to_print = mysql_num_rows($rslt); - - $o=0; - $sts=0; - $first_row=1; - $all_called_first=1000; - $all_called_last=0; - while ($status_called_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $leads_in_list = ($leads_in_list + $rowx[2]); - $count_statuses[$o] = "$rowx[0]"; - $count_called[$o] = "$rowx[1]"; - $count_count[$o] = "$rowx[2]"; - $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); - - if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) - { - if ($first_row) {$first_row=0;} - else {$sts++;} - $status[$sts] = "$rowx[0]"; - $status_called_first[$sts] = "$rowx[1]"; - if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} - } - $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); - $status_called_last[$sts] = "$rowx[1]"; - if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} - - $o++; - } - - - - -echo "
\n"; -echo "
LLAMADAS REALIZADAS DENTRO DE ESTA LISTA:
\n"; -echo "\n"; -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - - $sts=0; - $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 ""; - - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $sts)) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - else - { - if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - - $called_printed=0; - $o=0; - while ($status_called_to_print > $o) - { - if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) - { - $called_printed++; - echo ""; - } - - - $o++; - } - if (!$called_printed) - {echo "";} - $first++; - } - echo "\n\n"; - - $sts++; - } - -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - -echo "
ESTADONOMBRE DEL ESTADO$firstSUBTOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; - - - - - -echo "
\n"; - -if ($LOGdelete_lists > 0) - { - echo "

SUPRIMA ESTA LISTA\n"; - } - -} - - - -###################### -# ADD=3111 modify in-group info in the system -###################### - -if ($ADD==3111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $group_name = $row[1]; - $group_color = $row[2]; - $active = $row[3]; - $web_form_address = $row[4]; - $voicemail_ext = $row[5]; - $next_agent_call = $row[6]; - $fronter_display = $row[7]; - $script_id = $row[8]; - $get_call_launch = $row[9]; - $xferconf_a_dtmf = $row[10]; - $xferconf_a_number = $row[11]; - $xferconf_b_dtmf = $row[12]; - $xferconf_b_number = $row[13]; - $drop_call_seconds = $row[14]; - $drop_message = $row[15]; - $drop_exten = $row[16]; - -echo "
MODIFICAR UN REGISTRO DE LOS GRUPOS: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -echo "\n"; -echo "
ID De Grupo: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Color Del Grupo: $NWB#vicidial_inbound_groups-group_color$NWE
Activo: $NWB#vicidial_inbound_groups-active$NWE
Formulario Web: $NWB#vicidial_inbound_groups-web_form_address$NWE
Llamar al Siguiente Agente: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Mostrar Fronter: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Transfiera -Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfiera -Conf DTMF 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Segundos De la Llamada De la Gota: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Buzón de Voz: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Utilice El Mensaje De la Gota: $NWB#vicidial_inbound_groups-drop_message$NWE
Gota Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
\n"; - -echo "

\n"; - -echo "
\n"; - -if ($LOGdelete_ingroups > 0) - { - echo "

SUPRIMA A ESTE EN-GRUPO\n"; - } - -} - - - -###################### -# ADD=31111 modify remote agents info in the system -###################### - -if ($ADD==31111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Comienzo Del ID del usuario: (Solamente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Del Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensión Externa: (número del dialplan para alcanzar agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Estado: $NWB#vicidial_remote_agents-status$NWE
Campaña: $NWB#vicidial_remote_agents-campaign_id$NWE
Grupos De entrada: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTA: Puede tomar hasta 30 segundos para los cambios sometidos en esta pantalla para ir viva\n"; - - -if ($LOGdelete_remote_agents > 0) - { - echo "

SUPRIMA ESTE AGENTE ALEJADO\n"; - } - -} - - -###################### -# ADD=311111 modify user group info in the system -###################### - -if ($ADD==311111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; -echo ""; - -echo "
MODIFICAR UNA ENTRADA EN LOS GRUPOS DE USUARIOS\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Grupo: (sin espacios o signos de puntuación)$NWB#vicidial_user_groups-user_group$NWE
Descripción: (Descripción del grupo)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -if ($LOGdelete_user_groups > 0) - { - echo "

SUPRIMA A ESTE GRUPO DE USUARIO\n"; - } - -} - - -###################### -# ADD=3111111 modify script info in the system -###################### - -if ($ADD==3111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $script_name = $row[1]; - $script_comments = $row[2]; - $script_text = $row[3]; - $active = $row[4]; -echo ""; - -echo "
MODIFIQUE Una ESCRITURA\n"; -echo "\n"; -echo "\n"; -echo "
Identificación De la Escritura:: $script_id$NWB#vicidial_scripts-script_name$NWE
Nombre de la escritura: (título de la escritura)$NWB#vicidial_scripts-script_name$NWE
Comentarios de la escritura: $NWB#vicidial_scripts-script_comments$NWE
Activo: $NWB#vicidial_scripts-active$NWE
Texto de la escritura:

Escritura De la Inspección previo
$NWB#vicidial_scripts-script_text$NWE
\n"; - -if ($LOGdelete_scripts > 0) - { - echo "

SUPRIMA ESTA ESCRITURA\n"; - } - -} - - -###################### -# ADD=31111111 modify filter info in the system -###################### - -if ($ADD==31111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $lead_filter_name = $row[1]; - $lead_filter_comments = $row[2]; - $lead_filter_sql = $row[3]; -echo ""; - -echo "
MODIFIQUE Un FILTRO\n"; -echo "\n"; -echo "\n"; -echo "
Identificación Del Filtro:$lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Nombre Del Filtro: (descripción corta del filtro)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Comentarios Del Filtro: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filtro Sql: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - -echo "

"; -echo "
PRUEBE EN CAMPAÑA:
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -if ($LOGdelete_filters > 0) - { - echo "

SUPRIMA ESTE FILTRO\n"; - } - -} - - -###################### -# ADD=321111111 modify call time definition info in the system -###################### - -if ($ADD==321111111) -{ -if ($LOGmodify_call_times==1) -{ - -if ( ($stage=="ADD") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - if (eregi("\|$",$ct_state_call_times)) - {$ct_state_call_times = "$ct_state_call_times$state_rule\|";} - else - {$ct_state_call_times = "$ct_state_call_times\|$state_rule\|";} - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "Regla Del Estado Agregada: $state_rule
\n"; - } -if ( ($stage=="REMOVE") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - $ct_state_call_times = eregi_replace("\|$state_rule\|",'|',$ct_state_call_times); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "Regla Del Estado Quitada: $state_rule
\n"; - } - -$ADD=311111111; -} -else -{ -echo "Le no autorizan a visión esta página. Vaya por favor detrás."; -} - -} - - -###################### -# ADD=311111111 modify call time definition info in the system -###################### - -if ($ADD==311111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -$ct_srs=1; -$b=0; -$srs_SQL =''; -if (strlen($ct_state_call_times)>2) - { - $state_rules = explode('|',$ct_state_call_times); - $ct_srs = ((count($state_rules)) - 1); - } -echo "\n"; -echo "\n"; -while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>0) - { - $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - echo "\n"; - $srs_SQL .= "'$state_rules[$b]',"; - $srs_state_SQL .= "'$row[0]',"; - } - $b++; - } -if (strlen($srs_SQL)>2) - { - $srs_SQL = "$srs_SQL''"; - $srs_state_SQL = "$srs_state_SQL''"; - $srs_SQL = "where state_call_time_id NOT IN($srs_SQL) and state_call_time_state NOT IN($srs_state_SQL)"; - } -else - {$srs_SQL='';} -$stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;"; -$rslt=mysql_query($stmt, $link); -$sct_to_print = mysql_num_rows($rslt); -$sct_list=''; - -$o=0; -while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_list .= "\n"; - $o++; -} -echo "\n"; -echo "\n"; - -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $call_time_name = $row[1]; - $call_time_comments = $row[2]; - $ct_default_start = $row[3]; - $ct_default_stop = $row[4]; - $ct_sunday_start = $row[5]; - $ct_sunday_stop = $row[6]; - $ct_monday_start = $row[7]; - $ct_monday_stop = $row[8]; - $ct_tuesday_start = $row[9]; - $ct_tuesday_stop = $row[10]; - $ct_wednesday_start = $row[11]; - $ct_wednesday_stop = $row[12]; - $ct_thursday_start = $row[13]; - $ct_thursday_stop = $row[14]; - $ct_friday_start = $row[15]; - $ct_friday_stop = $row[16]; - $ct_saturday_start = $row[17]; - $ct_saturday_stop = $row[18]; - $ct_state_call_times = $row[19]; - -echo ""; - -echo "
MODIFIQUE Un RATO De la LLAMADA\n"; -echo "\n"; -echo "\n"; -echo "
Identificación Del Tiempo De la Llamada: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Nombre Del Tiempo De la Llamada: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada: $NWB#vicidial_call_times-call_time_comments$NWE
Comienzo Del Defecto: Parada Del Defecto: $NWB#vicidial_call_times-ct_default_start$NWE
Comienzo De Domingo: Parada De Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Lunes: Parada De Lunes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Martes: Parada De Martes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Miércoles: Parada De Miércoles: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Parada De Jueves: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Viernes: Parada De Viernes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Sábado: Parada De Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE
Definiciones activas del tiempo de la llamada del estado para estoexpediente:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Add state call time rule:


\n"; -echo "CAMPAÑAS USANDO ESTE TIEMPO DE LA LLAMADA:
\n"; -echo "\n"; - - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - $CT_camp_id = $row[1]; - $CT_camp_name = $row[2]; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

SUPRIMA ESTA DEFINICIÓN DEL TIEMPO DE LA LLAMADA\n"; - } -} -else -{ -echo "Le no autorizan a visión esta página. Vaya por favor detrás."; -} - -} - - -###################### -# ADD=3111111111 modify state call time definition info in the system -###################### - -if ($ADD==3111111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $state_call_time_state =$row[1]; - $call_time_name = $row[2]; - $call_time_comments = $row[3]; - $ct_default_start = $row[4]; - $ct_default_stop = $row[5]; - $ct_sunday_start = $row[6]; - $ct_sunday_stop = $row[7]; - $ct_monday_start = $row[8]; - $ct_monday_stop = $row[9]; - $ct_tuesday_start = $row[10]; - $ct_tuesday_stop = $row[11]; - $ct_wednesday_start = $row[12]; - $ct_wednesday_stop = $row[13]; - $ct_thursday_start = $row[14]; - $ct_thursday_stop = $row[15]; - $ct_friday_start = $row[16]; - $ct_friday_stop = $row[17]; - $ct_saturday_start = $row[18]; - $ct_saturday_stop = $row[19]; - -echo ""; - -echo "
_ MODIFICAR Uno ESTADO LLAMAR TIEMPO
\n"; -echo "\n"; -echo "\n"; -echo "
Identificación Del Tiempo De la Llamada: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
_ Estado Llamar Tiempo Nombre: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada Del Estado: $NWB#vicidial_call_times-call_time_comments$NWE
Comienzo Del Defecto: Parada Del Defecto: $NWB#vicidial_call_times-ct_default_start$NWE
Comienzo De Domingo: Parada De Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Lunes: Parada De Lunes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Martes: Parada De Martes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Miércoles: Parada De Miércoles: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Parada De Jueves: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Viernes: Parada De Viernes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Sábado: Parada De Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; -echo "TIEMPOS DE LA LLAMADA USANDO ESTE TIEMPO DE LA LLAMADA DEL ESTADO:
\n"; -echo "\n"; - - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

SUPRIMA ESTA DEFINICIÓN DEL TIEMPO DE LA LLAMADA DEL ESTADO\n"; - } - -} -else -{ -echo "Le no autorizan a visión esta página. Vaya por favor detrás."; -} - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo "
\n"; -echo ""; - -echo "
BUSCAR UN USUARIO\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
NÚmero De Usuario:
Nombre Completo:
Nivel Del Usuario:
Grupo Del Usuario:
\n"; - -} - -###################### -# ADD=66 user search results -###################### - -if ($ADD==66) -{ -echo "
\n"; - echo ""; - - $SQL = ''; - if ($user) {$SQL .= " user LIKE \"%$user%\" and";} - if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";} - if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";} - if ($user_group) {$SQL .= " user_group = '$user_group' and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
RESULTADOS DE LA BÚSQUEDA:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFICAR | ESTADÍSTICAS | ESTADO | TIME
\n"; - -} - - -###################################################################################################### -###################################################################################################### -####### 8 series, Callback lists -###################################################################################################### -###################################################################################################### - -###################### -# ADD=8 find all callbacks on hold by a User -###################### -if ($ADD==8) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user='$user' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
USER CALLBACK HOLD LISTINGS: $user\n"; -$ADD='82'; -} - -###################### -# ADD=81 find all callbacks on hold within a Campaign -###################### -if ($ADD==81) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and campaign_id='$campaign_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN CALLBACK HOLD LISTINGS: $campaign_id\n"; -$ADD='82'; -} - -###################### -# ADD=811 find all callbacks on hold within a List -###################### -if ($ADD==811) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and list_id='$list_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; -$ADD='82'; -} - -###################### -# ADD=82 display all callbacks on hold -###################### -if ($ADD==82) -{ -echo "
\n"; -echo "
\n"; -echo "\n"; - - $o=0; - while ($cb_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
LEADLISTCAMPAIGNENTRY FECHACALLBACK FECHAUSERRECIPIENTESTADO
$row[1]$row[2]$row[3]$row[5]$row[6]$row[8]$row[9]$row[4]
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 0 series, displays and searches -###################################################################################################### -###################################################################################################### - -###################### -# ADD=0 display all active users -###################### -if ($ADD==0) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users order by full_name"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USUARIOS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFICAR | ESTADÍSTICAS | ESTADO | TIME
\n"; -} - -###################### -# ADD=10 display all campaigns -###################### -if ($ADD==10) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
CAMPAÑAS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  MODIFICAR
\n"; -} - - -###################### -# ADD=100 display all lists -###################### -if ($ADD==100) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists order by list_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
LISTAS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]  MODIFICAR
\n"; -} - - - -###################### -# ADD=1000 display all inbound groups -###################### -if ($ADD==1000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
GRUPOS DE ENTRADA :\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[5]  MODIFICAR
\n"; -} - - -###################### -# ADD=10000 display all remote agents -###################### -if ($ADD==10000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
AGENTES REMOTOS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFICAR
\n"; -} - - -###################### -# ADD=100000 display all user groups -###################### -if ($ADD==100000) -{ -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 "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
GRUPOS DE USUARIO :\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFICAR
\n"; -} - - -###################### -# ADD=1000000 display all scripts -###################### -if ($ADD==1000000) -{ -echo "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
ESCRITURAS DE LA VISIÓN:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFICAR
\n"; -} - - -###################### -# ADD=10000000 display all filters -###################### -if ($ADD==10000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
LISTADOS DEL FILTRO DEL PLOMO:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFICAR
\n"; -} - - -###################### -# ADD=100000000 display all call times -###################### -if ($ADD==100000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
LISTADOS DEL TIEMPO DE LA LLAMADA:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[4] MODIFICAR
\n"; -} - -###################### -# ADD=1000000000 display all state call times -###################### -if ($ADD==1000000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
LISTADOS DEL TIEMPO DE LA LLAMADA DEL ESTADO:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFICAR
\n"; -} - - - - - -echo "
\n"; - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds"; -echo "             VERSIÓN: $version"; -echo "             CONSTRUCCION: $build
\n"; - - -?> - - -
- - - -1) - { - $g=0; - $p='13'; - $GMT_gmt[0] = ''; - $GMT_hour[0] = ''; - $GMT_day[0] = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $pmin=(gmdate("i", time() + $pzone)); - $phour=( (gmdate("G", time() + $pzone)) * 100); - $pday=gmdate("w", time() + $pzone); - $tz = sprintf("%.2f", $p); - $GMT_gmt[$g] = "$tz"; - $GMT_day[$g] = "$pday"; - $GMT_hour[$g] = ($phour + $pmin); - $p = ($p - 0.25); - $g++; - } - - $stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $Gct_default_start = "$rowx[3]"; - $Gct_default_stop = "$rowx[4]"; - $Gct_sunday_start = "$rowx[5]"; - $Gct_sunday_stop = "$rowx[6]"; - $Gct_monday_start = "$rowx[7]"; - $Gct_monday_stop = "$rowx[8]"; - $Gct_tuesday_start = "$rowx[9]"; - $Gct_tuesday_stop = "$rowx[10]"; - $Gct_wednesday_start = "$rowx[11]"; - $Gct_wednesday_stop = "$rowx[12]"; - $Gct_thursday_start = "$rowx[13]"; - $Gct_thursday_stop = "$rowx[14]"; - $Gct_friday_start = "$rowx[15]"; - $Gct_friday_stop = "$rowx[16]"; - $Gct_saturday_start = "$rowx[17]"; - $Gct_saturday_stop = "$rowx[18]"; - $Gct_state_call_times = "$rowx[19]"; - - $ct_states = ''; - $ct_state_gmt_SQL = ''; - $ct_srs=0; - $b=0; - if (strlen($Gct_state_call_times)>2) - { - $state_rules = explode('|',$Gct_state_call_times); - $ct_srs = ((count($state_rules)) - 2); - } - while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>1) - { - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Gstate_call_time_id = "$row[0]"; - $Gstate_call_time_state = "$row[1]"; - $Gsct_default_start = "$row[4]"; - $Gsct_default_stop = "$row[5]"; - $Gsct_sunday_start = "$row[6]"; - $Gsct_sunday_stop = "$row[7]"; - $Gsct_monday_start = "$row[8]"; - $Gsct_monday_stop = "$row[9]"; - $Gsct_tuesday_start = "$row[10]"; - $Gsct_tuesday_stop = "$row[11]"; - $Gsct_wednesday_start = "$row[12]"; - $Gsct_wednesday_stop = "$row[13]"; - $Gsct_thursday_start = "$row[14]"; - $Gsct_thursday_stop = "$row[15]"; - $Gsct_friday_start = "$row[16]"; - $Gsct_friday_stop = "$row[17]"; - $Gsct_saturday_start = "$row[18]"; - $Gsct_saturday_stop = "$row[19]"; - - $ct_states .="'$Gstate_call_time_state',"; - - $r=0; - $state_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday tiempo local - { - if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday tiempo local - { - if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday tiempo local - { - if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday tiempo local - { - if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday tiempo local - { - if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday tiempo local - { - if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday tiempo local - { - if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - $state_gmt = "$state_gmt'99'"; - $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; - } - - $b++; - } - if (strlen($ct_states)>2) - { - $ct_states = eregi_replace(",$",'',$ct_states); - $ct_statesSQL = "and state NOT IN($ct_states)"; - } - else - { - $ct_statesSQL = ""; - } - - $r=0; - $default_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday tiempo local - { - if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday tiempo local - { - if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday tiempo local - { - if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday tiempo local - { - if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday tiempo local - { - if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday tiempo local - { - if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday tiempo local - { - if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - - $default_gmt = "$default_gmt'99'"; - $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; - - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL"; - #$DB=1; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rslt_rows = mysql_num_rows($rslt); - if ($rslt_rows) - { - $rowx=mysql_fetch_row($rslt); - $active_leads = "$rowx[0]"; - } - else {$active_leads = '0';} - - echo "Esta campaña tiene $active_leads Leads para ser llamados en estas listas\n"; - } - else - { - echo "ningunas listas activas seleccionadas para esta campaña\n"; - } - } -else - { - echo "ningunas listas activas seleccionadas para esta campaña\n"; - } -##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### -} -?> diff --git a/LANG_admin/vicidial_es/admin_changes_log.txt b/LANG_admin/vicidial_es/admin_changes_log.txt deleted file mode 100644 index 9664215b..00000000 --- a/LANG_admin/vicidial_es/admin_changes_log.txt +++ /dev/null @@ -1,5 +0,0 @@ -Mon, 26 Sep 2005 12:20:13 -0400|MODIFY CAMPAIGN INFO|444|10.10.10.19|campaign_name='Test campaign for VICIDIAL 2',active='Y',dial_status_a='NEW',dial_status_b='N',dial_status_c='DROP',dial_status_d='A',dial_status_e='B',lead_order='DOWN',allow_closers='Y',hopper_level='100', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='24hours', voicemail_ext='138', dial_timeout='28', dial_prefix='9', campaign_cid='0000000000', campaign_vdad_exten='8365' where campaign_id='TESTCAMP'|N| -Mon, 26 Sep 2005 17:31:20 -0400|MODIFY USER INFO |444|10.10.10.19|pass='sales',full_name='1 - TESTCAMP remote agent',user_level='4',user_group='ADMIN' where user='123456'| -Fri, 28 Apr 2006 11:34:07 -0400|MODIFY CAMPAIGN INFO|123456|10.10.8.19|campaign_name='Test campaign for VICIDIAL 2',active='Y',dial_status_a='NA',dial_status_b='NP',dial_status_c='DROP',dial_status_d='N',dial_status_e='A',lead_order='DOWN COUNT',allow_closers='Y',hopper_level='50', auto_dial_level='1', next_agent_call='oldest_call_finish', local_call_time='24hours', voicemail_ext='138', dial_timeout='50', dial_prefix='9', campaign_cid='8775154102', campaign_vdad_exten='8365', web_form_address='http://10.10.10.196/vicidial/closer-fronter_popupX2-1.php', park_ext='8305', park_file_name='classical', campaign_rec_exten='8309', campaign_recording='ONDEMAND', campaign_rec_filename='TINYDATE_AGENT_CUSTPHONE', campaign_script='TESTCAMP04', get_call_launch='NONE', am_message_exten='8320', amd_send_to_vmx='N', xferconf_a_dtmf='1234',xferconf_a_number='7274514920', xferconf_b_dtmf='4321',xferconf_b_number='7274514032',lead_filter_id='NEWHIGH',alt_number_dialing='N',scheduled_callbacks='Y' where campaign_id='TESTCAMP'|N| -Fri, 28 Apr 2006 11:34:38 -0400|RESET LIST CALLED |123456|10.10.8.19|list_name='test domestic lists'| -Fri, 28 Apr 2006 11:34:38 -0400|MODIFY LIST INFO |123456|10.10.8.19|list_name='test domestic lists',campaign_id='TESTCAMP',active='Y' where list_id='101'| diff --git a/LANG_admin/vicidial_es/admin_modify_lead.php b/LANG_admin/vicidial_es/admin_modify_lead.php deleted file mode 100644 index 7cb31f31..00000000 --- a/LANG_admin/vicidial_es/admin_modify_lead.php +++ /dev/null @@ -1,476 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} -if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} - elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} -if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} - elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} -if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} - elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} - elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead - -# CHANGES -# -# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user -# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60609-1112 - Added DNC list addition if status changed to DNC -# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat -# - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Registro del Lead modificado - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Información modificada

\n"; - echo "\n"; - - if ( ($dispo != $status) and ($dispo == 'CBHOLD') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - - if ( ($dispo != $status) and ($status == 'DNC') ) - { - ### add lead to the internal DNC list - $stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; - } - -} -else -{ - - if ($CBchangeUSERtoANY == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to ANYONE
\n"; - } - if ($CBchangeUSERtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record user changed to $CBuser
\n"; - } - if ($CBchangeANYtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; - } - - - - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Información de la llamada: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     ID De la Lista: $list_id
Nombre:   \n"; - echo " Apellidos:
Dirección 1 :
Dirección 2 :
Dirección 3 :
Ciudad :
Estado:   \n"; - echo " Código Postal:
Provincia:
País :
Alt Phone :
Email :
Seguridad:
Comentarios :
Disposición:
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select * from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } - - - - - - - } - else - { - echo "las operaciones de búsqueda del plomo FALLARON para el lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - -echo "

\n"; - -echo "
\n"; - -echo "LLAMADAS A ESTE LEAD:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD
$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial_es/admin_search_lead.php b/LANG_admin/vicidial_es/admin_search_lead.php deleted file mode 100644 index 9867543d..00000000 --- a/LANG_admin/vicidial_es/admin_search_lead.php +++ /dev/null @@ -1,224 +0,0 @@ - LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php -# -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead -# -# changes: -# 60620-1055 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - Changed results to multi-record -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Buscar Lead - -Operaciones de búsqueda del Lead - - - -
\n"; - echo "
\n"; - echo "\n"; - echo "Por favor, Introduzca un:
Vendor ID(código del vendedor del Lead): or \n"; - echo "
un número de teléfono de casa: or\n"; - echo "
ID del Lead:

\n"; - echo "
\n"; - echo "\n
\n"; - echo "\n"; - exit; - } - -else - { - - if ($vendor_id) - { - $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000"; - } - else - { - if ($phone) - { - $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000"; - } - else - { - if ($lead_id) - { - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000"; - } - else - { - print "ERROR: you must search for something! Go back and search for something"; - exit; - } - } - } - if ($DB) - { - echo "\n\n$stmt\n\n"; - } - - $rslt=mysql_query($stmt, $link); - $results_to_print = mysql_num_rows($rslt); - if ($results_to_print < 1) - { - echo date("l F j, Y G:i:s A"); - echo "\n

\n"; - echo "Las variables de la búsqueda que usted incorporó no son activas en el sistema

\n"; - echo "Va por favor detrás y dobla el cheque la información que usted incorporó y somete otra vez\n"; - echo "
\n"; - echo "\n"; - exit; - } - else - { - echo "RESULTS: $results_to_print

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $o=0; - while ($results_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $o++; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "
#LEAD IDESTADOVENDOR IDLAST AGENTID DE LA LISTAPHONENOMBRECITYSECURITYLAST CALL
$o$row[0]$row[3]$row[5]$row[4]$row[7]$row[11]$row[13] $row[15]$row[19]$row[28]$row[2]
\n"; - } - } - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\nNUEVA BÚSQUEDA"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds"; - - -?> - - - - - diff --git a/LANG_admin/vicidial_es/count.htm b/LANG_admin/vicidial_es/count.htm deleted file mode 100644 index 51f8a361..00000000 --- a/LANG_admin/vicidial_es/count.htm +++ /dev/null @@ -1 +0,0 @@ - diff --git a/LANG_admin/vicidial_es/dbconnect.php b/LANG_admin/vicidial_es/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_admin/vicidial_es/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_admin/vicidial_es/group_hourly_stats.php b/LANG_admin/vicidial_es/group_hourly_stats.php deleted file mode 100644 index 9323fcef..00000000 --- a/LANG_admin/vicidial_es/group_hourly_stats.php +++ /dev/null @@ -1,252 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1014 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];} - elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$date_with_hour_default = date("Y-m-d H"); -$date_no_hour_default = $TODAY; - -if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} - $date_no_hour = $date_with_hour; - $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - -# $stmt="SELECT full_name from vicidial_users where user='$user';"; -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: Stats Cada hora Del Grupo -\n"; -?> - - -
- - - - - -= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDtotal[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDday[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDcount[$o] = "$row[0]"; - $o++; - } - -echo "
  VICIDIAL ADMIN: Stats Cada hora Del Grupo  
\n"; - -echo "
\n"; - -echo "CUENTAS DE HORAS DE TSR: $group | $status | $date_with_hour | $date_no_hour\n"; - -echo "
\n"; -echo "\n"; - - $day_calls=0; - $hour_calls=0; - $total_calls=0; - $o=0; - while($o < $tsrs_to_print) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $VDtotal[$o]); - $hour_calls = ($hour_calls + $VDcount[$o]); - $day_calls = ($day_calls + $VDday[$o]); - - $o++; - } - -echo "\n"; - - -} - -echo "
TSR ID   $status   LLAMADAS TOTALES   $status DAY    
$VDuser[$o] $VDname[$o] $VDcount[$o] $VDtotal[$o] $VDday[$o]MODIFICAR | ESTADÍSTICAS
TOTAL $status $hour_calls $total_calls $day_calls
\n"; -echo "

\n"; - - - echo "
Inscriba por favor a grupo que usted desea conseguir el stats cada hora para:
\n"; - echo "\n"; - echo "group:
\n"; - echo "status:   (example: XFER)
\n"; - echo "date with hour:   (example: 2004-06-25 14)
\n"; - echo "\n"; - echo "


\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_es/help.gif b/LANG_admin/vicidial_es/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/LANG_admin/vicidial_es/help.gif and /dev/null differ diff --git a/LANG_admin/vicidial_es/listloader.php b/LANG_admin/vicidial_es/listloader.php deleted file mode 100644 index b4a89d27..00000000 --- a/LANG_admin/vicidial_es/listloader.php +++ /dev/null @@ -1,698 +0,0 @@ - LICENSE: GPLv2 -# -# AST Web GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1006 - added listID override and gmt_offset lookup while loading -# 60619-1652 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -# - -$version = '1.1.12'; -$build = '60619-1652'; - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];} -$list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$ENVIAR=$_GET["ENVIAR"]; if (!$ENVIAR) {$ENVIAR=$_POST["ENVIAR"];} - - -#$DB=1; -#$DBX=1; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('listloader.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"AYUDA\""; - - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -?> - - - - - - method=post enctype="multipart/form-data"> -
- - - - - - - - - - - - - -
Cargar Leads de este archivo:
ID De la Lista Override: (Solamente números or leave blank for values in the file)
CHASQUE AQUÍ PARA IR AL CARGADOR ESTUPENDO DEL PLOMO (BETA VERSIÓN)     DE NUEVO AL ADMIN
- -document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - $pulldate=date("Y-m-d H:i:s"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("./vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Procesando$delim_name-delimited file... ($tab_count|$pipe_count)\n"; - - if (strlen($list_id_override)>0) - { - print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city = $row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) - { - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $gmt_offset = '0'; - $called_since_last_reset='N'; - - if (strlen($list_id_override)>0) - { - # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =='1') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### MEXICO ### - if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### AUSTRALIA ### - if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # tiempo local calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: El archivo no tiene el número requerido de los campos para procesarlo.
"; - } - print ""; -} else if (filesize($leadfile)>8388608) { - print "
ERROR: El archivo excede el límite 8MB.
"; -} -?> - - diff --git a/LANG_admin/vicidial_es/listloaderMAIN.php b/LANG_admin/vicidial_es/listloaderMAIN.php deleted file mode 100644 index fa31b764..00000000 --- a/LANG_admin/vicidial_es/listloaderMAIN.php +++ /dev/null @@ -1,79 +0,0 @@ - LICENSE: GPLv2 -# -# this is the main frame page for the lead loading section. This is where you -# would upload a file and have it inserted into vicidial_list -# -# changes: -# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - -VICIDIAL: Módulo Cargador de Leads - - - - - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/new_listloader_superL.php b/LANG_admin/vicidial_es/new_listloader_superL.php deleted file mode 100644 index dcc2935a..00000000 --- a/LANG_admin/vicidial_es/new_listloader_superL.php +++ /dev/null @@ -1,1364 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60113-1603 - Fixed a few bugs in Excel import -# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1240 - added listID override -# 60616-1604 - added gmt lookup for each lead -# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. - -$version = '1.1.12-1'; -$build = '60619-1651'; - - -require("dbconnect.php"); - -### links used for testing -#$link=mysql_connect("10.10.10.15", "cron", "1234"); -#mysql_select_db("asterisk"); -#$WeBServeRRooT = '/home/www/htdocs'; - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} - elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} -if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} - elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} -if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} - elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} -if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} - elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} -if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} - elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} -if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} - elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} -if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} - elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} -if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} - elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} -if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} - elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} -if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} - elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} -if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} - elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} -if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} - elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} -if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} - elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} -if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} - elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} -if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} - elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} -if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} - elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} -if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} - elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} -if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} - elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} -if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} - elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} -if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} - elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} -if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} - elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} -if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} - elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} -if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} - elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} -if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} - elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} -if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} - elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} -if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} - elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} -if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} - elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} -if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} - elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); - -# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"AYUDA\""; - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -function macfontfix($fontsize) { - - $browser = getenv("HTTP_USER_AGENT"); - $pctype = explode("(", $browser); - if (ereg("Mac",$pctype[1])) { - /* Browser is a Mac. If not Netscape 6, raise fonts */ - - $blownbrowser = explode('/', $browser); - $ver = explode(' ', $blownbrowser[1]); - $ver = $ver[0]; - if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); - - } else return $fontsize; /* Browser is not a Mac - don't touch fonts */ -} - -echo "\n"; - -?> - - - -VICIDIAL ADMIN: Super Lead Loader - - -
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - - - - - - - - - - - - - - - - - - - - -
Cargar Leads de este archivo:
ID De la Lista Override: (Solamente números or leave blank for values in the file)
Disposición de archivo a utilizar:VICIDIAL Estándar    Disposición de encargo
        
CHASQUE AQUÍ PARA IR AL CARGADOR DEL PLOMO DEL BASIC         DE NUEVO AL ADMIN
CARGADOR ESTUPENDO DE LA LISTA-     VERSIÓN:     CONSTRUCCION:
- - -document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - $total=0; $good=0; $bad=0; - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Procesando$delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - - if (strlen($list_id_override)>0) - { - # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: El archivo no tiene el número requerido de los campos para procesarlo.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - print "
ProcesandoExcel file... \n"; - if (strlen($list_id_override)>0) - { - print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

\n"; - } - # print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override"); - } else { - # copy($leadfile, "./vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
ProcesandoCSV file... \n"; - if (strlen($list_id_override)>0) - { - print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - } - print ""; - } - -if ($leadfile && filesize($LF_path)<=8388608) { - $total=0; $good=0; $bad=0; - if ($file_layout=="standard") { - - print ""; - flush(); - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Procesando$delim_name-delimited file... ($tab_count|$pipe_count)\n"; - if (strlen($list_id_override)>0) - { - print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - } - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: El archivo no tiene el número requerido de los campos para procesarlo.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
ProcesandoCSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } - print ""; - - } else { - print "
"; - flush(); - print "\r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Procesando$delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - } - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
ProcesandoCSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - $total=0; $good=0; $bad=0; - $row=fgetcsv($file, 1000, ","); - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print "
VICIDIAL ColumnaDatos del archivo
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
        
\r\n"; - # } - print ""; - } -} else if (filesize($leadfile)>8388608) { - print "
ERROR: El archivo excede el límite 8MB.
"; -} -?> - - - - - - - - - 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### MEXICO ### -if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### AUSTRALIA ### -if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### ALL OTHER COUNTRY CODES ### -if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - -### Find out if DST to raise the gmt offset ### -$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); -$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - -$AC_processed=0; -if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # tiempo local calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # tiempo local calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } -if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - -return $gmt_offset; -} \ No newline at end of file diff --git a/LANG_admin/vicidial_es/project_auth_entries.txt b/LANG_admin/vicidial_es/project_auth_entries.txt deleted file mode 100644 index 6269ce8e..00000000 --- a/LANG_admin/vicidial_es/project_auth_entries.txt +++ /dev/null @@ -1,170 +0,0 @@ -VICIDIAL|GOOD|Thu, 22 Sep 2005 17:42:04 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Thu, 22 Sep 2005 17:42:10 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Thu, 22 Sep 2005 18:35:53 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 11:28:16 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 11:32:26 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 11:32:28 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 12:39:09 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 12:52:43 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 12:52:45 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 14:33:18 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 14:33:20 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 16:31:02 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 16:31:09 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 16:31:11 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 16:31:13 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 16:31:15 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Fri, 23 Sep 2005 16:31:16 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:05:06 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:05:10 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:05:12 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:05:16 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:06 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:10 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:15 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:19 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:22 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:32 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:34 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:38 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:41 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:47 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:06:55 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:07:22 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:07:23 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:07:26 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:07:36 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:20:02 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:20:13 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:20:21 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:20:24 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 12:20:26 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 13:04:03 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -LIST_LOAD|GOOD|Mon, 26 Sep 2005 13:04:19 -0400|lead|load|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|| -VICIDIAL|GOOD|Mon, 26 Sep 2005 13:14:49 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 13:14:53 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -LIST_LOAD|GOOD|Mon, 26 Sep 2005 13:15:08 -0400|lead|load|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|| -VICIDIAL|GOOD|Mon, 26 Sep 2005 13:56:12 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 13:56:15 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VD_CLOSER|GOOD|Mon, 26 Sep 2005 13:56:28 -0400|over|ride|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|| -VICIDIAL|GOOD|Mon, 26 Sep 2005 16:17:15 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:01 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:04 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:05 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:07 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:13 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:20 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:29 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:34 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:37 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:39 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:41 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:47 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Mon, 26 Sep 2005 17:31:53 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:47:44 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:47:46 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:47:48 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:47:50 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:47:53 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Wed, 28 Sep 2005 17:47:54 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 30 Sep 2005 15:48:44 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 30 Sep 2005 15:48:46 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 30 Sep 2005 15:48:48 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 30 Sep 2005 15:48:52 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 30 Sep 2005 15:59:10 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:09:19 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:09:36 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:09:36 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:09:53 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:11:06 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:13 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:40 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:41 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:41 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:42 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:42 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:44 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:46 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:47 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:47 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:50 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:52 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:54 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:54 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -LIST_LOAD|GOOD|Thu, 06 Oct 2005 10:12:55 -0400|lead|load|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:58 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:12:59 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:00 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:00 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:02 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:04 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:04 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:06 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:06 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:09 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:52 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:13:59 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:26:16 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:26:17 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 06 Oct 2005 10:26:19 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 07 Oct 2005 10:09:58 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 07 Oct 2005 10:10:01 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 07 Oct 2005 10:10:05 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 07 Oct 2005 10:10:07 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 07 Oct 2005 10:10:12 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 07 Oct 2005 10:10:39 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Fri, 07 Oct 2005 10:36:07 -0400|444|444|10.10.10.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 10 Nov 2005 15:02:07 -0500|444|444|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 10 Nov 2005 15:02:19 -0500|444|444|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 10 Nov 2005 15:02:23 -0500|444|444|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 10 Nov 2005 15:02:29 -0500|444|444|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 10 Nov 2005 15:02:34 -0500|444|444|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Thu, 10 Nov 2005 15:03:08 -0500|444|444|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|Manager| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:02:45 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Tue, 22 Nov 2005 15:29:13 -0500|6666|sales|10.10.6.1|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|test user| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:05:59 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:06:07 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:06:10 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:06:33 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:06:38 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 22 Dec 2005 17:09:05 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Fri, 23 Dec 2005 14:39:34 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:10 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:13 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 19 Jan 2006 15:38:14 -0500|123456|bob5|10.10.6.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 03 Mar 2006 16:14:23 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 03 Mar 2006 16:14:38 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 03 Mar 2006 16:14:55 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 17 Mar 2006 14:22:24 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 17 Mar 2006 14:22:27 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 17 Mar 2006 14:22:29 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 17 Mar 2006 14:59:52 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 17 Mar 2006 14:59:53 -0500|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:03:08 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:34:00 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 17:34:03 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 18:00:32 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:09:43 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:12:38 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:13:31 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:13:43 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:13:50 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:13:53 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:13:55 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:13:57 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:14:01 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:08 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 22:18:12 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Thu, 27 Apr 2006 23:40:33 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:33:41 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:33:43 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:33:47 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:33:49 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:34:07 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:34:20 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:34:24 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:34:26 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:34:38 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:34:46 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:34:50 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| -VICIDIAL|GOOD|Fri, 28 Apr 2006 11:35:52 -0400|123456|bob5|10.10.8.19|Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7|1 - MATT admin| diff --git a/LANG_admin/vicidial_es/remote_dispo.php b/LANG_admin/vicidial_es/remote_dispo.php deleted file mode 100644 index 79c582c2..00000000 --- a/LANG_admin/vicidial_es/remote_dispo.php +++ /dev/null @@ -1,327 +0,0 @@ - LICENSE: GPLv2 -### -# this is the remote agent disposition screen for calls sent to remote agents. This allows the remote agent to modify customer information and disposition the call - -# CHANGES -# -# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat -# - - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -REMOTE VICIDIAL: Disposición De la Llamada -\n"; -?> - - -
- -"; - -if ($end_call > 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "La llamada ha sido dispositioned       $NOW_TIME\n

\n"; - - echo "
\n"; - -} -else -{ - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Información de la llamada: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     ID De la Campaña: $campaign_id
Fronter: $tsr     ID De la Lista: $list_id
Nombre:   \n"; - echo " Apellidos:
Dirección 1 :
Dirección 2 :
Dirección 3 :
Ciudad :
Estado:   \n"; - echo " Código Postal:
Provincia:
País :
Alt Phone :
Email :
Seguridad:
Comentarios :
Disposición:
\n"; - echo "


\n"; - - } - else - { - echo "las operaciones de búsqueda del plomo FALLARON para el lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_admin/vicidial_es/server_stats.php b/LANG_admin/vicidial_es/server_stats.php deleted file mode 100644 index 6192c6d5..00000000 --- a/LANG_admin/vicidial_es/server_stats.php +++ /dev/null @@ -1,96 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: ESTADÍSTICAS DEL SERVIDOR and Reports -VICIDIAL: ESTADÍSTICAS DEL SERVIDOR and Reports                           -DE NUEVO AL ADMIN

- - -

-
- $o)
-	{
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	$o++;
-	}
-
-?>
-
SERVERDESCRIPCIÓNIP ADDRESSACTIVOVDAD timeVDcall timePARK timeCLOSER/INBOUND time
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
- - \ No newline at end of file diff --git a/LANG_admin/vicidial_es/user_stats.php b/LANG_admin/vicidial_es/user_stats.php deleted file mode 100644 index 04d67509..00000000 --- a/LANG_admin/vicidial_es/user_stats.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: User Stats -\n"; -?> - - -
- - - - - -\n"; -echo "
  VICIDIAL ADMIN: User Stats for  
  \n"; - -echo "
\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - -echo "
\n"; - -echo "TIEMPO Y ESTADO DE CONVERSACIÓN:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - -echo "\n"; -echo "
ESTADOCUENTAHORAS:MINUTOS
$row[1] $row[0] $call_hours_int:$call_minutes_int
LLAMADAS TOTALES $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "TIEMPO LOGIN/LOGOUT:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); - $event_minutes = ($event_hours - $event_hours_int); - $event_minutes = ($event_minutes * 60); - $event_minutes_int = round($event_minutes, 0); - if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - } - - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - -$total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); -$total_login_minutes = ($total_login_hours - $total_login_hours_int); -$total_login_minutes = ($total_login_minutes * 60); -$total_login_minutes_int = round($total_login_minutes, 0); -if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} - -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "
EVENTO FECHA CAMPAÑAHORAS:MINUTOS
$row[0] $row[2] $row[3]
$row[0] $row[2] $row[3] $event_hours_int:$event_minutes_int
$row[0] $row[2] $row[3]
TOTAL $total_login_hours_int:$total_login_minutes_int
\n"; - - -echo "

\n"; - -echo "
\n"; - -echo "ÚLTIMAS 50 LLAMADAS:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS PHONE CAMPAÑA LIST LEAD
$row[4] $row[7] $row[8] $row[10] $row[3] $row[2] $row[1]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_es/user_status.php b/LANG_admin/vicidial_es/user_status.php deleted file mode 100644 index 477db530..00000000 --- a/LANG_admin/vicidial_es/user_status.php +++ /dev/null @@ -1,238 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $change_agent_campaign=$row[1]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - $stmt="SELECT * from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $agents_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $agents_to_print) - { - $row=mysql_fetch_row($rslt); - $Aserver_ip = $row[2]; - $Asession_id = $row[3]; - $Aextension = $row[4]; - $Astatus = $row[5]; - $Acampaign = $row[7]; - $Alast_call = $row[14]; - $Acl_campaigns = $row[15]; - $i++; - } - - } - -$stmt="select * from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - - - -?> - - -VICIDIAL ADMIN: User Status -\n"; -?> - - -
-
- - - - -\n"; -echo "
  VICIDIAL ADMIN: User Status for  
  \n"; - -if ($stage == "live_campaign_change") -{ - $stmt="UPDATE vicidial_live_agents set campaign_id='" . mysql_real_escape_string($group) . "' where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name changed to $group campaign
\n"; - - exit; -} - -if ($stage == "log_agent_out") -{ - $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser
\n"; - - exit; -} - -if ($agents_to_print > 0) -{ - echo "
";
-	echo "Agent Logged in at server:  $Aserver_ip\n";
-	echo "               in session:  $Asession_id\n";
-	echo "               from phone:  $Aextension\n";
-	echo "Agent is in campaign:       $Acampaign\n";
-	echo "              status:       $Astatus\n";
-	echo " hungup last call at:       $Alast_call\n";
-	echo "       Closer groups:       $Acl_campaigns\n\n";
-
-	echo "
"; - - - if ($change_agent_campaign > 0) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "Current Campaña: \n"; - echo "
\n"; - - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - } -} - -else -{ - echo "Agent is not logged in\n
"; - -} - - -echo "           $user - $full_name - \n"; - -echo "VICIDIAL Time Sheet\n"; - -echo "
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - -echo "|$stage|$group|"; - -?> - - -
- - - - - - - - - diff --git a/LANG_admin/vicidial_es/vdremote.php b/LANG_admin/vicidial_es/vdremote.php deleted file mode 100644 index b0eef2f5..00000000 --- a/LANG_admin/vicidial_es/vdremote.php +++ /dev/null @@ -1,602 +0,0 @@ - LICENSE: GPLv2 -# -# Changes -# 50307-1721 - First version -# 51123-1502 - removed requirement of PHP Globals=on -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time - -$version = '1.1.12'; -$build = '60619-1603'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} - elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} - -if (!isset($force_logout)) {$force_logout = 0;} - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Usted ahora ha salido. Gracias\n"; - exit; -} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$popup_page = './closer_popup.php'; -$STARTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - $stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $authx=$row[0]; - - if($authx>0) - { - $stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id=$row[0]; - $server_ip=$row[1]; - if (!$number_of_lines) {$number_of_lines=$row[2];} - - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; - exit; - } - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -if ($ADD==61111) - { - echo"\n"; - } -echo "\n"; -?> - -VICIDIAL, AGENTES REMOTOS: $LOGfullname - $PHP_AUTH_USER "; - -if (!$ADD) {$ADD="31111";} -if ($ADD==31111) {echo "Modificar Agentes Remotos";} -if ($ADD==41111) {echo "Modificar Agentes Remotos";} -if ($ADD==61111) {echo "Remote Agent Status";} -if ($ADD==71111) {echo "Remote Agent Closer Stats";} - - -if (strlen($ADD)>4) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "2) {$groups_value .= " -";} - } - -?> - - - -
-
- - - -
  VICIDIAL, AGENTES REMOTOS:   Salir  
  MODIFICAR | ">ESTADO | ">ESTADÍSTICAS DE ENTRADA
-"; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Comienzo Del ID del usuario: $user_start
Número de líneas: (Solamente números)
IP Del Servidor: $row[3]
Extensión Externa: (number dialed to reach agents [i.e. 913125551212])
Estado:
Campaña: $campaign_id
Grupos De entrada: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTA: Puede tomar hasta 30 segundos para los cambios sometidos en esta pantalla para ir viva\n"; - -} - - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) - {echo "
AGENTES ALEJADOS NO MODIFICADOS - vaya por favor detrás y mire los datos que usted incorporó\n";} - else - { - $stmt="UPDATE vicidial_remote_agents set number_of_lines='" . mysql_real_escape_string($number_of_lines) . "', conf_exten='" . mysql_real_escape_string($conf_exten) . "', status='" . mysql_real_escape_string($status) . "', closer_campaigns='" . mysql_real_escape_string($groups_value) . "' where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - -# echo "$stmt\n"; - echo "
LOS AGENTES ALEJADOS SE MODIFICARON\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY AGENTES REMOTOS ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - - } - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Comienzo Del ID del usuario: $user_start
Número de líneas: (Solamente números)
IP Del Servidor: $row[3]
Extensión Externa: (number dialed to reach agents [i.e. 913125551212])
Estado:
Campaña: $campaign_id
Grupos De entrada: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTA: Puede tomar hasta 30 segundos para los cambios sometidos en esta pantalla para ir viva\n"; - -} - - - - -###################### -# ADD=61111 status of remote agent in the system and active calls and queue -###################### - -if ($ADD==61111) -{ - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
ERROR AGENTES REMOTOS – Por favor, vuelva atrás y compruebe los datos que introdujo\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'" . mysql_real_escape_string($nextuser) . "',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - echo "VICIDIAL: Remote Agent Time On Calls $NOW_TIME\n\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $leadlink=0; - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[3]=''; - $row[5]='- ESPERANDO -'; - $row[6]=$row[7]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $leadid = sprintf("%-12s", $row[2]); - if ($row[2] > 0) - { - $leadidLINK=$row[2]; - $leadlink++; - if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;} - $leadid = "$leadid"; - } - $channel = sprintf("%-10s", $row[3]); - $cc=0; - while ( (strlen($channel) > 10) and ($cc < 100) ) - { - $channel = eregi_replace(".$","",$channel); - $cc++; - if (strlen($channel) <= 10) {$cc=101;} - } - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = ($STARTtime - $row[6]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} - if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo " $i agentes identificados en el servidor $server_ip\n\n"; - - echo " - Llamadas de 5 minutos o más\n"; - echo " - Sobre 10 minutos en llamada\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "*********************************AGENTES SIN LLAMADAS*********************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - -###################### -# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log) -###################### - -if ($ADD==71111) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
ERROR AGENTES REMOTOS – Por favor, vuelva atrás y compruebe los datos que introdujo\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'$nextuser',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $in_calls = $row[0]; - $in_time = $row[1]; - $in_time_M = ($in_time / 60); - $in_time_M = round($in_time_M, 2); - $in_time_M_int = intval("$in_time_M"); - $in_time_SEC = ($in_time_M - $in_time_M_int); - $in_time_SEC = ($in_time_SEC * 60); - $in_time_SEC = round($in_time_SEC, 0); - if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";} - $in_time_MS = "$in_time_M_int:$in_time_SEC"; - $in_time_MS = sprintf("%7s", $in_time_MS); - - echo "VICIDIAL: Stats de entrada del agente alejado $NOW_TIME\n\n"; - echo "\n"; - echo "Llamadas totales tomadas $query_date: $in_calls\n"; - echo "Tiempo total de conversación$query_date: $in_time_MS (minutes:seconds)\n"; - echo "\n"; - echo "\n"; - echo "Lista la llamada para $query_date:\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - $user = sprintf("%-8s", $row[0]); - $leadid = sprintf("%-10s", $row[1]); - $group = sprintf("%-14s", $row[2]); - $phone = sprintf("%-10s", $row[3]); - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = $row[6]; - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - # if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - # echo " $i agentes identificados en el servidor $server_ip\n\n"; - - # echo " - Llamadas de 5 minutos o más\n"; - # echo " - Sobre 10 minutos en llamada\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "*********************************NINGUNA LLAMADA PARA HOY*******************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nScript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_agc/agc/active_list_refresh.php b/LANG_agc/agc/active_list_refresh.php deleted file mode 100644 index dd977642..00000000 --- a/LANG_agc/agc/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "List Display: "; -if ($ADD==1) {echo "Live Extensions";} -if ($ADD==2) {echo "Busy Extensions";} -if ($ADD==3) {echo "Outside Lines";} -if ($ADD==4) {echo "Local Extensions";} -if ($ADD==5) {echo "Conferences";} -if ($ADD==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc/astguiclient.php b/LANG_agc/agc/astguiclient.php deleted file mode 100644 index 6d39bae8..00000000 --- a/LANG_agc/agc/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Login\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
User Login:
User Password:
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Phone Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Phone Login
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
Main PanelActive Lines PanelConferences PanelCheck VoicemailLive Call
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Hangup Trunk   |   - Hijack Trunk   |   - Listen Trunk   |   - Refresh   |   - Back to Main Window -
-
- - -
LOCAL HANGUP

- Active Local Menu
- Hangup Local   |   - Hijack Local   |   - Listen Local   |   - Refresh   |   - Back to Main Window -
-
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- Refresh


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - - -
LOCAL Extensions Dial
Phone calling from: Channel
Extensions:
Extensions Menu
-
- Call selected extension

- Call selected vmail box

- Refresh


- Back to Main Window

-
-
- - -
PARKED CALLS:
- Back to Main Window

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NEW:     OLD:             MANUAL DIAL       DIAL
PARKED CALLS: 0                LOCAL DIAL EXTENSIONS
OUTBOUND CALLS:
INBOUND CALLS:
astGUIclient web-client VERSION: BUILD:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITES       edit
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITES

 
SUBMIT FAVORITES CHANGES - requires logout
BACK TO MAIN WINDOW - ignore changes made
-
- -
- - - - - - - - - - - - - -
-PAUSE | START     Refresh rate: 1000 ms Faster | Slower

-
Initializing..
-
Active Extensions
-REFRESH | -ORDER | -
Outside Lines
-REFRESH | -ORDER | -
Local Extensions
-REFRESH | -ORDER | -
- Data Goes Here

-
- Data Goes Here

Trunk Action -
- Data Goes Here

Local Action -
-
- - - - -
- - -Conferences List - - - -
-Click on a conference room number on the left for info on that conference -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc/calendar.php b/LANG_agc/agc/calendar.php deleted file mode 100644 index e4068019..00000000 --- a/LANG_agc/agc/calendar.php +++ /dev/null @@ -1,125 +0,0 @@ -"; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; - -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -echo "$CCAL_OUT\n"; - diff --git a/LANG_agc/agc/call_log_display.php b/LANG_agc/agc/call_log_display.php deleted file mode 100644 index 4abec74d..00000000 --- a/LANG_agc/agc/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Call Log Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc/conf_exten_check.php b/LANG_agc/agc/conf_exten_check.php deleted file mode 100644 index 1f93e8ec..00000000 --- a/LANG_agc/agc/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ChannelA[$counter] ~"; - # echo "$ChannelA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid or Exten $exten is not valid\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conference $conf_exten has been registered to $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc/dbconnect.php b/LANG_agc/agc/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc/fix-dispo-list.patch b/LANG_agc/agc/fix-dispo-list.patch deleted file mode 100644 index f3cca9ef..00000000 --- a/LANG_agc/agc/fix-dispo-list.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- /usr/src/astguiclient_snapshot_2006-04-10/VICIDIAL_web/admin.php 2006-02-27 15:58:50.000000000 -0800 -+++ /var/www/html/vicidial/admin.php 2006-04-10 23:12:19.000000000 -0700 -@@ -3320,15 +3320,38 @@ - $o=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=""; -@@ -3338,24 +3361,12 @@ - $CLB=''; - $CLE=''; - } -- -- if ($rowx[1] == 'N') -- { -- $leads_in_list_N = ($leads_in_list_N + $rowx[2]); -- echo "
$CLB$rowx[0]$CLE $rowx[2]
$CLB$rowx[0]$CLE$rowx[2]
$CLB$dispo$CLE".$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"; - diff --git a/LANG_agc/agc/images/agc_check_voicemail_BLINK.gif b/LANG_agc/agc/images/agc_check_voicemail_BLINK.gif deleted file mode 100644 index 30703a78..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_BLINK.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_BLINK_e.gif b/LANG_agc/agc/images/agc_check_voicemail_BLINK_e.gif deleted file mode 100644 index 600cef89..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_BLINK_e.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_BLINK_es.gif b/LANG_agc/agc/images/agc_check_voicemail_BLINK_es.gif deleted file mode 100644 index 600cef89..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_BLINK_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_BLINK_ptbr.gif b/LANG_agc/agc/images/agc_check_voicemail_BLINK_ptbr.gif deleted file mode 100644 index 3670af28..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_BLINK_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_OFF.gif b/LANG_agc/agc/images/agc_check_voicemail_OFF.gif deleted file mode 100644 index 5b7e4c75..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_OFF_es.gif b/LANG_agc/agc/images/agc_check_voicemail_OFF_es.gif deleted file mode 100644 index ec9c1d55..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_OFF_ptbr.gif b/LANG_agc/agc/images/agc_check_voicemail_OFF_ptbr.gif deleted file mode 100644 index 3b1c4644..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_ON.gif b/LANG_agc/agc/images/agc_check_voicemail_ON.gif deleted file mode 100644 index ad55916d..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_ON.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_ON_es.gif b/LANG_agc/agc/images/agc_check_voicemail_ON_es.gif deleted file mode 100644 index 442a8084..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_ON_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_check_voicemail_ON_ptbr.gif b/LANG_agc/agc/images/agc_check_voicemail_ON_ptbr.gif deleted file mode 100644 index ae53a393..00000000 Binary files a/LANG_agc/agc/images/agc_check_voicemail_ON_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_live_call_OFF.gif b/LANG_agc/agc/images/agc_live_call_OFF.gif deleted file mode 100644 index 3752fb5e..00000000 Binary files a/LANG_agc/agc/images/agc_live_call_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_live_call_OFF_es.gif b/LANG_agc/agc/images/agc_live_call_OFF_es.gif deleted file mode 100644 index 1ff376d8..00000000 Binary files a/LANG_agc/agc/images/agc_live_call_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_live_call_OFF_ptbr.gif b/LANG_agc/agc/images/agc_live_call_OFF_ptbr.gif deleted file mode 100644 index 86a71723..00000000 Binary files a/LANG_agc/agc/images/agc_live_call_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_live_call_ON.gif b/LANG_agc/agc/images/agc_live_call_ON.gif deleted file mode 100644 index ed8ba2dd..00000000 Binary files a/LANG_agc/agc/images/agc_live_call_ON.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_live_call_ON_es.gif b/LANG_agc/agc/images/agc_live_call_ON_es.gif deleted file mode 100644 index 041d398f..00000000 Binary files a/LANG_agc/agc/images/agc_live_call_ON_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_live_call_ON_ptbr.gif b/LANG_agc/agc/images/agc_live_call_ON_ptbr.gif deleted file mode 100644 index c0601666..00000000 Binary files a/LANG_agc/agc/images/agc_live_call_ON_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_active_lines.gif b/LANG_agc/agc/images/agc_tab_active_lines.gif deleted file mode 100644 index 9f8eaf67..00000000 Binary files a/LANG_agc/agc/images/agc_tab_active_lines.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_active_lines_es.gif b/LANG_agc/agc/images/agc_tab_active_lines_es.gif deleted file mode 100644 index bdefd015..00000000 Binary files a/LANG_agc/agc/images/agc_tab_active_lines_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_active_lines_ptbr.gif b/LANG_agc/agc/images/agc_tab_active_lines_ptbr.gif deleted file mode 100644 index 1465ea6e..00000000 Binary files a/LANG_agc/agc/images/agc_tab_active_lines_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_astguiclient.gif b/LANG_agc/agc/images/agc_tab_astguiclient.gif deleted file mode 100644 index 30373576..00000000 Binary files a/LANG_agc/agc/images/agc_tab_astguiclient.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_astguiclient_ptbr.gif b/LANG_agc/agc/images/agc_tab_astguiclient_ptbr.gif deleted file mode 100644 index 30373576..00000000 Binary files a/LANG_agc/agc/images/agc_tab_astguiclient_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_conferences.gif b/LANG_agc/agc/images/agc_tab_conferences.gif deleted file mode 100644 index e3c80662..00000000 Binary files a/LANG_agc/agc/images/agc_tab_conferences.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_conferences_es.gif b/LANG_agc/agc/images/agc_tab_conferences_es.gif deleted file mode 100644 index 14ab7171..00000000 Binary files a/LANG_agc/agc/images/agc_tab_conferences_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_conferences_ptbr.gif b/LANG_agc/agc/images/agc_tab_conferences_ptbr.gif deleted file mode 100644 index 14ab7171..00000000 Binary files a/LANG_agc/agc/images/agc_tab_conferences_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_main.gif b/LANG_agc/agc/images/agc_tab_main.gif deleted file mode 100644 index 6e687e44..00000000 Binary files a/LANG_agc/agc/images/agc_tab_main.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_main_es.gif b/LANG_agc/agc/images/agc_tab_main_es.gif deleted file mode 100644 index b5fc2a5e..00000000 Binary files a/LANG_agc/agc/images/agc_tab_main_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/agc_tab_main_ptbr.gif b/LANG_agc/agc/images/agc_tab_main_ptbr.gif deleted file mode 100644 index b5fc2a5e..00000000 Binary files a/LANG_agc/agc/images/agc_tab_main_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/blank.gif b/LANG_agc/agc/images/blank.gif deleted file mode 100644 index 3a469695..00000000 Binary files a/LANG_agc/agc/images/blank.gif and /dev/null differ diff --git a/LANG_agc/agc/images/br.gif b/LANG_agc/agc/images/br.gif deleted file mode 100644 index 423b8a0c..00000000 Binary files a/LANG_agc/agc/images/br.gif and /dev/null differ diff --git a/LANG_agc/agc/images/de.gif b/LANG_agc/agc/images/de.gif deleted file mode 100644 index 4dd34f6a..00000000 Binary files a/LANG_agc/agc/images/de.gif and /dev/null differ diff --git a/LANG_agc/agc/images/down.gif b/LANG_agc/agc/images/down.gif deleted file mode 100644 index 32d0a007..00000000 Binary files a/LANG_agc/agc/images/down.gif and /dev/null differ diff --git a/LANG_agc/agc/images/el.gif b/LANG_agc/agc/images/el.gif deleted file mode 100644 index 9e79d8bf..00000000 Binary files a/LANG_agc/agc/images/el.gif and /dev/null differ diff --git a/LANG_agc/agc/images/en.gif b/LANG_agc/agc/images/en.gif deleted file mode 100644 index cb45f5f4..00000000 Binary files a/LANG_agc/agc/images/en.gif and /dev/null differ diff --git a/LANG_agc/agc/images/es.gif b/LANG_agc/agc/images/es.gif deleted file mode 100644 index 308ea3cb..00000000 Binary files a/LANG_agc/agc/images/es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/fr.gif b/LANG_agc/agc/images/fr.gif deleted file mode 100644 index 21fb3d19..00000000 Binary files a/LANG_agc/agc/images/fr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/it.gif b/LANG_agc/agc/images/it.gif deleted file mode 100644 index 6c7b1792..00000000 Binary files a/LANG_agc/agc/images/it.gif and /dev/null differ diff --git a/LANG_agc/agc/images/pt.gif b/LANG_agc/agc/images/pt.gif deleted file mode 100644 index 646b76ac..00000000 Binary files a/LANG_agc/agc/images/pt.gif and /dev/null differ diff --git a/LANG_agc/agc/images/remove.gif b/LANG_agc/agc/images/remove.gif deleted file mode 100644 index 89b0521c..00000000 Binary files a/LANG_agc/agc/images/remove.gif and /dev/null differ diff --git a/LANG_agc/agc/images/up.gif b/LANG_agc/agc/images/up.gif deleted file mode 100644 index 0d55544f..00000000 Binary files a/LANG_agc/agc/images/up.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_dialnextnumber.gif b/LANG_agc/agc/images/vdc_LB_dialnextnumber.gif deleted file mode 100644 index a5a080d6..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_dialnextnumber.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF.gif b/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF.gif deleted file mode 100644 index 75bc0e8f..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_es.gif deleted file mode 100644 index 405ff336..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif deleted file mode 100644 index 0d297820..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_dialnextnumber_es.gif b/LANG_agc/agc/images/vdc_LB_dialnextnumber_es.gif deleted file mode 100644 index ca92716e..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_dialnextnumber_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_dialnextnumber_ptbr.gif b/LANG_agc/agc/images/vdc_LB_dialnextnumber_ptbr.gif deleted file mode 100644 index 8625b1c9..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_dialnextnumber_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_grabparkedcall.gif b/LANG_agc/agc/images/vdc_LB_grabparkedcall.gif deleted file mode 100644 index a6779255..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_grabparkedcall.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF.gif b/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF.gif deleted file mode 100644 index 74b1f5a1..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_es.gif deleted file mode 100644 index 21991dd5..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif deleted file mode 100644 index 19932ad2..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_grabparkedcall_es.gif b/LANG_agc/agc/images/vdc_LB_grabparkedcall_es.gif deleted file mode 100644 index 9acc363a..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_grabparkedcall_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_grabparkedcall_ptbr.gif b/LANG_agc/agc/images/vdc_LB_grabparkedcall_ptbr.gif deleted file mode 100644 index e37d0fb4..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_grabparkedcall_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_hangupcustomer.gif b/LANG_agc/agc/images/vdc_LB_hangupcustomer.gif deleted file mode 100644 index b4fdfae8..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_hangupcustomer.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF.gif b/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF.gif deleted file mode 100644 index e5736ae0..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_es.gif deleted file mode 100644 index 570a6e5a..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif deleted file mode 100644 index 57918268..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_hangupcustomer_es.gif b/LANG_agc/agc/images/vdc_LB_hangupcustomer_es.gif deleted file mode 100644 index 94d3e225..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_hangupcustomer_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_hangupcustomer_ptbr.gif b/LANG_agc/agc/images/vdc_LB_hangupcustomer_ptbr.gif deleted file mode 100644 index 5841050c..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_hangupcustomer_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_parkcall.gif b/LANG_agc/agc/images/vdc_LB_parkcall.gif deleted file mode 100644 index 88fee283..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_parkcall.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_parkcall_OFF.gif b/LANG_agc/agc/images/vdc_LB_parkcall_OFF.gif deleted file mode 100644 index 8ad55010..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_parkcall_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_parkcall_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_parkcall_OFF_es.gif deleted file mode 100644 index 110ce6b0..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_parkcall_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_parkcall_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_parkcall_OFF_ptbr.gif deleted file mode 100644 index 25a6a2f2..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_parkcall_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_parkcall_es.gif b/LANG_agc/agc/images/vdc_LB_parkcall_es.gif deleted file mode 100644 index 2274a27c..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_parkcall_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_parkcall_ptbr.gif b/LANG_agc/agc/images/vdc_LB_parkcall_ptbr.gif deleted file mode 100644 index b37d8358..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_parkcall_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_pause.gif b/LANG_agc/agc/images/vdc_LB_pause.gif deleted file mode 100644 index 3486a1c1..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_pause.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_pause_OFF.gif b/LANG_agc/agc/images/vdc_LB_pause_OFF.gif deleted file mode 100644 index fce03041..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_pause_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_pause_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_pause_OFF_es.gif deleted file mode 100644 index 494d68a5..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_pause_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_pause_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_pause_OFF_ptbr.gif deleted file mode 100644 index 3d8c8759..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_pause_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_pause_es.gif b/LANG_agc/agc/images/vdc_LB_pause_es.gif deleted file mode 100644 index 544a3797..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_pause_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_pause_ptbr.gif b/LANG_agc/agc/images/vdc_LB_pause_ptbr.gif deleted file mode 100644 index bea56d65..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_pause_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_resume.gif b/LANG_agc/agc/images/vdc_LB_resume.gif deleted file mode 100644 index a7d75dd8..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_resume.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_resume_OFF.gif b/LANG_agc/agc/images/vdc_LB_resume_OFF.gif deleted file mode 100644 index 0ae4cb9a..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_resume_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_resume_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_resume_OFF_es.gif deleted file mode 100644 index 921d5d5e..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_resume_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_resume_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_resume_OFF_ptbr.gif deleted file mode 100644 index 43bb9235..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_resume_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_resume_es.gif b/LANG_agc/agc/images/vdc_LB_resume_es.gif deleted file mode 100644 index 1b096144..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_resume_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_resume_ptbr.gif b/LANG_agc/agc/images/vdc_LB_resume_ptbr.gif deleted file mode 100644 index 415b22d1..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_resume_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_senddtmf.gif b/LANG_agc/agc/images/vdc_LB_senddtmf.gif deleted file mode 100644 index d19888ad..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_senddtmf.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_senddtmf_OFF.gif b/LANG_agc/agc/images/vdc_LB_senddtmf_OFF.gif deleted file mode 100644 index 08a4b392..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_senddtmf_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_es.gif deleted file mode 100644 index 2d32c5e9..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif deleted file mode 100644 index 2d32c5e9..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_senddtmf_es.gif b/LANG_agc/agc/images/vdc_LB_senddtmf_es.gif deleted file mode 100644 index 43964df4..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_senddtmf_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_senddtmf_ptbr.gif b/LANG_agc/agc/images/vdc_LB_senddtmf_ptbr.gif deleted file mode 100644 index 43964df4..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_senddtmf_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_spacer.gif b/LANG_agc/agc/images/vdc_LB_spacer.gif deleted file mode 100644 index d0a4f6ed..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_spacer.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_startrecording.gif b/LANG_agc/agc/images/vdc_LB_startrecording.gif deleted file mode 100644 index 022103d2..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_startrecording.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_startrecording_OFF.gif b/LANG_agc/agc/images/vdc_LB_startrecording_OFF.gif deleted file mode 100644 index 3ee4ca62..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_startrecording_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_startrecording_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_startrecording_OFF_es.gif deleted file mode 100644 index ff9a3447..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_startrecording_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_startrecording_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_startrecording_OFF_ptbr.gif deleted file mode 100644 index 22105778..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_startrecording_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_startrecording_es.gif b/LANG_agc/agc/images/vdc_LB_startrecording_es.gif deleted file mode 100644 index 26420f78..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_startrecording_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_startrecording_ptbr.gif b/LANG_agc/agc/images/vdc_LB_startrecording_ptbr.gif deleted file mode 100644 index 15b25990..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_startrecording_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_stoprecording.gif b/LANG_agc/agc/images/vdc_LB_stoprecording.gif deleted file mode 100644 index 6f3bfede..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_stoprecording.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_stoprecording_OFF.gif b/LANG_agc/agc/images/vdc_LB_stoprecording_OFF.gif deleted file mode 100644 index 2e1efe4a..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_stoprecording_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_es.gif deleted file mode 100644 index 2806311f..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif deleted file mode 100644 index c0259410..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_stoprecording_es.gif b/LANG_agc/agc/images/vdc_LB_stoprecording_es.gif deleted file mode 100644 index 94f9de9d..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_stoprecording_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_stoprecording_ptbr.gif b/LANG_agc/agc/images/vdc_LB_stoprecording_ptbr.gif deleted file mode 100644 index 8a76e860..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_stoprecording_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_transferconf.gif b/LANG_agc/agc/images/vdc_LB_transferconf.gif deleted file mode 100644 index c5738519..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_transferconf.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_transferconf_OFF.gif b/LANG_agc/agc/images/vdc_LB_transferconf_OFF.gif deleted file mode 100644 index dd0a579a..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_transferconf_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_transferconf_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_transferconf_OFF_es.gif deleted file mode 100644 index d0a54bf6..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_transferconf_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_transferconf_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_transferconf_OFF_ptbr.gif deleted file mode 100644 index ebb69344..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_transferconf_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_transferconf_es.gif b/LANG_agc/agc/images/vdc_LB_transferconf_es.gif deleted file mode 100644 index 10cfa495..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_transferconf_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_transferconf_ptbr.gif b/LANG_agc/agc/images/vdc_LB_transferconf_ptbr.gif deleted file mode 100644 index f008e92c..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_transferconf_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_webform.gif b/LANG_agc/agc/images/vdc_LB_webform.gif deleted file mode 100644 index 4d5228f3..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_webform.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_webform_OFF.gif b/LANG_agc/agc/images/vdc_LB_webform_OFF.gif deleted file mode 100644 index 64316ced..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_webform_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_webform_OFF_es.gif b/LANG_agc/agc/images/vdc_LB_webform_OFF_es.gif deleted file mode 100644 index 75a56196..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_webform_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_webform_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_LB_webform_OFF_ptbr.gif deleted file mode 100644 index 75a56196..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_webform_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_webform_es.gif b/LANG_agc/agc/images/vdc_LB_webform_es.gif deleted file mode 100644 index d7590d66..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_webform_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_LB_webform_ptbr.gif b/LANG_agc/agc/images/vdc_LB_webform_ptbr.gif deleted file mode 100644 index d7590d66..00000000 Binary files a/LANG_agc/agc/images/vdc_LB_webform_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_ammessage.gif b/LANG_agc/agc/images/vdc_XB_ammessage.gif deleted file mode 100644 index 484d01eb..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_ammessage.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_ammessage_OFF.gif b/LANG_agc/agc/images/vdc_XB_ammessage_OFF.gif deleted file mode 100644 index 3aa94800..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_ammessage_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_blindtransfer.gif b/LANG_agc/agc/images/vdc_XB_blindtransfer.gif deleted file mode 100644 index 77c03e0b..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_blindtransfer.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF.gif b/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF.gif deleted file mode 100644 index 7fb481ee..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_es.gif deleted file mode 100644 index 05adaac5..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif deleted file mode 100644 index 3a069c2b..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_blindtransfer_es.gif b/LANG_agc/agc/images/vdc_XB_blindtransfer_es.gif deleted file mode 100644 index fdad633a..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_blindtransfer_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_blindtransfer_ptbr.gif b/LANG_agc/agc/images/vdc_XB_blindtransfer_ptbr.gif deleted file mode 100644 index c31c87fc..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_blindtransfer_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_channel.gif b/LANG_agc/agc/images/vdc_XB_channel.gif deleted file mode 100644 index 9a9ce7ba..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_channel.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_channel_es.gif b/LANG_agc/agc/images/vdc_XB_channel_es.gif deleted file mode 100644 index a4fbf1f5..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_channel_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_channel_ptbr.gif b/LANG_agc/agc/images/vdc_XB_channel_ptbr.gif deleted file mode 100644 index a4fbf1f5..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_channel_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_code.gif b/LANG_agc/agc/images/vdc_XB_code.gif deleted file mode 100644 index 8fb2b8c5..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_code.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_dialwithcustomer.gif b/LANG_agc/agc/images/vdc_XB_dialwithcustomer.gif deleted file mode 100644 index 68697edc..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_dialwithcustomer.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF.gif b/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF.gif deleted file mode 100644 index 8bf2e44b..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif deleted file mode 100644 index 7ef98a94..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif deleted file mode 100644 index 1ac7dbbb..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_es.gif b/LANG_agc/agc/images/vdc_XB_dialwithcustomer_es.gif deleted file mode 100644 index d71bca15..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_ptbr.gif b/LANG_agc/agc/images/vdc_XB_dialwithcustomer_ptbr.gif deleted file mode 100644 index 90ec03f8..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_dialwithcustomer_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupbothlines.gif b/LANG_agc/agc/images/vdc_XB_hangupbothlines.gif deleted file mode 100644 index 4e6db07e..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupbothlines.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF.gif b/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF.gif deleted file mode 100644 index f1ffdc12..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_es.gif deleted file mode 100644 index 8f12accd..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif deleted file mode 100644 index 47b87225..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupbothlines_es.gif b/LANG_agc/agc/images/vdc_XB_hangupbothlines_es.gif deleted file mode 100644 index 646c8769..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupbothlines_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupbothlines_ptbr.gif b/LANG_agc/agc/images/vdc_XB_hangupbothlines_ptbr.gif deleted file mode 100644 index fa0cf2fb..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupbothlines_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupxferline.gif b/LANG_agc/agc/images/vdc_XB_hangupxferline.gif deleted file mode 100644 index d25a105a..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupxferline.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF.gif b/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF.gif deleted file mode 100644 index a8fb4a3d..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_es.gif deleted file mode 100644 index 3c717d09..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif deleted file mode 100644 index f6d9080b..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupxferline_es.gif b/LANG_agc/agc/images/vdc_XB_hangupxferline_es.gif deleted file mode 100644 index 0d92a89c..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupxferline_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hangupxferline_ptbr.gif b/LANG_agc/agc/images/vdc_XB_hangupxferline_ptbr.gif deleted file mode 100644 index c7d26417..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hangupxferline_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_header.gif b/LANG_agc/agc/images/vdc_XB_header.gif deleted file mode 100644 index c813b9a3..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_header.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_header_es.gif b/LANG_agc/agc/images/vdc_XB_header_es.gif deleted file mode 100644 index a92c2df0..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_header_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_header_ptbr.gif b/LANG_agc/agc/images/vdc_XB_header_ptbr.gif deleted file mode 100644 index a92c2df0..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_header_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hotkeysactive.gif b/LANG_agc/agc/images/vdc_XB_hotkeysactive.gif deleted file mode 100644 index 8382205e..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hotkeysactive.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF.gif b/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF.gif deleted file mode 100644 index 3357ed2b..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif b/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif deleted file mode 100644 index 638ef859..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es.gif deleted file mode 100644 index 5c9a3122..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif deleted file mode 100644 index 335e6356..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hotkeysactive_es.gif b/LANG_agc/agc/images/vdc_XB_hotkeysactive_es.gif deleted file mode 100644 index b064725c..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hotkeysactive_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hotkeysactive_ptbr.gif b/LANG_agc/agc/images/vdc_XB_hotkeysactive_ptbr.gif deleted file mode 100644 index a34409c2..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hotkeysactive_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_hotkeysinactive_es.gif b/LANG_agc/agc/images/vdc_XB_hotkeysinactive_es.gif deleted file mode 100644 index d0bf982c..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_hotkeysinactive_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_internalcloser.gif b/LANG_agc/agc/images/vdc_XB_internalcloser.gif deleted file mode 100644 index a1adca76..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_internalcloser.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_internalcloser_OFF.gif b/LANG_agc/agc/images/vdc_XB_internalcloser_OFF.gif deleted file mode 100644 index 9d3489fa..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_internalcloser_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_es.gif deleted file mode 100644 index 45bc4290..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif deleted file mode 100644 index 45bc4290..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_internalcloser_es.gif b/LANG_agc/agc/images/vdc_XB_internalcloser_es.gif deleted file mode 100644 index d5c05657..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_internalcloser_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_internalcloser_ptbr.gif b/LANG_agc/agc/images/vdc_XB_internalcloser_ptbr.gif deleted file mode 100644 index d5c05657..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_internalcloser_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_leave3waycall.gif b/LANG_agc/agc/images/vdc_XB_leave3waycall.gif deleted file mode 100644 index 7bca06f9..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_leave3waycall.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF.gif b/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF.gif deleted file mode 100644 index 63594d65..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_es.gif deleted file mode 100644 index 9c41a291..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif deleted file mode 100644 index 63594d65..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_leave3waycall_es.gif b/LANG_agc/agc/images/vdc_XB_leave3waycall_es.gif deleted file mode 100644 index 9aa29708..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_leave3waycall_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_leave3waycall_ptbr.gif b/LANG_agc/agc/images/vdc_XB_leave3waycall_ptbr.gif deleted file mode 100644 index 7bca06f9..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_leave3waycall_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_localcloser.gif b/LANG_agc/agc/images/vdc_XB_localcloser.gif deleted file mode 100644 index 0e10a2ad..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_localcloser.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_localcloser_OFF.gif b/LANG_agc/agc/images/vdc_XB_localcloser_OFF.gif deleted file mode 100644 index ed11b7ac..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_localcloser_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_localcloser_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_localcloser_OFF_es.gif deleted file mode 100644 index fbad052d..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_localcloser_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_localcloser_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_localcloser_OFF_ptbr.gif deleted file mode 100644 index fbad052d..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_localcloser_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_localcloser_es.gif b/LANG_agc/agc/images/vdc_XB_localcloser_es.gif deleted file mode 100644 index d36e1944..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_localcloser_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_localcloser_ptbr.gif b/LANG_agc/agc/images/vdc_XB_localcloser_ptbr.gif deleted file mode 100644 index d36e1944..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_localcloser_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_number.gif b/LANG_agc/agc/images/vdc_XB_number.gif deleted file mode 100644 index 33f30330..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_number.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_number_es.gif b/LANG_agc/agc/images/vdc_XB_number_es.gif deleted file mode 100644 index 6d672acc..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_number_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_number_ptbr.gif b/LANG_agc/agc/images/vdc_XB_number_ptbr.gif deleted file mode 100644 index 22e82a58..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_number_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_parkcustomerdial.gif b/LANG_agc/agc/images/vdc_XB_parkcustomerdial.gif deleted file mode 100644 index 195b1a90..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_parkcustomerdial.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF.gif b/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF.gif deleted file mode 100644 index 7c275732..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif b/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif deleted file mode 100644 index ef710c9c..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif b/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif deleted file mode 100644 index 72dee5c0..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_es.gif b/LANG_agc/agc/images/vdc_XB_parkcustomerdial_es.gif deleted file mode 100644 index accda01c..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_ptbr.gif b/LANG_agc/agc/images/vdc_XB_parkcustomerdial_ptbr.gif deleted file mode 100644 index 0101ea9e..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_parkcustomerdial_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_seconds.gif b/LANG_agc/agc/images/vdc_XB_seconds.gif deleted file mode 100644 index 92fc7f2b..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_seconds.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_seconds_es.gif b/LANG_agc/agc/images/vdc_XB_seconds_es.gif deleted file mode 100644 index f4fe2b27..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_seconds_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_XB_seconds_ptbr.gif b/LANG_agc/agc/images/vdc_XB_seconds_ptbr.gif deleted file mode 100644 index f4fe2b27..00000000 Binary files a/LANG_agc/agc/images/vdc_XB_seconds_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_tab_script.gif b/LANG_agc/agc/images/vdc_tab_script.gif deleted file mode 100644 index 69e43b79..00000000 Binary files a/LANG_agc/agc/images/vdc_tab_script.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_tab_script_es.gif b/LANG_agc/agc/images/vdc_tab_script_es.gif deleted file mode 100644 index ba4320d4..00000000 Binary files a/LANG_agc/agc/images/vdc_tab_script_es.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_tab_script_ptbr.gif b/LANG_agc/agc/images/vdc_tab_script_ptbr.gif deleted file mode 100644 index 69e43b79..00000000 Binary files a/LANG_agc/agc/images/vdc_tab_script_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_tab_vicidial.gif b/LANG_agc/agc/images/vdc_tab_vicidial.gif deleted file mode 100644 index 1e862589..00000000 Binary files a/LANG_agc/agc/images/vdc_tab_vicidial.gif and /dev/null differ diff --git a/LANG_agc/agc/images/vdc_tab_vicidial_ptbr.gif b/LANG_agc/agc/images/vdc_tab_vicidial_ptbr.gif deleted file mode 100644 index 1e862589..00000000 Binary files a/LANG_agc/agc/images/vdc_tab_vicidial_ptbr.gif and /dev/null differ diff --git a/LANG_agc/agc/inbound_popup.php b/LANG_agc/agc/inbound_popup.php deleted file mode 100644 index e26c4496..00000000 --- a/LANG_agc/agc/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -LIVE INBOUND CALL"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

LIVE INBOUND CALL

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid is not valid\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Channel: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Channel=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "CUSTOM - \n"; - - echo "
Number Dialed: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "SEND TO MY VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc/live_exten_check.php b/LANG_agc/agc/live_exten_check.php deleted file mode 100644 index e0ca96c8..00000000 --- a/LANG_agc/agc/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Live Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ChannelA[$loop_count] = "$row[0]"; - $ChannelB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $ChannelA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc/manager_send.php b/LANG_agc/agc/manager_send.php deleted file mode 100644 index b934cbb8..00000000 --- a/LANG_agc/agc/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Manager Send: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten is not valid or ext_context $ext_context or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel is not live on $call_server_ip, Checking Live Channel...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup command sent for Channel $channel on $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "auto_dial_level $auto_dial_level must be set\n"; - echo "campaign $campaign must be set\n"; - echo "uniqueid $uniqueid must be set\n"; - echo "lead_id $lead_id must be set\n"; - echo "\nRedirectVD Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "parkedby $parkedby must be set\n"; - echo "\nRedirectToPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectFromPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Cannot find empty conference on $server_ip, Redirect command not inserted\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for Channel $channel on $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, $ACTION command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or exten $exten is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going on in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n RECORDING WILL LAST UP TO 60 MINUTES\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc/park_calls_display.php b/LANG_agc/agc/park_calls_display.php deleted file mode 100644 index 246591b1..00000000 --- a/LANG_agc/agc/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Parked Calls Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc/vdc_db_query.php b/LANG_agc/agc/vdc_db_query.php deleted file mode 100644 index ef287987..00000000 --- a/LANG_agc/agc/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Invalid Username/Password: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Database Query Script"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Group Choice $closer_choice is not valid\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Group Choice $closer_choice has been registered to user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "HOPPER EMPTY\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NUMBER\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "HOPPER EMPTY\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CALL NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID is not valid\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign is not valid\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserted: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "LOG NOT ENTERED\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CALL_LOG Inserted: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "LOG NOT ENTERED\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id is not valid\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "LOG NOT ENTERED\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaign $campaign is not valid\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCALL - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If CALLBK, change vicidial_callback record to INACTIVE - if ($dispo == 'CALLBK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user on $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten is not valid\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation on the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CALLBACK ENTRY - if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' has been changed to ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id information has been updated\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage is not valid\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' is now in status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list is not valid\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc/vicidial.php b/LANG_agc/agc/vicidial.php deleted file mode 100644 index 9d3763bb..00000000 --- a/LANG_agc/agc/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # 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 - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIDIAL web client: Re-Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

User Login

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIDIAL web client: Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIDIAL web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_seconds=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Campaign not active, please try again
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Login incorrect, please try again
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIDIAL web client: Phone Login Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login Error
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIDIAL web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed on this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, there are no leads in the hopper for this campaign\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICIDIALSCRIPT   LIVE     session ID: Live Call
-
- - - - -

VICIDIAL
-
- - -MANUAL DIAL
-
- - -X ACTIVE CALLBACKS
-
- - -
CALLBACKS FOR AGENT :
Click on a callback below to call the customer back now. If you click on a record below to call it, it will be removed from the list. -
-
-
  - Refresh -                 - Go Back -
-
- - -
NEW MANUAL DIAL LEAD FOR :

Enter information below for the new lead you wish to call. -
- \n"; - } - ?> - Note: all new manual dial leads will go into list 999

- - - - - - - - - - - - - - - -
Dial Code:   (This is usually a 1 in the USA-Canada)
Phone Number:   (10 digits max - digits only)
Search Existing Leads:   (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)


If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Dial Override field below. To hangup this call you will have to open the CALLS IN THIS SESSION link at the bottom of the screen and hang it up by clicking on its channel link there.
 
Dial Override:   (digits only please)
-
- Dial Now -                 - Go Back -
-
- - - - -Your Status:
Calls Dialing: -
- - - - - -
- - Transfer - Conference
- INTERNAL CLOSER - LOCAL CLOSER - CODE - Hangup Xfer Line - Hangup Both Lines - -
- - Number to call   - seconds   - channel - - OVERRIDE   - D1 - D2 -
- - Dial With Customer - Park Customer Dial - LEAVE 3-WAY CALL - Dial Blind Transfer - Blind Transfer VMail Message -
-
-
- - - - -
Lead Dispositioned As:

- -
-
-
- - - - - - - -
Disposition Hot Keys: - When active, simply press the keyboard key for the desired disposition for this call. The call will then be hungup and dispositioned automatically:
- - - - - -
-
- - -
Noone is in your session:
- Go Back -

- Call Agent Again -
-
- - -
Customer has hung up:
- Go Back -

- Finish and Disposition Call - -
-
- - -
Call Wrapup: seconds remaining in wrapup

- -

- Finish Wrapup and Move On - -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Any changes made to the customer information below at this time will not be comitted, You must change customer information before you Hangup the call.
-
- - -
DISPOSITION CALL :       Hangup Again       minimize
- End-of-call Disposition Selection -
- PAUSE AGENT DIALING
- CLEAR FORM | - SUBMIT -

- WEB FORM SUBMIT -

  -
-
- - - -
Select a CallBack Date :
- - - Select a Date Below   -     - Hour: -   - Minutes: -   - -  
- MY CALLBACK ONLY
";} - ?> - CB Comments:

- - SUBMIT

- -

  -
-
- - -
CLOSER INBOUND GROUP SELECTION
- Closer Inbound Group Selection -
- BLENDED CALLING(outbound activated)
- RESET | - SUBMIT -



  -
-
- - - - Channel - Channel - MY CALLBACK ONLY
";} - ?> -
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- REFRESH


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - -
VICIDIAL SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Dial Next Number
- LEAD PREVIEW
- ALT PHONE DIAL
- - -RECORDING FILE:
-
-
-RECORD ID:
-
- -Start Recording
-
-Web Form
-
-Park Call
-Transfer - Conference
-
-Hangup Customer
-
-Send DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
seconds:   Channel:   Cust Time:
Customer Information:
Title:   First:   MI:   Last:
Address1:
Address2:   Address3:
City:   State:   PostCode:
Province:   Vendor ID:
Phone:   DialCode:   Alt. Phone:
Show:   Email:
Comments:
- -
-


  - -
- - - - -
VICIDIAL web-client version:     BUILD:               Server:              
-Show conference call channel information
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HOT KEYS INACTIVE - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc/voicemail_check.php b/LANG_agc/agc/voicemail_check.php deleted file mode 100644 index 9cc655c6..00000000 --- a/LANG_agc/agc/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Voicemail Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "voicemail box $vmail_box is not valid\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_br/active_list_refresh.php b/LANG_agc/agc_br/active_list_refresh.php deleted file mode 100644 index 1f1e784a..00000000 --- a/LANG_agc/agc_br/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuário/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Mostrar Lista: "; -if ($ADD==1) {echo "Extensões Ativas";} -if ($ADD==2) {echo "Extensões Ocupadas";} -if ($ADD==3) {echo "Linhas externas";} -if ($ADD==4) {echo "Extensões Locais";} -if ($ADD==5) {echo "Conferencias";} -if ($ADD==99999) {echo "AJUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_br/astguiclient.php b/LANG_agc/agc_br/astguiclient.php deleted file mode 100644 index 8c11bcba..00000000 --- a/LANG_agc/agc_br/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Você fez o logoff. Obrigado\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Login\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
Login do Usuário:
Senha do Usuário:
Login do Telefone:
Senha do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDISCAR|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDISCAR|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Login do Telefone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Brazil
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Login do Telefone
 
Login do Telefone:
Senha do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Login do Telefone\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login do Telefone
 
Desculpe seu login de telefone e senha não estão ativos nesta campanha, por favor tente novamente:
 
Login do Telefone:
Senha do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -SAIR
\n"; ?> -
Painel PrincipalLinhas Ativas no PainelPainel de ConferênciasVerificar Caixa PostalChamadas Ativas
-
- - -

Logout
-
- - -
TRUNK DESLIGAR

- Active Trunks Menu
- Desligar o Canal   |   - Capturar o Canal   |   - Ouvir o Canal   |   - Atualizar   |   - Voltar a página principal -
-
- - -
DESLIGAR LOCAL

- Menu Local Ativo
- Desligar Local   |   - Capturar Local   |   - Ouvir Local   |   - Atualizar   |   - Voltar a página principal -
-
- - - - - - - -
TRANSFERIR CHAMADAS ATIVAS
Canal a ser transferido: Canal
Extensões:
Extensões do Menu
-
- Enviar para a extensão selecionada

- Enviar para a caixa postal selecionada

- Envie para este número:


- Atualizar


- Voltar a página principal

-
Conferencias:
(Clique no número abaixo para enviar a conferência)
Enviar meu canal para
Menu das conferências
-
- - - - - -
Discar a extensão local
Telefone ligando de: Canal
Extensões:
Extensões do Menu
-
- Ligar para a extensão selecionada

- Ligar para a caixa postal selecionada

- Atualizar


- Voltar a página principal

-
-
- - -
CHAMADAS EM ESPERA:
- Voltar a página principal

-
-
- - - - - - - - - - - - - - - -
  -
CAIXA POSTAL     NOVO:     VELHO:             DISCAGEM MANUAL       DISCAR
CHAMADAS EM ESPERA: 0                DISCAR A EXTENSÃO LOCAL
CHAMADAS SAINTES:
CHAMADAS ENTRANTES:
Versão do cliente web do astGUIClient: CONFIGURAÇÃO:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITOS       editar
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITOS

 
PARA ENVIAR MODIFICACOES FAVORITAS E NECESSARIO FAZER O SAIR
VOLTAR A TELA PRINCIPAL - as alterações serão ignoradas
-
- -
- - - - - - - - - - - - - -
-PAUSAR | INICIAR     Atualizar a taxa: 1000 ms Mais rápido | Mais devagar

-
Inicializando..
-
Extensões Ativas
-ATUALIZAR | -ORDEM | -
Linhas externas
-ATUALIZAR | -ORDEM | -
Extensões Locais
-ATUALIZAR | -ORDEM | -
- Data vai aqui

-
- Data vai aqui

Atividade do Tronco -
- Data vai aqui

Atividade Local -
-
- - - - -
- - -Lista das conferências - - - -
-Clique no número da conferência, a esquerda, para entrar na conferência -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc_br/call_log_display.php b/LANG_agc/agc_br/call_log_display.php deleted file mode 100644 index 11771e35..00000000 --- a/LANG_agc/agc_br/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuário/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Registro de Ligações"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten não é válido ou protocolo $protocol não é válido\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_br/conf_exten_check.php b/LANG_agc/agc_br/conf_exten_check.php deleted file mode 100644 index ac0d543b..00000000 --- a/LANG_agc/agc_br/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuário/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificação da Extensão de Conferência"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten não é válido\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanalA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanalA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$CanalA[$counter] ~"; - # echo "$CanalA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten não é válido or Exten $exten não é válido\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conferencia $conf_exten já foi registrado para $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_br/dbconnect.php b/LANG_agc/agc_br/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc_br/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc_br/inbound_popup.php b/LANG_agc/agc_br/inbound_popup.php deleted file mode 100644 index 089e809f..00000000 --- a/LANG_agc/agc_br/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuário/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -CHAMADA ENTRANDO"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

CHAMADA ENTRANDO

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid não é válido\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Canal: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Canal=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "CUSTOMIZADO - \n"; - - echo "
Número Discado: $row[8]
Notas: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "DESLIGAR - \n"; - echo "ENVIAR PARA MINHA CAIXA POSTAL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_br/live_exten_check.php b/LANG_agc/agc_br/live_exten_check.php deleted file mode 100644 index 845ae60c..00000000 --- a/LANG_agc/agc_br/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuário/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificação de extensões ativas"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten não é válido ou protocolo $protocol não é válido\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $CanalA[$loop_count] = "$row[0]"; - $CanalB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $CanalA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_br/manager_send.php b/LANG_agc/agc_br/manager_send.php deleted file mode 100644 index 7a23c861..00000000 --- a/LANG_agc/agc_br/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuário/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Gerente Envia: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AJUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten não é válido or queryCID $queryCID não é válido, Originate comando não inserido\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando enviado para Exten $exten Canal $channelligado$server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "extenName $extenName Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "\nOriginateName Action não enviado\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "extenName $extenName Deve ser definido\n"; - echo "exten $exten Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "\nOriginateNameVmail Action não enviado\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten não é válido or queryCID $queryCID não é válido, Originate comando não inserido\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando enviado para Exten $exten Canal $channelligado$server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten não é válido or ext_context $ext_context or queryCID $queryCID não é válido, Hangup comando não inserido\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Canal $channel não é válido or queryCID $queryCID não é válido, Hangup comando não inserido\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel não está ativoligado$call_server_ip, Checking Live Canal...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Canal $channel não está ativoligado$call_server_ip, Hangup comando não inserido $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup comando enviado para Canal $channelligado$call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "exten $exten Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "auto_dial_level $auto_dial_level Deve ser definido\n"; - echo "campaign $campaign Deve ser definido\n"; - echo "uniqueid $uniqueid Deve ser definido\n"; - echo "lead_id $lead_id Deve ser definido\n"; - echo "\nRedirectVD Action não enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='TRANFERENCIA' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='TRANFERENCIA' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "exten $exten Deve ser definido\n"; - echo "extenName $extenName Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "parkedby $parkedby Deve ser definido\n"; - echo "\nRedirectToPark Action não enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "exten $exten Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "\nRedirectFromPark Action não enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "extenName $extenName Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "\nRedirectName Action não enviado\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "extenName $extenName Deve ser definido\n"; - echo "exten $exten Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "\nRedirectNameVmail Action não enviado\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "ExtraCanal $extrachannel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "exten $exten Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "\nRedirect Action não enviado\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Não foi possível achar uma conferência vazialigado$server_ip, Redirect comando não inserido\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Canal $channel não está ativoligado$call_server_ip, Redirect comando não inserido\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Canal $channel não está ativoligado$server_ip, Redirect comando não inserido\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando enviado para Canal $channel and \nExtraCanal $extrachannel\n to $extenligado$server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando enviado para Canal $channelligado$call_server_ip and \nExtraCanal $extrachannel\n to $extenligado$server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma dessas variáveis não é válido:\n"; - echo "Canal $channel Deve ser maior que 2 caracteres\n"; - echo "queryCID $queryCID Deve ser maior que 14 caracateres\n"; - echo "exten $exten Deve ser definido\n"; - echo "ext_context $ext_context Deve ser definido\n"; - echo "ext_priority $ext_priority Deve ser definido\n"; - echo "\nRedirect Action não enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canal $channel não está ativoligado$server_ip, Redirect comando não inserido\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect comando enviado para Canal $channelligado$server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canal $channel não é válido or queryCID $queryCID não é válido or filename: $filename não é válido, $ACTION comando não inserido\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canal $channel não está ativoligado$server_ip, $ACTION comando não inserido\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION comando enviado para Canal $channelligado$server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canal $channel não é válido or exten $exten não é válido or filename: $filename não é válido, $ACTION comando não inserido\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings goingligadoin this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION comando enviado para Canal $channelligado$server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n AS GRAVAÇÕES VÃO DURAR 60 MINUTOS\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_br/park_calls_display.php b/LANG_agc/agc_br/park_calls_display.php deleted file mode 100644 index 8b4310da..00000000 --- a/LANG_agc/agc_br/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Inválido Usuário/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Mostra as ligações em espera"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten não é válido ou protocolo $protocol não é válido\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_br/vdc_db_query.php b/LANG_agc/agc_br/vdc_db_query.php deleted file mode 100644 index a312b0bf..00000000 --- a/LANG_agc/agc_br/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Inválido Usuário/Senha: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Script de consulta ao banco de dados"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Escolha do Grupo $closer_choice não é válido\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Escolha do Grupo $closer_choice foi registrado para o usuário $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "LISTA DE DISCAGEM VAZIA\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context não é válido\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NUMERO\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "LISTA DE DISCAGEM VAZIA\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context não é válido\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CHAMADA NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context não é válido\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID não é válido\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "REGISTRO NÃO DEFINIDO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign não é válido\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserido: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "REGISTRO NÃO DEFINIDO\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CHAMADA_LOG Inserido: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "REGISTRO NÃO DEFINIDO\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "REGISTRO NÃO DEFINIDO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id não é válido\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "REGISTRO NÃO DEFINIDO\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campanha $campaign não é válido\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCHAMADA in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCHAMADA - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCHAMADA - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then sendligadoto vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If CHAMADABK, change vicidial_callback record to INACTIVE - if ($dispo == 'CHAMADABK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $userligado$server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten não é válido\n"; - exit; - } -else - { - ##### Insert a SAIR record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','SAIR','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservationligadothe vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id não é válido\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CHAMADABACK ENTRY - if ( ($dispo_choice == 'CBHVELHO') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' foi modificado para ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id não é válido\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id a informação foi atualizada\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage não é válido\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' está agora com o status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list não é válido\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc_br/vicidial.php b/LANG_agc/agc_br/vicidial.php deleted file mode 100644 index 227202f0..00000000 --- a/LANG_agc/agc_br/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "Você fez o logoff. Obrigado\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of segundos for campaign call and agent stats - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIDISCAR web client: Re-Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Brazil
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Login
 
Login do Telefone:
Senha do Telefone:
Login do Usuário:
Senha do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIDISCAR web client: Login da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Login do Usuário

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login da Campanha
 
Login do Usuário:
Senha do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIDISCAR web client: Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
Login do Telefone:
Senha do Telefone:
Login do Usuário:
Senha do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIDISCAR web client: Login do Telefone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Brazil
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Login do Telefone
 
Login do Telefone:
Senha do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_segundos=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "A campanha não está ativa, por favor tente novamente
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Usuário incorreto, por favor tente novamente
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIDISCAR web client: Login da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login da Campanha
 
Login do Usuário:
Senha do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIDISCAR web client: Login do Telefone Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login Error
 
Desculpe seu login de telefone e senha não estão ativos nesta campanha, por favor tente novamente:
 
Login do Telefone:
Senha do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIDISCAR web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowedligadothis campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_loginligadophone: $SIP_userpara a campanha: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NOVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIDISCAR web client: VICIDISCAR Login da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "Desculpe, não existem registros na fila de discagem\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIDISCAR web client: VICIDISCAR Login da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -SAIR\n"; ?> -
-
- - - - - - - - -
VICIDISCARSCRIPT   LIVE    ID da sessão: Chamadas Ativas
-
- - - - -

VICIDISCAR
-
- - -DISCAGEM MANUAL
-
- - -X AGENDAMENTOS ATIVOS
-
- - -
AGENDAMENTOS POR AGENTE :
Clique em um dos contatos abaixo para ligar. Se você clicar em um contatos abaixo o mesmo será removido da lista de Agendamentos. -
-
-
  - Atualizar -                 - Voltar -
-
- - -
NOVA DISCAGEM MANUAL PARA :

Digite abaixo a informação do novo contato que você deseja ligar. -
- \n"; - } - ?> - Nota: todos os novos contatos da discagem manual serão inseridos na lista 999

- - - - - - - - - - - - - - - -
Codigo de Área:   (Normalmente é 1 nos EUA-Canada)
Telefone Number:   (Maximo de 10 digitos - apenas número)
Ligações Existentes Da Busca:   (Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova)


Se você deseja ligar para um número que não está na lista de contatos, digite o número que voc6e deseja discar no campo Discagem Sobreposta abaixo. Para desligar essa ligação você deve abrir o link Ligações em sua sessão link no rodapé da página e desligar clicando no link do canal.
 
Discagem Sobreposta:   (digitos apenas por favor)
-
- Discar Agora -                 - Voltar -
-
- - - - -Your Status:
Calls Dialing: -
- - - - - -
- - Transferir a conferência
- CLOSER INTERNO - CLOSER LOCAL - CODE - Desligar linha Xfer - Desligar ambas as linhas - -
- - Número a ser discado   - segundos   - channel - - OVERRIDE   - D1 - D2 -
- - Discar com o cliente - Colocar chamada do cliente em espera - ABANDONAR CHAMADA A TRES - Transferência sem acompanhamento - Blind Transfer VMail Message -
-
-
- - - - -
Status da ligação definida como:

- -
-
-
- - - - - - - -
Atalhos para os status: - Quanto ativo apenas pressione a tecla do teclado referente ao status desejado. A ligação será desligada e salva com o status definido automaticamemente:
- - - - - -
-
- - -
Não existe ninguem na sua sessão:
- Voltar -

- Ligar novamente para o agente -
-
- - -
O cliente desligou:
- Voltar -

- Finalize e coloque o status da ligação - -
-
- - -
Chamada Wrapup: segundos restantes no wrapup

- -

- Revestimento Wrapup e movimento sobre - -
-
- - -

SAIR
-
- - -
-
- - -
 
-
- - -
Qualquer alteração feita nesta página não será salva. Você deve mudar as informações do cliente antes de desligar a ligação.
-
- - -
SELEÇÃO DE STATUS :       Desligue novamente       minimizar
- Fim da seleção de status -
- PAUSAR DISCAGEM DO AGENTE
- LIMPAR FORMULARIO | - ENVIAR -

- WEB FORM ENVIAR -

  -
-
- - - -
Selecione uma data para o retorno :
- - - Selecione uma data abaixo   -     - Hour: -   - Minutes: -   - -  
- ESTE AGENDAMENTO SO APARECE PARA MIM
";} - ?> - Comentarios do CB:

- - ENVIAR

- -

  -
-
- - -
SELECAO DO GRUPO DE ENTRADA DO CLOSER
- Seleção do grupo de entrada do closer -
- LIGACAO MISTURADA(ligações externas ativadas)
- REINICIAR | - ENVIAR -



  -
-
- - - - Canal - Canal - ESTE AGENDAMENTO SO APARECE PARA MIM
";} - ?> -
- - - - - - - -
TRANSFERIR CHAMADAS ATIVAS
Canal a ser transferido: Canal
Extensões:
Extensões do Menu
-
- Enviar para a extensão selecionada

- Enviar para a caixa postal selecionada

- Envie para este número:


- ATUALIZAR


- Voltar a página principal

-
Conferencias:
(Clique no número abaixo para enviar a conferência)
Enviar meu canal para
Menu das conferências
-
- - - - -
VICIDISCAR SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Discar proximo número
- VISUALIZAR CONTATO
- DISCAR TELEFONE ALTERNATIVO
- - -GRAVANDO ARQUIVO:
-
-
-ID da gravação:
-
- -Inicia Gravação
-
-Web Form
-
-Colocar em espera
-Transferir a conferência
-
-Desligar Cliente
-
-Enviar DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
segundos:   Canal:   Tempo de cliente:
Informações do cliente:
Título:   Primeiro:   MI:  Ultimo:
Endereço1:
Endereço2:   Endereço3:
Cidade:   Estado:   CEP:
Bairro:   ID do Vendedor:
Telefone:   Codigo de Area:   Telefone Alternativo:
Mostrar:   Email:
Comentários:
- -
-


  - -
- - - - -
VICIDISCAR web-client version:     CONFIGURAÇÃO:               Servidor:              
-Mostrar informações de discagem do canal
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -ATALHOS DE STATUS INATIVOS - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc_br/voicemail_check.php b/LANG_agc/agc_br/voicemail_check.php deleted file mode 100644 index 40f2fc42..00000000 --- a/LANG_agc/agc_br/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuário/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificar caixa postal"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "Caixa Postal $vmail_box não é válido\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_de/active_list_refresh.php b/LANG_agc/agc_de/active_list_refresh.php deleted file mode 100644 index 586890cb..00000000 --- a/LANG_agc/agc_de/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Liste Anzeige: "; -if ($ADD==1) {echo "Phasenverlängerungen";} -if ($ADD==2) {echo "Beschäftigte Verlängerungen";} -if ($ADD==3) {echo "Äußere Linien";} -if ($ADD==4) {echo "Lokale Verlängerungen";} -if ($ADD==5) {echo "Konferenzen";} -if ($ADD==99999) {echo "HILFE";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_de/astguiclient.php b/LANG_agc/agc_de/astguiclient.php deleted file mode 100644 index 461b51ff..00000000 --- a/LANG_agc/agc_de/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Sie haben jetzt heraus geloggt. Danke\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: LOGON\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
LOGON
 
Benutzer-LOGON:
Benutzer-Kennwort:
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIVORWAHLKNOPF|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIVORWAHLKNOPF|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Telefon-LOGON\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Deutsch
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Telefon-LOGON
 
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Telefon-LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Telefon-LOGON
 
Traurig, Ihr Telefon-LOGON und Kennwort seien Sie nicht in diesem:
 
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
HauptverkleidungAktive Linien VerkleidungKonferenz-VerkleidungÜberprüfen Sie VoicemailLeben Anruf
-
- - -

Logout
-
- - -
TRUNK HÄNGEZUSTAND

- Active Trunks Menu
- Hängezustand-Stamm   |   - Straßenräuber-Stamm   |   - Hören Stamm   |   - ErneuernSie   |   - Zurück zu Hauptfenster -
-
- - -
LOKALER HÄNGEZUSTAND

- Aktives Lokales Menü
- Hängezustand-Einheimischer   |   - Straßenräuber-Einheimischer   |   - Hören Einheimischer   |   - ErneuernSie   |   - Zurück zu Hauptfenster -
-
- - - - - - - -
PHASENANRUF-ÜBERTRAGUNG
Gebracht zu werden Führung: Führung
Verlängerungen:
Verlängerungen Menü
-
- Senden Sie zu vorgewählter Verlängerung

- Senden Sie zu vorgewähltem vmail Kasten

- Senden Sie zu dieser Zahl:


- ErneuernSie


- Zurück zu Hauptfenster

-
Konferenzen:
(klicken Sie an eine Zahl unten, um zu einer Konferenz zu senden)
Senden Sie meine Führung auch
Konferenz-Menü
-
- - - - - -
LOKALER Verlängerungen Vorwahlknopf
Telefon, das von benennt: Führung
Verlängerungen:
Verlängerungen Menü
-
- Anruf vorgewählte Verlängerung

- Anruf vorgewählter vmail Kasten

- ErneuernSie


- Zurück zu Hauptfenster

-
-
- - -
GEPARKTE ANRUFE:
- Zurück zu Hauptfenster

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NEU:     ALT:             MANUELLER VORWAHLKNOPF       VORWAHLKNOPF
GEPARKTE ANRUFE: 0                LOKALE VORWAHLKNOPF-VERLÄNGERUNGEN
OUTBOUND ANRUFE:
INBOUND ANRUFE:
astGUIclient Netz-Klient VERSION: BAU:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
LIEBLINGE       redigieren sie
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
LIEBLINGE

 
SUBMITSie Sie LIEBLINGE ÄNDERUNGEN - erfordert Logout
ZURÜCK ZU MAIN FENSTER - ignorieren Sie die vorgenommenen Änderungen
-
- -
- - - - - - - - - - - - - -
-PAUSE | ANFANG     Erneuern Sie Rate: 1000 ms Schneller | Langsamer

-
Initialisierung..
-
Aktive Verlängerungen
-ERNEUERNSie | -AUFTRAG | -
Äußere Linien
-ERNEUERNSie | -AUFTRAG | -
Lokale Verlängerungen
-ERNEUERNSie | -AUFTRAG | -
- Daten Gehen Hier

-
- Daten Gehen Hier

Stamm-Tätigkeit -
- Daten Gehen Hier

Lokale Tätigkeit -
-
- - - - -
- - -Konferenz-Liste - - - -
-Klicken Sie an Konferenzzimmernummer auf dem links für Info auf -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc_de/call_log_display.php b/LANG_agc/agc_de/call_log_display.php deleted file mode 100644 index ed6d8f68..00000000 --- a/LANG_agc/agc_de/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Anruf-Maschinenbordbuch-Anzeige"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten ist unzulässig oder Protokoll $protocol ist unzulässig\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_de/conf_exten_check.php b/LANG_agc/agc_de/conf_exten_check.php deleted file mode 100644 index de56646a..00000000 --- a/LANG_agc/agc_de/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Verlängerung Überprüfung"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten ist unzulässig\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $FührungA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $FührungA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$FührungA[$counter] ~"; - # echo "$FührungA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten ist unzulässig or Exten $exten ist unzulässig\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Konferenz $conf_exten ist zu registriert worden $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_de/dbconnect.php b/LANG_agc/agc_de/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc_de/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc_de/inbound_popup.php b/LANG_agc/agc_de/inbound_popup.php deleted file mode 100644 index f4058509..00000000 --- a/LANG_agc/agc_de/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -INBOUND LEBHAFTANRUF"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

INBOUND LEBHAFTANRUF

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid ist unzulässig\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Führung: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Führung=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "GEWOHNHEIT - \n"; - - echo "
Nummer Gewählt: $row[8]
Anmerkungen: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HÄNGEZUSTAND - \n"; - echo "SENDEN SIE ZU MEINEM VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_de/live_exten_check.php b/LANG_agc/agc_de/live_exten_check.php deleted file mode 100644 index 4c60b701..00000000 --- a/LANG_agc/agc_de/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Phasenverlängerung Überprüfung"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten ist unzulässig oder Protokoll $protocol ist unzulässig\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $FührungA[$loop_count] = "$row[0]"; - $FührungB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $FührungA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_de/manager_send.php b/LANG_agc/agc_de/manager_send.php deleted file mode 100644 index 4564dadd..00000000 --- a/LANG_agc/agc_de/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Manager Senden: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "HILFE";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht eingesetzt\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate Befehl gesendet für Exten $exten Führung $channel auf $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nOriginateName Action nicht gesendet\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nOriginateNameVmail Action nicht gesendet\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht eingesetzt\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate Befehl gesendet für Exten $exten Führung $channel auf $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten ist unzulässig or ext_context $ext_context or queryCID $queryCID ist unzulässig, Hangup Befehl nicht eingesetzt\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Führung $channel ist unzulässig or queryCID $queryCID ist unzulässig, Hangup Befehl nicht eingesetzt\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel ist nicht Phasen auf $call_server_ip, Checking Live Führung...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Führung $channel ist nicht Phasen auf $call_server_ip, Hangup Befehl nicht eingesetzt $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup Befehl gesendet für Führung $channel auf $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "auto_dial_level $auto_dial_level muß eingestellt werden\n"; - echo "campaign $campaign muß eingestellt werden\n"; - echo "uniqueid $uniqueid muß eingestellt werden\n"; - echo "lead_id $lead_id muß eingestellt werden\n"; - echo "\nRedirectVD Action nicht gesendet\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "parkedby $parkedby muß eingestellt werden\n"; - echo "\nRedirectToPark Action nicht gesendet\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirectFromPark Action nicht gesendet\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirectName Action nicht gesendet\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirectNameVmail Action nicht gesendet\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "ExtraFührung $extrachannel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirect Action nicht gesendet\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Kann nicht leere Konferenz finden auf $server_ip, Redirect Befehl nicht eingesetzt\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Führung $channel ist nicht Phasen auf $call_server_ip, Redirect Befehl nicht eingesetzt\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Führung $channel ist nicht Phasen auf $server_ip, Redirect Befehl nicht eingesetzt\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra Befehl gesendet für Führung $channel and \nExtraFührung $extrachannel\n to $exten auf $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra Befehl gesendet für Führung $channel auf $call_server_ip and \nExtraFührung $extrachannel\n to $exten auf $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirect Action nicht gesendet\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Führung $channel ist nicht Phasen auf $server_ip, Redirect Befehl nicht eingesetzt\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect Befehl gesendet für Führung $channel auf $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Führung $channel ist unzulässig or queryCID $queryCID ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht eingesetzt\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Führung $channel ist nicht Phasen auf $server_ip, $ACTION Befehl nicht eingesetzt\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION Befehl gesendet für Führung $channel auf $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Führung $channel ist unzulässig or exten $exten ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht eingesetzt\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going auf in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION Befehl gesendet für Führung $channel auf $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n AUFNAHME DAUERT BIS 60 MINUTEN\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_de/park_calls_display.php b/LANG_agc/agc_de/park_calls_display.php deleted file mode 100644 index 07057230..00000000 --- a/LANG_agc/agc_de/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Geparkte Anruf-Anzeige"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten ist unzulässig oder Protokoll $protocol ist unzulässig\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_de/vdc_db_query.php b/LANG_agc/agc_de/vdc_db_query.php deleted file mode 100644 index 9417bb0f..00000000 --- a/LANG_agc/agc_de/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Datenbank-Frage Index"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Gruppe Wahl $closer_choice ist unzulässig\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Gruppe Wahl $closer_choice ist zum Benutzer registriert worden $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "ZUFUHRBEHÄLTER LEER\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context ist unzulässig\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC ZAHL\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INANRUF - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "ZUFUHRBEHÄLTER LEER\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context ist unzulässig\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INANRUF - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "ANRUF NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context ist unzulässig\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID ist unzulässig\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "MASCHINENBORDBUCH NICHT BETRETEN\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign ist unzulässig\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Eingesetzt: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "MASCHINENBORDBUCH NICHT BETRETEN\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "ANRUF_LOG Eingesetzt: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "MASCHINENBORDBUCH NICHT BETRETEN\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "MASCHINENBORDBUCH NICHT BETRETEN\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id ist unzulässig\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "MASCHINENBORDBUCH NICHT BETRETEN\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Kampagne $campaign ist unzulässig\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INANRUF in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INANRUF - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INANRUF - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INANRUF - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send auf to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If ANRUFBK, change vicidial_callback record to INACTIVE - if ($dispo == 'ANRUFBK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user auf $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten ist unzulässig\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation auf the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id ist unzulässig\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### ANRUFBACK ENTRY - if ( ($dispo_choice == 'CBHALT') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' ist zu geändert worden ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id ist unzulässig\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id Informationen sind aktualisiert worden\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage ist unzulässig\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' ist jetzt im Status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list ist unzulässig\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc_de/vicidial.php b/LANG_agc/agc_de/vicidial.php deleted file mode 100644 index 8c05a573..00000000 --- a/LANG_agc/agc_de/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "Sie haben jetzt heraus geloggt. Danke\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of Sekunden for campaign call and agent stats - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIVORWAHLKNOPF web client: Re-LOGON\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Deutsch
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-LOGON
 
Telefon-LOGON:
Telefon-Kennwort:
Benutzer-LOGON:
Benutzer-Kennwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIVORWAHLKNOPF web client: Kampagne LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Benutzer-LOGON

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Kampagne LOGON
 
Benutzer-LOGON:
Benutzer-Kennwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIVORWAHLKNOPF web client: LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
LOGON
 
Telefon-LOGON:
Telefon-Kennwort:
Benutzer-LOGON:
Benutzer-Kennwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIVORWAHLKNOPF web client: Telefon-LOGON\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Deutsch
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Telefon-LOGON
 
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_Sekunden=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Die aktive Kampagne nicht, versuchen bitte noch einmal
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Der falsche LOGON, versuchen bitte noch einmal
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIVORWAHLKNOPF web client: Kampagne LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Kampagne LOGON
 
Benutzer-LOGON:
Benutzer-Kennwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIVORWAHLKNOPF web client: Telefon-LOGON Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
LOGON Error
 
Traurig, Ihr Telefon-LOGON und Kennwort seien Sie nicht in diesem:
 
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIVORWAHLKNOPF web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed auf this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login auf phone: $SIP_user zur Kampagne: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NEU record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIVORWAHLKNOPF web client: VICIVORWAHLKNOPF Kampagne LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "Traurig, gibt es keine Leitungen im Zufuhrbehälter für diese\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "LOGON: \n
"; - echo "Kennwort:
\n"; - echo "Kampagne: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIVORWAHLKNOPF web client: VICIVORWAHLKNOPF Kampagne LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "LOGON: \n
"; - echo "Kennwort:
\n"; - echo "Kampagne: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICIVORWAHLKNOPFSCRIPT   LIVE     Lernabschnitt ID: Leben Anruf
-
- - - - -

VICIVORWAHLKNOPF
-
- - -MANUELLER VORWAHLKNOPF
-
- - -X AKTIVE WIEDERHOLUNGSBESUCHE
-
- - -
WIEDERHOLUNGSBESUCHE FÜR MITTEL :
Klicken Sie an einen Wiederholungsbesuch unten, um die Kunde Rückseite jetzt zu benennen. Wenn Sie an eine Aufzeichnung unten klicken, um sie zu benennen, wird sie von der Liste entfernt. -
-
-
  - ErneuernSie -                 - Gehen Sie Zurück -
-
- - -
NEUE MANUELLE VORWAHLKNOPF-LEITUNG FÜR :

Tragen Sie Informationen unten für die neue Leitung ein, die Sie benennen möchten. -
- \n"; - } - ?> - Anmerkung: alle neuen manuellen Vorwahlknopfleitungen steigen in Liste 999 ein

- - - - - - - - - - - - - - - -
Vorwahlknopf-Code:   (Dieses ist normalerweise 1 in den USA und im Kanada)
Telefon Number:   (10 Stellen Maximum - nur Stellen)
Suche existierende Anschlüsse:   (Wenn diese Option gesetzt ist wird versucht, die Telefonnummer im System zu finden, bevor sie als neuer Anschluss eingefügt wird)


Wenn Sie eine Nummer wählen und sie NICHT als neue Leitung hinzufügen lassen möchten, kommen Sie im genauen Dialstring diesem Sie möchten in der Vorwahlknopf-Übersteuerung benennen auffangen unten herein. Zum Hängezustand dieser Anruf müssen Sie die ANRUFE IN DIESER LERNABSCHNITT-Verbindung am unteren Bildschirmrand öffnen und ihn oben hängen, indem Sie dort auf seiner Führung Verbindung klicken.
 
Vorwahlknopf-Übersteuerung:   (Stellen gefallen nur)
-
- Vorwahlknopf Jetzt -                 - Gehen Sie Zurück -
-
- - - - -Ihr Status:
Calls Dialing: -
- - - - - -
- - Übertragung - Konferenz
- INTERNES GENAUERES - EINHEIMISCHER GENAUER - CODE - Hängezustand Xfer Linie - Hängezustand Beide Linien - -
- - Zahl zum zu benennen   - Sekunden   - channel - - OVERRIDE   - D1 - D2 -
- - Vorwahlknopf Mit Kunden - Park-Kunde Vorwahlknopf - ANRUF DES URLAUB-3-WAY - Vorwahlknopf-Vorhang-Übertragung - Blind Transfer VMail Message -
-
-
- - - - -
Leitung Dispositioned Wie:

- -
-
-
- - - - - - - -
Einteilung Heiße Schlüssel: - Wenn aktiv, betätigen Sie einfach die Taste für die gewünschte:
- - - - - -
-
- - -
Noone ist in Ihrem Lernabschnitt:
- Gehen Sie Zurück -

- Anruf-Mittel Wieder -
-
- - -
Kunde hat oben gehangen:
- Gehen Sie Zurück -

- Ende und Einteilung Anruf - -
-
- - -
Anruf Nachbereitung Verbleibende Sekunden der Nachbereitung

- -

- Beende Nachbereitung und mache weiter - -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Alle mögliche Änderungen, die am Kunden vorgenommen wurden, den, Informationen unten diesmal nicht sind, comitted, Sie müssen Kunde Informationen vor Ihnen ändern Hängezustand der Anruf.
-
- - -
EINTEILUNG ANRUF :       Hängezustand Wieder       setzen Sie herab
- Ende-von-benennen Sie Einteilung Vorwähler -
- STOPPEN SIE ZU BENENNEN
- ZURÜCKSTELLEN | - SUBMITSie -

- WEB FORM SUBMITSie -

  -
-
- - - -
Wählen Sie ein Wiederholungsbesuch Datum vor :
- - - Wählen Sie ein Datum unten vor   -     - Hour: -   - Minutes: -   - -  
- NUR MEIN WIEDERHOLUNGSBESUCH
";} - ?> - COLUMBIUM Anmerkungen:

- - SUBMITSie

- -

  -
-
- - -
GENAUERE INBOUND GRUPPENWAHL
- Genauere Inbound Gruppenwahl -
- GEMISCHTES BENENNEN(outbound aktiviert)
- ZURÜCKSTELLEN | - SUBMITSie -



  -
-
- - - - Führung - Führung - NUR MEIN WIEDERHOLUNGSBESUCH
";} - ?> -
- - - - - - - -
PHASENANRUF-ÜBERTRAGUNG
Gebracht zu werden Führung: Führung
Verlängerungen:
Verlängerungen Menü
-
- Senden Sie zu vorgewählter Verlängerung

- Senden Sie zu vorgewähltem vmail Kasten

- Senden Sie zu dieser Zahl:


- ERNEUERNSie


- Zurück zu Hauptfenster

-
Konferenzen:
(klicken Sie an eine Zahl unten, um zu einer Konferenz zu senden)
Senden Sie meine Führung auch
Konferenz-Menü
-
- - - - -
VICIVORWAHLKNOPF SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Vorwahlknopf-Folgende Zahl
- LEITUNG VORBETRACHTUNG
- WECH TELEFON
- - -REGISTERAKTE:
-
-
-SATZ IDENTIFIKATION:
-
- -Fangen Sie an Zu notieren
-
-Netz-Form
-
-Park-Anruf
-Übertragung - Konferenz
-
-Hängezustand-Kunde
-
-Senden Sie DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
Sekunden:   Führung:   Cust Zeit:
Kunde Informationen:
Titel:   Zuerst:   MI:  Letztes:
Adresse1:
Adresse2:   Adresse3:
Stadt:   Zustand:   PostCode:
Provinz:   Verkäufer Identifikation:
Telefon:   DialCode:   Wech Telefon:
Erscheinen:   Email:
Anmerkungen:
- -
-


  - -
- - - - -
VICIVORWAHLKNOPF Netz-Klient Version:     BAU:               Bediener:              
-Zeigen Sie Konferenzanruf-Führung Informationen
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HEISSE SCHLÜSSEL UNAKTIVIERT - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc_de/voicemail_check.php b/LANG_agc/agc_de/voicemail_check.php deleted file mode 100644 index b872f19a..00000000 --- a/LANG_agc/agc_de/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Voicemail Überprüfung"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "voicemail Kasten $vmail_box ist unzulässig\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_el/active_list_refresh.php b/LANG_agc/agc_el/active_list_refresh.php deleted file mode 100644 index befdb32b..00000000 --- a/LANG_agc/agc_el/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Κατάλογος Οθόνης: "; -if ($ADD==1) {echo "Ενεργές τηλ. συνδέσεις";} -if ($ADD==2) {echo "Απασχολημένες τηλ. συνδέσεις";} -if ($ADD==3) {echo "Εξωτερικές γραμμές";} -if ($ADD==4) {echo "Τοπικές τηλ. συνδέσεις";} -if ($ADD==5) {echo "Διασκέψεις";} -if ($ADD==99999) {echo "ΒΟΗΘΕΙΑ";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_el/astguiclient.php b/LANG_agc/agc_el/astguiclient.php deleted file mode 100644 index 1a77376a..00000000 --- a/LANG_agc/agc_el/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Έχετε αποσυνδεθεί. Σας ευχαριστούμε\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Σύνδεση\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIΚΛΗΣΗ|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIΚΛΗΣΗ|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Σύνδεση Τηλεφώνου\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Σύνδεση Τηλεφώνου
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Σύνδεση Τηλεφώνου\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση Τηλεφώνου
 
Συγγνώμη, αλλά η τηλεφωνική σύνδεση και ο κωδικός πρόσβασής σας δεν είναι ενεργά σε αυτό το σύστημα, παρακαλώ προσπαθήστε πάλι:
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -ΑΠΟΣΥΝΔΕΣΗ
\n"; ?> -
Κύριος ΠίνακαςΠίνακας Ενεργών ΓραμμώνΠίνακας διασκέψεωνΕλεγχος Φωνητικού ταχυδρομείουΕνεργή κλήση
-
- - -

Logout
-
- - -
TRUNK ΚΛΕΙΣΙΜΟ

- Active Trunks Menu
- Κλείσιμο Trunk   |   - Κλέψιμο Trunk   |   - Ακούστε Trunk   |   - Ανανέωση   |   - Επιστροφή -
-
- - -
ΤΟΠΙΚΟ ΚΛΕΙΣΙΜΟ ΤΗΛΕΦΩΝΟΥ

- Ενεργές Τοπικές Επιλογές
- Κλείσιμο τοπικού   |   - Κλέψιμο τοπικού   |   - Ακούστε τοπικό   |   - Ανανέωση   |   - Επιστροφή -
-
- - - - - - - -
ΜΕΤΑΦΟΡΑ ΕΝΕΡΓΗΣ ΚΛΗΣΗΣ
Κανάλι που μεταφέρεται: Κανάλι
Τηλ.συνδέσεις:
Επιλογές τηλ. συνδέσεων
-
- Στείλε στην επιλεγμένη τηλ.σύνδεση

- Στείλε στο επιλεγμένο vmail

- Στείλε σε αυτόν τον αριθμό:


- Ανανέωση


- Επιστροφή

-
Διασκέψεις:
(επιλέξτε έναν αριθμό κατωτέρω που θα σταλεί σε μια διάσκεψη)
Στείλε το κανάλι μου επίσης
Επιλογές διασκέψεων
-
- - - - - -
ΤΟΠΙΚΕΣ τηλ. συνδέσεις Κλήσεως
Τηλέφωνο που καλεί από: Κανάλι
Τηλ.συνδέσεις:
Επιλογές τηλ. συνδέσεων
-
- Επιλεγμένη κλήση τηλ. σύνδεσης

- Επιλεγμένη κλήση vmail

- Ανανέωση


- Επιστροφή

-
-
- - -
ΣΤΑΘΜ.ΚΛΗΣΕΙΣ:
- Επιστροφή

-
-
- - - - - - - - - - - - - - - -
  -
ΦΩΝ.ΤΑΧ.     ΝΕΟ:     ΠΑΛΑΙΟ:             ΧΕΙΡ.ΚΛΗΣΗ       ΚΛΗΣΗ
ΣΤΑΘΜ.ΚΛΗΣΕΙΣ: 0                ΤΗΛ.ΣΥΝΔ. ΤΟΠΙΚΗΣ ΚΛΗΣΗΣ
ΕΞΕΡΧΟΜΕΝΕΣ ΚΛΗΣΕΙΣ:
ΕΙΣΕΡΧΟΜΕΝΕΣ ΚΛΗΣΕΙΣ:
ΈΚΔΟΣΗ astGUIclient: ΔΗΜΙΟΥΡΓΙΑ:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
ΑΓΑΠΗΜΕΝΑ       διορθώστε
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
ΑΓΑΠΗΜΕΝΑ

 
ΥΠΟΒΑΛΤΕ τις ΑΛΛΑΓΕΣ ΣΥΜΠΑΘΕΙΩΝ - απαιτεί την αποσύνδεση
ΠΙΣΩ στο ΚΥΡΙΟ ΠΑΡΑΘΥΡΟ - αγνοήστε τις αλλαγές που γίνονται
-
- -
- - - - - - - - - - - - - -
-ΠΑΥΣΗ | ΕΝΑΡΞΗ     Ρυθμός ανανέωσης: 1000 ms Γρηγορότερα | Πιό αργά

-
Αρχή..
-
Ενεργές τηλ. συνδέσεις
-ΑΝΑΝΕΩΣΗ | -ΤΑΞΙΝ | -
Εξωτερικές γραμμές
-ΑΝΑΝΕΩΣΗ | -ΤΑΞΙΝ | -
Τοπικές τηλ. συνδέσεις
-ΑΝΑΝΕΩΣΗ | -ΤΑΞΙΝ | -
- Τα δεδομένα πηγαίνουν εδώ

-
- Τα δεδομένα πηγαίνουν εδώ

Κίνηση Trunk -
- Τα δεδομένα πηγαίνουν εδώ

Τοπική Κίνηση -
-
- - - - -
- - -Κατάλογος διασκέψεων - - - -
-Επιλέξτε έναν αριθμό δωματίου συνδιάσκεψης στα αριστερά για τις πληροφορίες σε εκείνη την συνδιάσκεψη -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc_el/call_log_display.php b/LANG_agc/agc_el/call_log_display.php deleted file mode 100644 index 2b8304b0..00000000 --- a/LANG_agc/agc_el/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Έμφάνιση Καταγραμμένων Κλήσεων"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten δεν ισχύει ή πρωτόκολλο $protocol δεν ισχύει\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_el/conf_exten_check.php b/LANG_agc/agc_el/conf_exten_check.php deleted file mode 100644 index 28b806da..00000000 --- a/LANG_agc/agc_el/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Ελεγχος τηλ.σύνδεσης διάσκεψης"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten δεν ισχύει\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Κατάσταση: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ΚανάλιA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ΚανάλιA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ΚανάλιA[$counter] ~"; - # echo "$ΚανάλιA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten δεν ισχύει or Exten $exten δεν ισχύει\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Διάσκεψη $conf_exten έχει καταχωρηθεί $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_el/dbconnect.php b/LANG_agc/agc_el/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc_el/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc_el/inbound_popup.php b/LANG_agc/agc_el/inbound_popup.php deleted file mode 100644 index 564999e3..00000000 --- a/LANG_agc/agc_el/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -ΕΝΕΡΓΗ ΕΙΣΕΡΧΟΜΕΝΗ ΚΛΗΣΗ"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

ΕΝΕΡΓΗ ΕΙΣΕΡΧΟΜΕΝΗ ΚΛΗΣΗ

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid δεν ισχύει\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Κανάλι: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Κανάλι=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "ΣΥΝΗΘΕΙΑ - \n"; - - echo "
Αριθμός που καλέσατε: $row[8]
Σημειώσεις: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "ΚΛΕΙΣΙΜΟ - \n"; - echo "ΣΤΕΙΛΕ ΣΤΟ ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ΜΟΥ\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_el/live_exten_check.php b/LANG_agc/agc_el/live_exten_check.php deleted file mode 100644 index e07c3cad..00000000 --- a/LANG_agc/agc_el/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Ελεγχος ενεργής τηλ.σύνδεσης"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten δεν ισχύει ή πρωτόκολλο $protocol δεν ισχύει\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ΚανάλιA[$loop_count] = "$row[0]"; - $ΚανάλιB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $ΚανάλιA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_el/manager_send.php b/LANG_agc/agc_el/manager_send.php deleted file mode 100644 index 5ccefdc6..00000000 --- a/LANG_agc/agc_el/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Ο διευθυντής στέλνει: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "ΒΟΗΘΕΙΑ";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten δεν ισχύει or queryCID $queryCID δεν ισχύει, Originate εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate εντολή που στέλνεται για Exten $exten Κανάλι $channel στο $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nOriginateName Action μην σταλμένος\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nOriginateNameVmail Action μην σταλμένος\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten δεν ισχύει or queryCID $queryCID δεν ισχύει, Originate εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate εντολή που στέλνεται για Exten $exten Κανάλι $channel στο $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten δεν ισχύει or ext_context $ext_context or queryCID $queryCID δεν ισχύει, Hangup εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Κανάλι $channel δεν ισχύει or queryCID $queryCID δεν ισχύει, Hangup εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel δεν είναι ενεργό στο $call_server_ip, Checking Live Κανάλι...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Κανάλι $channel δεν είναι ενεργό στο $call_server_ip, Hangup εντολή που δεν έγινε εισαγωγή $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup εντολή που στέλνεται για Κανάλι $channel στο $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "auto_dial_level $auto_dial_level πρέπει να τεθεί\n"; - echo "campaign $campaign πρέπει να τεθεί\n"; - echo "uniqueid $uniqueid πρέπει να τεθεί\n"; - echo "lead_id $lead_id πρέπει να τεθεί\n"; - echo "\nRedirectVD Action μην σταλμένος\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "parkedby $parkedby πρέπει να τεθεί\n"; - echo "\nRedirectToPark Action μην σταλμένος\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirectFromPark Action μην σταλμένος\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirectName Action μην σταλμένος\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirectNameVmail Action μην σταλμένος\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "ExtraΚανάλι $extrachannel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirect Action μην σταλμένος\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Δεν υπάρχει κενή διάσκεψη στο $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Κανάλι $channel δεν είναι ενεργό στο $call_server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Κανάλι $channel δεν είναι ενεργό στο $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra εντολή που στέλνεται για Κανάλι $channel and \nExtraΚανάλι $extrachannel\n to $exten στο $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra εντολή που στέλνεται για Κανάλι $channel στο $call_server_ip and \nExtraΚανάλι $extrachannel\n to $exten στο $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirect Action μην σταλμένος\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Κανάλι $channel δεν είναι ενεργό στο $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect εντολή που στέλνεται για Κανάλι $channel στο $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Κανάλι $channel δεν ισχύει or queryCID $queryCID δεν ισχύει or filename: $filename δεν ισχύει, $ACTION εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Κανάλι $channel δεν είναι ενεργό στο $server_ip, $ACTION εντολή που δεν έγινε εισαγωγή\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION εντολή που στέλνεται για Κανάλι $channel στο $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Κανάλι $channel δεν ισχύει or exten $exten δεν ισχύει or filename: $filename δεν ισχύει, $ACTION εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going στο in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION εντολή που στέλνεται για Κανάλι $channel στο $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n Η ΚΑΤΑΓΡΑΦΗ ΘΑ ΔΙΑΡΚΕΣΕΙ ΜΕΧΡΙ 60 ΛΕΠΤΑ\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_el/park_calls_display.php b/LANG_agc/agc_el/park_calls_display.php deleted file mode 100644 index cfaee591..00000000 --- a/LANG_agc/agc_el/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Εμφάνιση Σταθμευμένων Κλήσεων"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten δεν ισχύει ή πρωτόκολλο $protocol δεν ισχύει\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_el/vdc_db_query.php b/LANG_agc/agc_el/vdc_db_query.php deleted file mode 100644 index 0274d9e2..00000000 --- a/LANG_agc/agc_el/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Κώδικας ερώτησης βάσεων δεδομένων"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Επιλογή ομάδας $closer_choice δεν ισχύει\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Επιλογή ομάδας $closer_choice έχει καταχωρηθεί στο χρήστη $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "ΚΕΝΟΣ HOPPER\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context δεν ισχύει\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC ΑΡΙΘΜΟΣ\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "ΚΕΝΟΣ HOPPER\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context δεν ισχύει\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "ΚΛΗΣΗ NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context δεν ισχύει\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID δεν ισχύει\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign δεν ισχύει\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Εισαγωγή : $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "ΚΛΗΣΗ_LOG Εισαγωγή : $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id δεν ισχύει\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Εκστρατεία $campaign δεν ισχύει\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INΚΛΗΣΗ in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send στο to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If ΚΛΗΣΗBK, change vicidial_callback record to INACTIVE - if ($dispo == 'ΚΛΗΣΗBK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user στο $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten δεν ισχύει\n"; - exit; - } -else - { - ##### Insert a ΑΠΟΣΥΝΔΕΣΗ record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','ΑΠΟΣΥΝΔΕΣΗ','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation στο the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id δεν ισχύει\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### ΚΛΗΣΗBACK ENTRY - if ( ($dispo_choice == 'CBHΠΑΛΑΙΟ') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' έχει αλλαχτεί ' . $dispo_choice . " Κατάσταση\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id δεν ισχύει\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id οι πληροφορίες έχουν ενημερωθεί\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage δεν ισχύει\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' είναι τώρα στη κατάσταση ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list δεν ισχύει\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc_el/vicidial.php b/LANG_agc/agc_el/vicidial.php deleted file mode 100644 index 126d3070..00000000 --- a/LANG_agc/agc_el/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "Έχετε αποσυνδεθεί. Σας ευχαριστούμε\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of δευτερόλεπτα for campaign call and agent stats - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIΚΛΗΣΗ web client: Επανασύνδεση\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Επανασύνδεση
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIΚΛΗΣΗ web client: Σύνδεση εκστρατείας\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Σύνδεση χρήστη

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση εκστρατείας
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIΚΛΗΣΗ web client: Σύνδεση\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIΚΛΗΣΗ web client: Σύνδεση Τηλεφώνου\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Σύνδεση Τηλεφώνου
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_δευτερόλεπτα=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Η εκστρατεία είναι μη ενεργή, παρακαλώ προσπαθήστε πάλι
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Η σύνδεση δεν είναι σωστή, παρακαλώ προσπαθήστε πάλι
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIΚΛΗΣΗ web client: Σύνδεση εκστρατείας\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση εκστρατείας
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIΚΛΗΣΗ web client: Σύνδεση Τηλεφώνου Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση Error
 
Συγγνώμη, αλλά η τηλεφωνική σύνδεση και ο κωδικός πρόσβασής σας δεν είναι ενεργά σε αυτό το σύστημα, παρακαλώ προσπαθήστε πάλι:
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIΚΛΗΣΗ web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed στο this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login στο phone: $SIP_user στην εκστρατεία: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a ΝΕΟ record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIΚΛΗΣΗ web client: VICIΚΛΗΣΗ Σύνδεση εκστρατείας\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "Συγγνώμη, δεν υπάρχουν οδηγοί στον hopper για αυτήν την εκστρατεία\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Σύνδεση: \n
"; - echo "Κωδικός πρόσβασης:
\n"; - echo "Εκστρατεία: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIΚΛΗΣΗ web client: VICIΚΛΗΣΗ Σύνδεση εκστρατείας\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Σύνδεση: \n
"; - echo "Κωδικός πρόσβασης:
\n"; - echo "Εκστρατεία: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -ΑΠΟΣΥΝΔΕΣΗ\n"; ?> -
-
- - - - - - - - -
VICIΚΛΗΣΗSCRIPT   LIVE     ID εργασίας: Ενεργή κλήση
-
- - - - -

VICIΚΛΗΣΗ
-
- - -ΧΕΙΡ.ΚΛΗΣΗ
-
- - -X ΕΝΕΡΓΕΣ ΕΠΑΝΑΚΛΗΣΕΙΣ
-
- - -
ΕΠΑΝΑΚΛΗΣΕΙΣ ΓΙΑ ΤΟΝ ΧΕΙΡΙΣΤΗ :
Επιλέξτε μία επανάκληση παρακάτω για να καλέσετε τον πελάτη τώρα. Εάν επιλέξετε μία εγγραφή παρακάτω, θα διαγραφεί από την λίστα. -
-
-
  - Ανανέωση -                 - Επιστροφή -
-
- - -
ΝΕΑ ΧΕΙΡΟΚΙΝΗΤΗ ΚΛΗΣΗ ΟΔΗΓΟΥ ΓΙΑ :

Καταχωρήστε τις πληροφορίες παρακάτω για τον νέο οδηγό που επιθυμήτε να καλέσετε. -
- \n"; - } - ?> - Σημείωση: όλες οι νέες χειροκίνητες κλήσεις θα πάνε στην λίστα 999

- - - - - - - - - - - - - - - -
Κωδικός Κλήσης:   (Αυτό είναι συνήθως ένα 1 στις ΗΠΑ)
Τηλ Number:   (10 ψηφία μόνο)
Αναζήτηση Οδηγών:   (Η επιλογή αυτή επιτρέπει να βρει τον αριθμό στο σύστημα προτού γίνει εισαγωγή ως νέος οδηγός)


Εάν θέλετε να καλέσετε έναν αριθμό και να μην προστεθεί ως νέος οδηγός, καταχωρήστε τον με την σωστή μορφή στο πεδίο Αγνόησε Κλήση παρακάτω. Για να κλείσετε αυτή την κλήση θα πρέπει να ανοίξετε το ΚΛΗΣΕΙΣ ΣΕ ΑΥΤΗ ΤΗΝ ΔΙΑΙΔΚΑΣΙΑ στο κάτω μέρος της οθόνης και να την κλείσετε επιλέγοντας το κανάλι.
 
Αγνόησε Κλήση:   (παρακαλώ μόνο ψηφία)
-
- Κάλεσε Τώρα -                 - Επιστροφή -
-
- - - - -Your Κατάσταση:
Calls Dialing: -
- - - - - -
- - Μεταφορά - διάσκεψη
- ΕΣΩΤΕΡΙΚΟΣ CLOSER - ΤΟΠΙΚΟΣ CLOSER - CODE - Κλείσιμο Γραμμής Xfer - Κλείσιμο και τις δύο γραμμές - -
- - Αριθμός για κλήση   - δευτερόλεπτα   - channel - - OVERRIDE   - D1 - D2 -
- - Κλήση με τον πελάτη - Στάθμευση κλήσης πελάτη - ΑΠΟΧΩΡΗΣΗ 3WAY ΚΛΗΣΗΣ - Τυφλή μεταφορά κλήσης - Blind Transfer VMail Message -
-
-
- - - - -
Τερματισμό Καθοδήγησης όπως:

- -
-
-
- - - - - - - -
Πλήκτρα κλειδιά Τερματισμού: - Όταν είναι ενεργό, πιέστε απλά το πλήκτρο κλειδί για τον επιθυμητό τερματισμό της κλήσης. Η κλήση θα τρεματίσει αυτόματα:
- - - - - -
-
- - -
Κανένας δεν είναι στη σύνοδό σας:
- Επιστροφή -

- Ξανακάλεσε τον Χειριστή -
-
- - -
Ο πελάτης έχει κλείσει το τηλέφωνο:
- Επιστροφή -

- Τελείωσε και Τερμάτισε την Κλήση - -
-
- - -
Τύλιγμα Κλήσης: απομύνοντα δευτερόλεπτα σε τύλιγμα

- -

- Τελείωμα Τυλίγματος και προχωράει - -
-
- - -

ΑΠΟΣΥΝΔΕΣΗ
-
- - -
-
- - -
 
-
- - -
Οποιεσδήποτε αλλαγές που γίνονται στις πληροφορίες πελατών κατωτέρω αυτή τη στιγμή δεν θα είναι, πρέπει να αλλάξετε τις πληροφορίες πελατών ενώπιον σας Hangup η κλήση.
-
- - -
Τερματισμός Κλήσης :       Ξανακλήσε       ελαχιστοποιήστε
- Επιλογή τερματισμού της κλήσης -
- ΤΕΡΜΑΤΙΣΜΟΣ ΚΛΗΣΗΣ
- ΕΠΑΝΑΦΟΡΑ | - ΥΠΟΒΑΛΕΤΕ -

- WEB FORM ΥΠΟΒΑΛΕΤΕ -

  -
-
- - - -
Επιλέξτε μια ημερομηνία CallBack :
- - - Επιλέξτε μια ημερομηνία κατωτέρω   -     - Hour: -   - Minutes: -   - -  
- ΜΟΝΟ ΤΗΝ ΕΠΑΝΑΚΛΗΣΗ ΜΟΥ
";} - ?> - Σχόλια CB:

- - ΥΠΟΒΑΛΕΤΕ

- -

  -
-
- - -
CLOSER ΕΙΣΕΡΧΟΜΕΝΗ ΕΠΙΛΟΓΗ ΟΜΑΔΑΣ
- Επιλογή Closer εισερχόμενης ομάδας -
- ΣΥΝΔΥΑΣΜΕΝΗ ΚΛΗΣΗ(εξερχόμενες ενεργοποιημένες)
- ΕΠΑΝΑΦΟΡΑ | - ΥΠΟΒΑΛΕΤΕ -



  -
-
- - - - Κανάλι - Κανάλι - ΜΟΝΟ ΤΗΝ ΕΠΑΝΑΚΛΗΣΗ ΜΟΥ
";} - ?> -
- - - - - - - -
ΜΕΤΑΦΟΡΑ ΕΝΕΡΓΗΣ ΚΛΗΣΗΣ
Κανάλι που μεταφέρεται: Κανάλι
Τηλ.συνδέσεις:
Επιλογές τηλ. συνδέσεων
-
- Στείλε στην επιλεγμένη τηλ.σύνδεση

- Στείλε στο επιλεγμένο vmail

- Στείλε σε αυτόν τον αριθμό:


- ΑΝΑΝΕΩΣΗ


- Επιστροφή

-
Διασκέψεις:
(επιλέξτε έναν αριθμό κατωτέρω που θα σταλεί σε μια διάσκεψη)
Στείλε το κανάλι μου επίσης
Επιλογές διασκέψεων
-
- - - - -
VICIΚΛΗΣΗ SCRIPT
-
- - - - - - - - - - - - - - - - - -
ΚΑΤΑΣΤΑΣΗ:
-
-Κλήση επόμενου αριθμού
- ΠΡΟΒΟΛΗ ΟΔΗΓΟΥ
- ΚΛΗΣΗ ENAΛ/ΚΟΥ ΤΗΛΕΦΩΝΟΥ
- - -ΑΡΧΕΙΟ ΗΧΟΓΡ:
-
-
-ΤΑΥΤΟΤΗΤΑ ΕΓΓΡΑΦΗΣ:
-
- -Εναρξη ηχογράφισης
-
-Σελίδα Διαδικτύου
-
-Στάθμευση Κλήσης
-Μεταφορά - διάσκεψη
-
-΄Κλείσιμο Πελάτη
-
-Στείλε DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
δευτερόλεπτα:   Κανάλι:   Χρόνος Πελάτη:
Πληροφορίες Πελάτη:
Τίτλος:   Πρώτο:   Μσ:  Επίθετο:
Διεύθυνση1:
Διεύθυνση2:   Διεύθυνση3:
Πόλη:   Κράτος:   Ταχ.Κωδ.:
Επαρχία:   ID προμηθευτού:
Τηλ:   Κωδικός Κλήσης:   Εναλ/κό Τηλ:
Παρουσίαση:   Ηλεκτρονικό ταχυδρομείο:
Σχόλια:
- -
-


  - -
- - - - -
Έκδοση VICIΚΛΗΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:               Κεντρικός υπολογιστής:              
-Παρουσίαση πληροφοριών κλήσης καναλιού διασκέψης
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -ΠΛΗΚΤΡΑ ΚΛΕΙΔΙΑ ΑΝΕΝΕΡΓΑ - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc_el/voicemail_check.php b/LANG_agc/agc_el/voicemail_check.php deleted file mode 100644 index fb48dfb4..00000000 --- a/LANG_agc/agc_el/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Έλεγχος φωνητικού ταχυδρομείου"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "Κουτί φωνητικού ταχυδρομείου $vmail_box δεν ισχύει\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_en/active_list_refresh.php b/LANG_agc/agc_en/active_list_refresh.php deleted file mode 100644 index dd977642..00000000 --- a/LANG_agc/agc_en/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "List Display: "; -if ($ADD==1) {echo "Live Extensions";} -if ($ADD==2) {echo "Busy Extensions";} -if ($ADD==3) {echo "Outside Lines";} -if ($ADD==4) {echo "Local Extensions";} -if ($ADD==5) {echo "Conferences";} -if ($ADD==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_en/astguiclient.php b/LANG_agc/agc_en/astguiclient.php deleted file mode 100644 index 7da5ee3e..00000000 --- a/LANG_agc/agc_en/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Login\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
User Login:
User Password:
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Phone Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Phone Login
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
Main PanelActive Lines PanelConferences PanelCheck VoicemailLive Call
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Hangup Trunk   |   - Hijack Trunk   |   - Listen Trunk   |   - Refresh   |   - Back to Main Window -
-
- - -
LOCAL HANGUP

- Active Local Menu
- Hangup Local   |   - Hijack Local   |   - Listen Local   |   - Refresh   |   - Back to Main Window -
-
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- Refresh


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - - -
LOCAL Extensions Dial
Phone calling from: Channel
Extensions:
Extensions Menu
-
- Call selected extension

- Call selected vmail box

- Refresh


- Back to Main Window

-
-
- - -
PARKED CALLS:
- Back to Main Window

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NEW:     OLD:             MANUAL DIAL       DIAL
PARKED CALLS: 0                LOCAL DIAL EXTENSIONS
OUTBOUND CALLS:
INBOUND CALLS:
astGUIclient web-client VERSION: BUILD:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITES       edit
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITES

 
SUBMIT FAVORITES CHANGES - requires logout
BACK TO MAIN WINDOW - ignore changes made
-
- -
- - - - - - - - - - - - - -
-PAUSE | START     Refresh rate: 1000 ms Faster | Slower

-
Initializing..
-
Active Extensions
-REFRESH | -ORDER | -
Outside Lines
-REFRESH | -ORDER | -
Local Extensions
-REFRESH | -ORDER | -
- Data Goes Here

-
- Data Goes Here

Trunk Action -
- Data Goes Here

Local Action -
-
- - - - -
- - -Conferences List - - - -
-Click on a conference room number on the left for info on that conference -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc_en/call_log_display.php b/LANG_agc/agc_en/call_log_display.php deleted file mode 100644 index 4abec74d..00000000 --- a/LANG_agc/agc_en/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Call Log Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_en/conf_exten_check.php b/LANG_agc/agc_en/conf_exten_check.php deleted file mode 100644 index 1f93e8ec..00000000 --- a/LANG_agc/agc_en/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ChannelA[$counter] ~"; - # echo "$ChannelA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid or Exten $exten is not valid\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conference $conf_exten has been registered to $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_en/dbconnect.php b/LANG_agc/agc_en/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc_en/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc_en/inbound_popup.php b/LANG_agc/agc_en/inbound_popup.php deleted file mode 100644 index e26c4496..00000000 --- a/LANG_agc/agc_en/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -LIVE INBOUND CALL"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

LIVE INBOUND CALL

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid is not valid\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Channel: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Channel=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "CUSTOM - \n"; - - echo "
Number Dialed: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "SEND TO MY VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_en/live_exten_check.php b/LANG_agc/agc_en/live_exten_check.php deleted file mode 100644 index e0ca96c8..00000000 --- a/LANG_agc/agc_en/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Live Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ChannelA[$loop_count] = "$row[0]"; - $ChannelB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $ChannelA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_en/manager_send.php b/LANG_agc/agc_en/manager_send.php deleted file mode 100644 index b934cbb8..00000000 --- a/LANG_agc/agc_en/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Manager Send: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten is not valid or ext_context $ext_context or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel is not live on $call_server_ip, Checking Live Channel...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup command sent for Channel $channel on $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "auto_dial_level $auto_dial_level must be set\n"; - echo "campaign $campaign must be set\n"; - echo "uniqueid $uniqueid must be set\n"; - echo "lead_id $lead_id must be set\n"; - echo "\nRedirectVD Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "parkedby $parkedby must be set\n"; - echo "\nRedirectToPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectFromPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Cannot find empty conference on $server_ip, Redirect command not inserted\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for Channel $channel on $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, $ACTION command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or exten $exten is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going on in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n RECORDING WILL LAST UP TO 60 MINUTES\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_en/park_calls_display.php b/LANG_agc/agc_en/park_calls_display.php deleted file mode 100644 index 246591b1..00000000 --- a/LANG_agc/agc_en/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Parked Calls Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_en/vdc_db_query.php b/LANG_agc/agc_en/vdc_db_query.php deleted file mode 100644 index ef287987..00000000 --- a/LANG_agc/agc_en/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Invalid Username/Password: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Database Query Script"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Group Choice $closer_choice is not valid\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Group Choice $closer_choice has been registered to user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "HOPPER EMPTY\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NUMBER\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "HOPPER EMPTY\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CALL NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID is not valid\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign is not valid\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserted: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "LOG NOT ENTERED\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CALL_LOG Inserted: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "LOG NOT ENTERED\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id is not valid\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "LOG NOT ENTERED\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaign $campaign is not valid\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCALL - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If CALLBK, change vicidial_callback record to INACTIVE - if ($dispo == 'CALLBK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user on $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten is not valid\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation on the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CALLBACK ENTRY - if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' has been changed to ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id information has been updated\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage is not valid\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' is now in status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list is not valid\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc_en/vicidial.php b/LANG_agc/agc_en/vicidial.php deleted file mode 100644 index cfaf680d..00000000 --- a/LANG_agc/agc_en/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # 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 - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIDIAL web client: Re-Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

User Login

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIDIAL web client: Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIDIAL web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_seconds=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Campaign not active, please try again
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Login incorrect, please try again
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIDIAL web client: Phone Login Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login Error
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIDIAL web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed on this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "Sorry, there are no leads in the hopper for this campaign\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICIDIALSCRIPT   LIVE     session ID: Live Call
-
- - - - -

VICIDIAL
-
- - -MANUAL DIAL
-
- - -X ACTIVE CALLBACKS
-
- - -
CALLBACKS FOR AGENT :
Click on a callback below to call the customer back now. If you click on a record below to call it, it will be removed from the list. -
-
-
  - Refresh -                 - Go Back -
-
- - -
NEW MANUAL DIAL LEAD FOR :

Enter information below for the new lead you wish to call. -
- \n"; - } - ?> - Note: all new manual dial leads will go into list 999

- - - - - - - - - - - - - - - -
Dial Code:   (This is usually a 1 in the USA-Canada)
Phone Number:   (10 digits max - digits only)
Search Existing Leads:   (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)


If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Dial Override field below. To hangup this call you will have to open the CALLS IN THIS SESSION link at the bottom of the screen and hang it up by clicking on its channel link there.
 
Dial Override:   (digits only please)
-
- Dial Now -                 - Go Back -
-
- - - - -Your Status:
Calls Dialing: -
- - - - - -
- - Transfer - Conference
- INTERNAL CLOSER - LOCAL CLOSER - CODE - Hangup Xfer Line - Hangup Both Lines - -
- - Number to call   - seconds   - channel - - OVERRIDE   - D1 - D2 -
- - Dial With Customer - Park Customer Dial - LEAVE 3-WAY CALL - Dial Blind Transfer - Blind Transfer VMail Message -
-
-
- - - - -
Lead Dispositioned As:

- -
-
-
- - - - - - - -
Disposition Hot Keys: - When active, simply press the keyboard key for the desired disposition for this call. The call will then be hungup and dispositioned automatically:
- - - - - -
-
- - -
Noone is in your session:
- Go Back -

- Call Agent Again -
-
- - -
Customer has hung up:
- Go Back -

- Finish and Disposition Call - -
-
- - -
Call Wrapup: seconds remaining in wrapup

- -

- Finish Wrapup and Move On - -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Any changes made to the customer information below at this time will not be comitted, You must change customer information before you Hangup the call.
-
- - -
DISPOSITION CALL :       Hangup Again       minimize
- End-of-call Disposition Selection -
- PAUSE AGENT DIALING
- CLEAR FORM | - SUBMIT -

- WEB FORM SUBMIT -

  -
-
- - - -
Select a CallBack Date :
- - - Select a Date Below   -     - Hour: -   - Minutes: -   - -  
- MY CALLBACK ONLY
";} - ?> - CB Comments:

- - SUBMIT

- -

  -
-
- - -
CLOSER INBOUND GROUP SELECTION
- Closer Inbound Group Selection -
- BLENDED CALLING(outbound activated)
- RESET | - SUBMIT -



  -
-
- - - - Channel - Channel - MY CALLBACK ONLY
";} - ?> -
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- REFRESH


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - -
VICIDIAL SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Dial Next Number
- LEAD PREVIEW
- ALT PHONE DIAL
- - -RECORDING FILE:
-
-
-RECORD ID:
-
- -Start Recording
-
-Web Form
-
-Park Call
-Transfer - Conference
-
-Hangup Customer
-
-Send DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
seconds:   Channel:   Cust Time:
Customer Information:
Title:   First:   MI:   Last:
Address1:
Address2:   Address3:
City:   State:   PostCode:
Province:   Vendor ID:
Phone:   DialCode:   Alt. Phone:
Show:   Email:
Comments:
- -
-


  - -
- - - - -
VICIDIAL web-client version:     BUILD:               Server:              
-Show conference call channel information
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HOT KEYS INACTIVE - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc_en/voicemail_check.php b/LANG_agc/agc_en/voicemail_check.php deleted file mode 100644 index 9cc655c6..00000000 --- a/LANG_agc/agc_en/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Voicemail Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "voicemail box $vmail_box is not valid\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_es/active_list_refresh.php b/LANG_agc/agc_es/active_list_refresh.php deleted file mode 100644 index 6813fdd1..00000000 --- a/LANG_agc/agc_es/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Mostrar Listas: "; -if ($ADD==1) {echo "Extensiones Activas";} -if ($ADD==2) {echo "Extensiones Ocupadas";} -if ($ADD==3) {echo "Líneas de salida";} -if ($ADD==4) {echo "Extensiones Locales";} -if ($ADD==5) {echo "Conferencias";} -if ($ADD==99999) {echo "AYUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_es/astguiclient.php b/LANG_agc/agc_es/astguiclient.php deleted file mode 100644 index a0e69cf9..00000000 --- a/LANG_agc/agc_es/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Usted ahora ha registrado hacia fuera. Gracias\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "web client astGUIclient: Conexión\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión
 
Conexión Del Usuario:
Contraseña Del Usuario:
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client astGUIclient: Conexión Del Teléfono\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conexión Del Teléfono
 
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client astGUIclient: Conexión Del Teléfono\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión Del Teléfono
 
Disculpe, la conexión del teléfono y contraseña no están activos en este sistema, intentelo otra vez por favor:
 
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client astGUIclient\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -SALIR
\n"; ?> -
Pantalla PrincipalPantalla Lineas ActivasPantalla de ConferenciasComprobar buzón de vozLlamada Activa
-
- - -

Logout
-
- - -
TRUNK COLGAR

- Active Trunks Menu
- Colgar Trunk   |   - Capturar Trunk   |   - Escuchar Trunk   |   - Recarga   |   - Volver a la pantalla principal -
-
- - -
Colgar Local

- Menú Local Activa
- Colgar Local   |   - Capturar Local   |   - Escuchar Local   |   - Recarga   |   - Volver a la pantalla principal -
-
- - - - - - - -
TRANSFERIR LLAMADA ACTIVA
Canal que va a ser transferido: Canal
Extensiones:
Menú Extensiones
-
- Envíe a la extensión seleccionada

- Enviar al buzón de voz seleccionada

- Envíe a este número:


- Recarga


- Volver a la pantalla principal

-
Conferencias:
(Pinchar en un número de abajo para enviar a una conferencia)
Enviar mi canal también
Menú de Conferencias
-
- - - - - -
Marcar a Extensiones LOCALES
Teléfono llamando desde: Canal
Extensiones:
Menú Extensiones
-
- Llamar extensión seleccionada

- Llamar buzón de voz seleccionado

- Recarga


- Volver a la pantalla principal

-
-
- - -
LLAMADAS APARCADAS:
- Volver a la pantalla principal

-
-
- - - - - - - - - - - - - - - -
  -
BUZÓN DE VOZ     NUEVO:     VIEJO:             MARCADO MANUAL       DIAL
LLAMADAS APARCADAS: 0                MARCAR EXTENSIONES LOCALES
LLAMADAS SALIENTES:
LLAMADAS ENTRANTES:
versión astGUIclient del tela-cliente: CONSTRUCCION:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITOS       corrija
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITOS

 
SOMETA LOS CAMBIOS de los FAVORITOS - requiere registro de estado de la máquina
DE NUEVO A VENTANA PRINCIPAL - no haga caso de los cambios realizados
-
- -
- - - - - - - - - - - - - -
-PAUSA | COMIENZO     Actualizar la tarifa: 1000 ms Más rápido | Más lento

-
Inizializando..
-
Extensiones Activas
-ACTUALIZAR | -ORDEN | -
Líneas de salida
-ACTUALIZAR | -ORDEN | -
Extensiones Locales
-ACTUALIZAR | -ORDEN | -
- Los Datos Van Aquí

-
- Los Datos Van Aquí

Acciones en Trunk -
- Los Datos Van Aquí

Acción Local -
-
- - - - -
- - -Lista De las Conferencias - - - -
-Pinchar a la izquierda del número de una sala de conferencias para obtener información -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc_es/call_log_display.php b/LANG_agc/agc_es/call_log_display.php deleted file mode 100644 index f6c36dff..00000000 --- a/LANG_agc/agc_es/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Motrar el registro de llamadas"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten No es válido o protocolo $protocol No es válido\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_es/conf_exten_check.php b/LANG_agc/agc_es/conf_exten_check.php deleted file mode 100644 index 08a640e3..00000000 --- a/LANG_agc/agc_es/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Comprobar la Extensión de Conf"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten No es válido\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Estado: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanalA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanalA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$CanalA[$counter] ~"; - # echo "$CanalA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten No es válido or Exten $exten No es válido\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conferencia $conf_exten Ha sido registrado para $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_es/dbconnect.php b/LANG_agc/agc_es/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc_es/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc_es/inbound_popup.php b/LANG_agc/agc_es/inbound_popup.php deleted file mode 100644 index fe5e79b5..00000000 --- a/LANG_agc/agc_es/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -LLAMADA DE ENTRADA ACTIVA"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

LLAMADA DE ENTRADA ACTIVA

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid No es válido\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Canal: $row[1]
LlamadorID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Canal=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "A MEDIDA - \n"; - - echo "
Número Marcado: $row[8]
Notas: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "COLGAR - \n"; - echo "ENVIAR A MI BUZÓN DE VOZ\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_es/live_exten_check.php b/LANG_agc/agc_es/live_exten_check.php deleted file mode 100644 index 912854ad..00000000 --- a/LANG_agc/agc_es/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Comprobar Extensión Activa"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten No es válido o protocolo $protocol No es válido\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $CanalA[$loop_count] = "$row[0]"; - $CanalB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $CanalA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_es/manager_send.php b/LANG_agc/agc_es/manager_send.php deleted file mode 100644 index 930f11d9..00000000 --- a/LANG_agc/agc_es/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Enviar al Manager: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AYUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten No es válido or queryCID $queryCID No es válido, Originate comando no insertado\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando enviado a Exten $exten Canal $channel en $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nOriginateName Action no enviado\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nOriginateNameVmail Action no enviado\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten No es válido or queryCID $queryCID No es válido, Originate comando no insertado\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando enviado a Exten $exten Canal $channel en $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten No es válido or ext_context $ext_context or queryCID $queryCID No es válido, Hangup comando no insertado\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Canal $channel No es válido or queryCID $queryCID No es válido, Hangup comando no insertado\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel no está activo en $call_server_ip, Checking Live Canal...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Canal $channel no está activo en $call_server_ip, Hangup comando no insertado $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup comando enviado a Canal $channel en $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "auto_dial_level $auto_dial_level debe ser fijado\n"; - echo "campaign $campaign debe ser fijado\n"; - echo "uniqueid $uniqueid debe ser fijado\n"; - echo "lead_id $lead_id debe ser fijado\n"; - echo "\nRedirectVD Action no enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='TRANSFERENCIA' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='TRANSFERENCIA' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "parkedby $parkedby debe ser fijado\n"; - echo "\nRedirectToPark Action no enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirectFromPark Action no enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirectName Action no enviado\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirectNameVmail Action no enviado\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "ExtraCanal $extrachannel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirect Action no enviado\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "No puede encontrar conferencia vacía en $server_ip, Redirect comando no insertado\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Canal $channel no está activo en $call_server_ip, Redirect comando no insertado\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Canal $channel no está activo en $server_ip, Redirect comando no insertado\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando enviado a Canal $channel and \nExtraCanal $extrachannel\n to $exten en $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando enviado a Canal $channel en $call_server_ip and \nExtraCanal $extrachannel\n to $exten en $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirect Action no enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canal $channel no está activo en $server_ip, Redirect comando no insertado\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect comando enviado a Canal $channel en $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canal $channel No es válido or queryCID $queryCID No es válido or filename: $filename No es válido, $ACTION comando no insertado\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canal $channel no está activo en $server_ip, $ACTION comando no insertado\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION comando enviado a Canal $channel en $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canal $channel No es válido or exten $exten No es válido or filename: $filename No es válido, $ACTION comando no insertado\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going en in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION comando enviado a Canal $channel en $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n LA GRABACIÓN DURARÁ HASTA 60 MINUTOS\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_es/park_calls_display.php b/LANG_agc/agc_es/park_calls_display.php deleted file mode 100644 index 0f8c81ab..00000000 --- a/LANG_agc/agc_es/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Mostrar Llamadas Aparcadas"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten No es válido o protocolo $protocol No es válido\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_es/vdc_db_query.php b/LANG_agc/agc_es/vdc_db_query.php deleted file mode 100644 index feeb72be..00000000 --- a/LANG_agc/agc_es/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Database Query Script"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Opción Del Grupo $closer_choice No es válido\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Opción Del Grupo $closer_choice se ha registrado al usuario $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "TOLVA VACÍA\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context No es válido\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NÚMERO\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INLLAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "TOLVA VACÍA\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context No es válido\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INLLAMADA - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LLAMADA NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context No es válido\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID No es válido\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "REGISTRO NO ENTRADO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign No es válido\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Insertado: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "REGISTRO NO ENTRADO\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "LLAMADA_LOG Insertado: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "REGISTRO NO ENTRADO\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "REGISTRO NO ENTRADO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id No es válido\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "REGISTRO NO ENTRADO\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaña $campaign No es válido\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INLLAMADA in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INLLAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INLLAMADA - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INLLAMADA - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send en to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If LLAMADABK, change vicidial_callback record to INACTIVE - if ($dispo == 'LLAMADABK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user en $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten No es válido\n"; - exit; - } -else - { - ##### Insert a SALIR record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','SALIR','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation en the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id No es válido\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### LLAMADABACK ENTRY - if ( ($dispo_choice == 'CBHVIEJO') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' se ha cambiado a ' . $dispo_choice . " Estado\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id No es válido\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id La información ha sido actualizada\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage No es válido\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' ahora está en estado ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list No es válido\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc_es/vicidial.php b/LANG_agc/agc_es/vicidial.php deleted file mode 100644 index d70ec0f4..00000000 --- a/LANG_agc/agc_es/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "Usted ahora ha registrado hacia fuera. Gracias\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of segundos for campaign call and agent stats - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "web client VICIDIAL: Conexión Otra Vez\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conexión Otra Vez
 
Conexión Del Teléfono:
Contraseña Del Teléfono:
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code

VERSIÓN: $version       CONSTRUCCION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "web client VICIDIAL: Conexión en la Campaña\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Conexión Del Usuario

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión en la Campaña
 
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "web client VICIDIAL: Conexión\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión
 
Conexión Del Teléfono:
Contraseña Del Teléfono:
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client VICIDIAL: Conexión Del Teléfono\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conexión Del Teléfono
 
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_segundos=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "La campaña no está activa, intentelo otra vez, por favor
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "La conexión incorrecta, intentelo otra vez, por favor
"; - } - } - if ($VDloginDISPLAY) - { - echo "web client VICIDIAL: Conexión en la Campaña\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión en la Campaña
 
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client VICIDIAL: Conexión Del Teléfono Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión Error
 
Disculpe, la conexión del teléfono y contraseña no están activos en este sistema, intentelo otra vez por favor:
 
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client VICIDIAL\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $LlamadorID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed en this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login en phone: $SIP_user a la campaña: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NUEVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "web client VICIDIAL: VICIDIAL Conexión en la Campaña\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "Lo siento, no hay leads en el hopper de esta campaña\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Conexión: \n
"; - echo "Contraseña:
\n"; - echo "Campaña: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "web client VICIDIAL: VICIDIAL Conexión en la Campaña\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Conexión: \n
"; - echo "Contraseña:
\n"; - echo "Campaña: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -SALIR\n"; ?> -
-
- - - - - - - - -
VICIDIALSCRIPT   LIVE     sesión ID: Llamada Activa
-
- - - - -

VICIDIAL
-
- - -MARCADO MANUAL
-
- - -X SERVICIOS REPETIDOS ACTIVOS
-
- - -
SERVICIOS REPETIDOS PARA EL AGENTE :
Chasque encendido un servicio repetido abajo ahora para llamar la parte posteriora del cliente. Si usted chasca encendido un expediente abajo para llamarlo, será quitado de la lista. -
-
-
  - Recarga -                 - Vaya Detrás -
-
- - -
NUEVO PLOMO MANUAL DEL DIAL PARA :

Incorpore la información abajo para el nuevo plomo que usted desea llamar. -
- \n"; - } - ?> - Nota: todos los nuevos plomos manuales del dial entrarán la lista 999

- - - - - - - - - - - - - - - -
Dial Código:   (Éste es generalmente un 1 en los U.S.A. y el Canadá)
Teléfono Number:   (máximo de 10 dígitos - dígitos solamente)
Plomos Existentes De la Búsqueda:   (Esta opción si está comprobada procurará encontrar el número de teléfono en el sistema antes de insertarlo como nuevo plomo)


Si usted desea marcar un número y hacerlo no agregar como nuevo plomo, entre en dialstring exacto ese usted desean llamar en el campo de la invalidación del dial abajo. Al retraso esta llamada usted tendrá que abrir las LLAMADAS EN ESTE acoplamiento de la SESIÓN en el fondo de la pantalla y colgarlas para arriba chascando en su acoplamiento del canal allí.
 
Inválidoación Del Dial:   (los dígitos satisfacen solamente)
-
- Dial Ahora -                 - Vaya Detrás -
-
- - - - -Su Estado:
Calls Dialing: -
- - - - - -
- - Transferencia - Conferencia
- CLOSER INTERNO - CLOSER LOCAL - CODE - Colgar Línea Xfer - Colgar Ambas Líneas - -
- - Número a llamar   - segundos   - channel - - OVERRIDE   - D1 - D2 -
- - Marcar Con El Cliente - Dial Del Cliente Del Parque - ABANDONAR LLAMADA 3-WAY - Marcar Blind Transfer - Blind Transfer VMail Message -
-
-
- - - - -
Lead Dispositioned Como:

- -
-
-
- - - - - - - -
Teclas de acceso rápido a la Disposición: - Cuando esté activo, presione simplemente la tecla para la disposición deseada para esta llamada. La llamada después será colgada y dispositioned automáticamente:
- - - - - -
-
- - -
Nadie está en su sesión:
- Vaya Detrás -

- Agente De la Llamada Otra vez -
-
- - -
El cliente ha colgado:
- Vaya Detrás -

- Final y llamada de la disposición - -
-
- - -
Llamada Wrapup: segundos restantes en wrapup

- -

- Final Wrapup y movimiento encendido - -
-
- - -

SALIR
-
- - -
-
- - -
 
-
- - -
Cualquier cambio realizado al cliente que no será la información abajo en este tiempo comitted, usted debe cambiar la información del cliente antes de usted retraso la llamada.
-
- - -
DISPOSITION LLAMADA :       Retraso Otra vez       reduzca al mínimo
- selección de la disposición del End-of-call -
- PARAR LA LLAMADA
- REINICIAR | - ENVIAR -

- WEB FORM ENVIAR -

  -
-
- - - -
Seleccione una fecha del servicio repetido :
- - - Seleccione una fecha abajo   -     - Hour: -   - Minutes: -   - -  
- MI SERVICIO REPETIDO SOLAMENTE
";} - ?> - Comentarios de los CBES:

- - ENVIAR

- -

  -
-
- - -
SELECCIÓN DEL GRUPO DE ENTRANTES CLOSER
- SELECCIÓN DEL GRUPO DE ENTRANTES CLOSER -
- BLENDED LLAMADAING(Salientes activdas)
- REINICIAR | - ENVIAR -



  -
-
- - - - Canal - Canal - MI SERVICIO REPETIDO SOLAMENTE
";} - ?> -
- - - - - - - -
TRANSFERIR LLAMADA ACTIVA
Canal que va a ser transferido: Canal
Extensiones:
Menú Extensiones
-
- Envíe a la extensión seleccionada

- Enviar al buzón de voz seleccionada

- Envíe a este número:


- ACTUALIZAR


- Volver a la pantalla principal

-
Conferencias:
(Pinchar en un número de abajo para enviar a una conferencia)
Enviar mi canal también
Menú de Conferencias
-
- - - - -
VICIDIAL SCRIPT
-
- - - - - - - - - - - - - - - - - -
ESTADO:
-
-Marcar el Siguiente Número
- MOSTRAR LEAD
- TELÉFONO DEL ALT
- - -GRABANDO ARCHIVO:
-
-
-GRABACIÓN ID:
-
- -Comenzar La Grabación
-
-Formulario Web
-
-Aparcar llamada
-Transferencia - Conferencia
-
-Colgar al Cliente
-
-Enviar DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
segundos:   Canal:   Tiempo:
Información Del Cliente:
Título:   Primero:   IM:   Último:
Dirección1:
Dirección2:   Dirección3:
Ciudad:   Estado:   Código Postal:
Provincia:   Vendedor ID:
Teléfono:   Código Del Dial:   Teléfono Alt:
Demostración:   Email:
Comentarios:
- -
-


  - -
- - - - -
versión web client VICIDIAL:     CONSTRUCCION:               Servidor:              
-Mostrar la información del canal Conferencia
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TECLAS ACCESO RÁPIDO INACTIVAS - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc_es/voicemail_check.php b/LANG_agc/agc_es/voicemail_check.php deleted file mode 100644 index 46db91bd..00000000 --- a/LANG_agc/agc_es/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Comprobar el buzón de voz"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "caja del buzón de voz $vmail_box No es válido\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_fr/active_list_refresh.php b/LANG_agc/agc_fr/active_list_refresh.php deleted file mode 100644 index df742e06..00000000 --- a/LANG_agc/agc_fr/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Affichage De Liste: "; -if ($ADD==1) {echo "Prolongements De phase";} -if ($ADD==2) {echo "Prolongements Occupés";} -if ($ADD==3) {echo "Lignes Extérieures";} -if ($ADD==4) {echo "Prolongements Locaux";} -if ($ADD==5) {echo "Conférences";} -if ($ADD==99999) {echo "AIDE";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_fr/astguiclient.php b/LANG_agc/agc_fr/astguiclient.php deleted file mode 100644 index 41513012..00000000 --- a/LANG_agc/agc_fr/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Vous vous êtes maintenant déconnecté. Merci\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "web client astGUIclient: Ouverture\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Français
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture
 
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICICADRAN|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICICADRAN|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client astGUIclient: Ouverture De Téléphone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Français
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Ouverture De Téléphone
 
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client astGUIclient: Ouverture De Téléphone\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Français
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture De Téléphone
 
Désolé, votre ouverture de téléphone et mot de passe ne soyez pas:
 
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client astGUIclient\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -DÉCONNEXION
\n"; ?> -
Panneau PrincipalLignes Actives PanneauPanneau De ConférencesVérifiez VoicemailVivent L'Appel
-
- - -

Logout
-
- - -
TRUNK DÉCROCHEMENT

- Active Trunks Menu
- Tronc De Décrochement   |   - Tronc De Détournement   |   - Écoutent Le Tronc   |   - Régénérez   |   - De nouveau à la fenêtre principale -
-
- - -
DÉCROCHEMENT LOCAL

- Menu Local Actif
- Gens du pays De Décrochement   |   - Gens du pays De Détournement   |   - Écoutent Les Gens du pays   |   - Régénérez   |   - De nouveau à la fenêtre principale -
-
- - - - - - - -
TRANSFERT DE PHASE D'APPEL
La Manche à transférer: LaManche
Prolongements:
Menu De Prolongements
-
- Envoyez à la prolongation choisie

- Envoyez dans la boîte choisie de vmail

- Envoyez à ce nombre:


- Régénérez


- De nouveau à la fenêtre principale

-
Conférences:
(cliquez sur un nombre ci-dessous pour envoyer à une)
Envoyez mon canal aussi
Menu De Conférences
-
- - - - - -
Cadran LOCAL De Prolongements
Téléphone appelant de: LaManche
Prolongements:
Menu De Prolongements
-
- Prolongation choisie par appel

- Boîte de vmail choisie par appel

- Régénérez


- De nouveau à la fenêtre principale

-
-
- - -
APPELS GARÉS:
- De nouveau à la fenêtre principale

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NOUVEAU:     VIEUX:             CADRAN MANUEL       CADRAN
APPELS GARÉS: 0                PROLONGEMENTS LOCAUX DE CADRAN
APPELS EN PARTANCE:
APPELS D'ARRIVÉE:
VERSION astGUIclient d'enchaînement-client: CONSTRUCTION:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORIS       éditez
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORIS

 
SOUMETTEZ LES CHANGEMENTS de FAVORIS - exige la déconnexion
DE NOUVEAU À LA FENÊTRE PRINCIPALE - ignorez les changements faits
-
- -
- - - - - - - - - - - - - -
-PAUSE | DÉBUT     La vitesse de régénération: 1000 ms Plus rapidement | Plus lent

-
Initialisation..
-
Prolongements Actifs
-RÉGÉNÉREZ | -ORDRE | -
Lignes Extérieures
-RÉGÉNÉREZ | -ORDRE | -
Prolongements Locaux
-RÉGÉNÉREZ | -ORDRE | -
- Les Données Vont Ici

-
- Les Données Vont Ici

Action De Tronc -
- Les Données Vont Ici

Action Locale -
-
- - - - -
- - -Liste De Conférences - - - -
-Cliquez sur un nombre de salle de conférence du côté gauche -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc_fr/call_log_display.php b/LANG_agc/agc_fr/call_log_display.php deleted file mode 100644 index 2d6379db..00000000 --- a/LANG_agc/agc_fr/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Affichage De Notation D'Appel"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten est inadmissible ou protocole $protocol est inadmissible\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_fr/conf_exten_check.php b/LANG_agc/agc_fr/conf_exten_check.php deleted file mode 100644 index ca269d5f..00000000 --- a/LANG_agc/agc_fr/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Contrôle De Prolongation De Conf"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten est inadmissible\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Statut: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $LaMancheA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $LaMancheA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$LaMancheA[$counter] ~"; - # echo "$LaMancheA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten est inadmissible or Exten $exten est inadmissible\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conférence $conf_exten a été enregistré à $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_fr/dbconnect.php b/LANG_agc/agc_fr/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc_fr/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc_fr/inbound_popup.php b/LANG_agc/agc_fr/inbound_popup.php deleted file mode 100644 index 558eb7f5..00000000 --- a/LANG_agc/agc_fr/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -APPEL D'ARRIVÉE DE PHASE"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

APPEL D'ARRIVÉE DE PHASE

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid est inadmissible\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
LaManche: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_LaManche=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "COUTUME - \n"; - - echo "
Numéro Composé: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "DÉCROCHEMENT - \n"; - echo "ENVOYEZ À MON VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_fr/live_exten_check.php b/LANG_agc/agc_fr/live_exten_check.php deleted file mode 100644 index 499b228d..00000000 --- a/LANG_agc/agc_fr/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Contrôle De phase De Prolongation"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten est inadmissible ou protocole $protocol est inadmissible\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $LaMancheA[$loop_count] = "$row[0]"; - $LaMancheB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $LaMancheA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_fr/manager_send.php b/LANG_agc/agc_fr/manager_send.php deleted file mode 100644 index 85887f16..00000000 --- a/LANG_agc/agc_fr/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Le Directeur Envoient: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AIDE";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten est inadmissible or queryCID $queryCID est inadmissible, Originate commande non insérée\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate commande envoyée pour Exten $exten LaManche $channel sur $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "extenName $extenName doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nOriginateName Action non envoyé\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "extenName $extenName doit être placé\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nOriginateNameVmail Action non envoyé\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten est inadmissible or queryCID $queryCID est inadmissible, Originate commande non insérée\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate commande envoyée pour Exten $exten LaManche $channel sur $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten est inadmissible or ext_context $ext_context or queryCID $queryCID est inadmissible, Hangup commande non insérée\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "LaManche $channel est inadmissible or queryCID $queryCID est inadmissible, Hangup commande non insérée\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel n'est pas de phase sur $call_server_ip, Checking Live LaManche...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "LaManche $channel n'est pas de phase sur $call_server_ip, Hangup commande non insérée $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup commande envoyée pour LaManche $channel sur $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "auto_dial_level $auto_dial_level doit être placé\n"; - echo "campaign $campaign doit être placé\n"; - echo "uniqueid $uniqueid doit être placé\n"; - echo "lead_id $lead_id doit être placé\n"; - echo "\nRedirectVD Action non envoyé\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "extenName $extenName doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "parkedby $parkedby doit être placé\n"; - echo "\nRedirectToPark Action non envoyé\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirectFromPark Action non envoyé\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "extenName $extenName doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirectName Action non envoyé\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "extenName $extenName doit être placé\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirectNameVmail Action non envoyé\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "ExtraLaManche $extrachannel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirect Action non envoyé\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Ne peut pas trouver la conférence vide sur $server_ip, Redirect commande non insérée\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "LaManche $channel n'est pas de phase sur $call_server_ip, Redirect commande non insérée\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "LaManche $channel n'est pas de phase sur $server_ip, Redirect commande non insérée\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra commande envoyée pour LaManche $channel and \nExtraLaManche $extrachannel\n to $exten sur $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra commande envoyée pour LaManche $channel sur $call_server_ip and \nExtraLaManche $extrachannel\n to $exten sur $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirect Action non envoyé\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "LaManche $channel n'est pas de phase sur $server_ip, Redirect commande non insérée\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect commande envoyée pour LaManche $channel sur $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "LaManche $channel est inadmissible or queryCID $queryCID est inadmissible or filename: $filename est inadmissible, $ACTION commande non insérée\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "LaManche $channel n'est pas de phase sur $server_ip, $ACTION commande non insérée\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION commande envoyée pour LaManche $channel sur $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "LaManche $channel est inadmissible or exten $exten est inadmissible or filename: $filename est inadmissible, $ACTION commande non insérée\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going sur in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION commande envoyée pour LaManche $channel sur $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n L'ENREGISTREMENT DURERA JUSQU'À 60 MINUTES\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_fr/park_calls_display.php b/LANG_agc/agc_fr/park_calls_display.php deleted file mode 100644 index 23d5e3b5..00000000 --- a/LANG_agc/agc_fr/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Affichage Garé D'Appels"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten est inadmissible ou protocole $protocol est inadmissible\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_fr/vdc_db_query.php b/LANG_agc/agc_fr/vdc_db_query.php deleted file mode 100644 index e2584b87..00000000 --- a/LANG_agc/agc_fr/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Manuscrit De Question De Base de données"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Choix De Groupe $closer_choice est inadmissible\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Choix De Groupe $closer_choice a été enregistré à l'utilisateur $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "DISTRIBUTEUR VIDE\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context est inadmissible\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NOMBRE\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INAPPEL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "DISTRIBUTEUR VIDE\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context est inadmissible\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INAPPEL - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "APPEL NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context est inadmissible\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID est inadmissible\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "NOTATION NON ENTRÉE\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign est inadmissible\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inséré: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "NOTATION NON ENTRÉE\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "APPEL_LOG Inséré: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "NOTATION NON ENTRÉE\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "NOTATION NON ENTRÉE\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id est inadmissible\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "NOTATION NON ENTRÉE\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campagne $campaign est inadmissible\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INAPPEL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INAPPEL - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INAPPEL - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INAPPEL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send sur to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If APPELBK, change vicidial_callback record to INACTIVE - if ($dispo == 'APPELBK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user sur $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten est inadmissible\n"; - exit; - } -else - { - ##### Insert a DÉCONNEXION record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','DÉCONNEXION','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation sur the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id est inadmissible\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### APPELBACK ENTRY - if ( ($dispo_choice == 'CBHVIEUX') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' a été changé en ' . $dispo_choice . " Statut\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id est inadmissible\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id l'information a été mise à jour\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage est inadmissible\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' est maintenant dans le statut ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list est inadmissible\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc_fr/vicidial.php b/LANG_agc/agc_fr/vicidial.php deleted file mode 100644 index 1ea3b1e2..00000000 --- a/LANG_agc/agc_fr/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "Vous vous êtes maintenant déconnecté. Merci\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of secondes for campaign call and agent stats - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "Web client de VICICADRAN: Re-Ouverture\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Français
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Ouverture
 
Ouverture De Téléphone:
Mot de passe De Téléphone:
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Campagne: $camp_form_code

VERSION: $version       CONSTRUCTION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "Web client de VICICADRAN: Ouverture De Campagne\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Français
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Ouverture D'Utilisateur

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture De Campagne
 
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Campagne: $camp_form_code

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "Web client de VICICADRAN: Ouverture\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Français
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture
 
Ouverture De Téléphone:
Mot de passe De Téléphone:
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Campagne: $camp_form_code

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "Web client de VICICADRAN: Ouverture De Téléphone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Français
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Ouverture De Téléphone
 
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_secondes=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "La campagne non active, essayent svp encore
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "L'ouverture incorrecte, essayent svp encore
"; - } - } - if ($VDloginDISPLAY) - { - echo "Web client de VICICADRAN: Ouverture De Campagne\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Français
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture De Campagne
 
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Campagne: $camp_form_code

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "Web client de VICICADRAN: Ouverture De Téléphone Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Français
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture Error
 
Désolé, votre ouverture de téléphone et mot de passe ne soyez pas:
 
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "Web client de VICICADRAN\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed sur this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login sur phone: $SIP_user à la campagne: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NOUVEAU record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "Web client de VICICADRAN: VICICADRAN Ouverture De Campagne\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Français
\n"; - echo "Désolé, il n'y a aucun fil dans le distributeur pour cette campagne\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Ouverture: \n
"; - echo "Mot de passe:
\n"; - echo "Campagne: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "Web client de VICICADRAN: VICICADRAN Ouverture De Campagne\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Français
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Ouverture: \n
"; - echo "Mot de passe:
\n"; - echo "Campagne: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -DÉCONNEXION\n"; ?> -
-
- - - - - - - - -
VICICADRANSCRIPT   LIVE     ID de session: Vivent L'Appel
-
- - - - -

VICICADRAN
-
- - -CADRAN MANUEL
-
- - -X RAPPELS DE SERVICE ACTIFS
-
- - -
RAPPELS DE SERVICE POUR L'AGENT :
Cliquez sur un rappel de service ci-dessous pour appeler le dos de client maintenant. Si vous cliquez sur un disque ci-dessous pour l'appeler, il sera enlevé de la liste. -
-
-
  - Régénérez -                 - Retournez -
-
- - -
NOUVEAU FIL MANUEL DE CADRAN POUR :

Écrivez l'information ci-dessous pour le nouveau fil que vous souhaitez appeler. -
- \n"; - } - ?> - Note : tous les nouveaux fils manuels de cadran entreront dans la liste 999

- - - - - - - - - - - - - - - -
Cadran Code:   (C'est habituellement un 1 aux Etats-Unis et au Canada)
Téléphone Number:   (maximum de 10 chiffres - chiffres seulement)
Fils Existants De Recherche:   (Cette option si vérifié essayera de trouver le numéro de téléphone dans le système avant de l'insérer comme nouvelle avance)


Si vous voulez composer un numéro et le faire ne pas ajouter comme nouvelle avance, entrez dans dialstring exact ce vous veulent appeler dans le domaine de priorité de cadran ci-dessous. Au décrochement cet appel vous devrez ouvrir les APPELS DANS CE lien de SESSION au fond de l'écran et les accrocher vers le haut en cliquant sur son lien de canal là.
 
Dépassement De Cadran:   (les chiffres satisfont seulement)
-
- Cadran Maintenant -                 - Retournez -
-
- - - - -Votre Statut:
Calls Dialing: -
- - - - - -
- - Transfert - Conférence
- PLUS ÉTROIT INTERNE - GENS DU PAYS PLUS ÉTROITS - CODE - Ligne De Xfer De Décrochement - Décrochement Les deux Lignes - -
- - Nombre à appeler   - secondes   - channel - - OVERRIDE   - D1 - D2 -
- - Cadran Avec Le Client - Cadran De Client De Parc - APPEL DU CONGÉ 3-WAY - Transfert D'Aveugle De Cadran - Blind Transfer VMail Message -
-
-
- - - - -
Fil Dispositioned As:

- -
-
-
- - - - - - - -
Touches Directes De Disposition: - Si actif, appuyez sur simplement la touche de clavier pour la:
- - - - - -
-
- - -
Aucun n'est en votre session:
- Retournez -

- Agent D'Appel Encore -
-
- - -
Le client a raccroché:
- Retournez -

- Finition et appel de disposition - -
-
- - -
Appel Wrapup : secondes restantes dans le wrapup

- -

- Finition Wrapup et passer - -
-
- - -

DÉCONNEXION
-
- - -
-
- - -
 
-
- - -
Tous les changements faits au client que l'information ci-dessous actuellement ne sera pas comitted, vous doivent changer l'information de client avant vous décrochement l'appel.
-
- - -
APPEL DE DISPOSITION :       Décrochement Encore       réduisez au minimum
- Extrémité-de-appelez Le Choix De Disposition -
- CESSEZ D'APPELER
- REMISE | - SOUMETTEZ -

- WEB FORM SOUMETTEZ -

  -
-
- - - -
Choisissez une date de rappel de service :
- - - Choisissez une date ci-dessous   -     - Hour: -   - Minutes: -   - -  
- MON RAPPEL DE SERVICE SEULEMENT
";} - ?> - Commentaires de CB:

- - SOUMETTEZ

- -

  -
-
- - -
UN CHOIX DE GROUPE D'ARRIVÉE PLUS ÉTROIT
- Un Choix De Groupe D'arrivée Plus étroit -
- APPELER MÉLANGÉ(en partance activé)
- REMISE | - SOUMETTEZ -



  -
-
- - - - LaManche - LaManche - MON RAPPEL DE SERVICE SEULEMENT
";} - ?> -
- - - - - - - -
TRANSFERT DE PHASE D'APPEL
La Manche à transférer: LaManche
Prolongements:
Menu De Prolongements
-
- Envoyez à la prolongation choisie

- Envoyez dans la boîte choisie de vmail

- Envoyez à ce nombre:


- RÉGÉNÉREZ


- De nouveau à la fenêtre principale

-
Conférences:
(cliquez sur un nombre ci-dessous pour envoyer à une)
Envoyez mon canal aussi
Menu De Conférences
-
- - - - -
VICICADRAN SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUT:
-
-Prochain Nombre De Cadran
- PRÉVISION DE FIL
- TÉLÉPHONE D'ALT
- - -DOSSIER D'ENREGISTREMENT:
-
-
-IDENTIFICATION DISQUE:
-
- -Commencez À enregistrer
-
-Forme de Web
-
-Appel De Parc
-Transfert - Conférence
-
-Client De Décrochement
-
-Envoyez DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
secondes:   LaManche:   Temps De Cust:
L'Information De Client:
Titre:   D'abord:   MI :  Bout:
Adresse1:
Adresse2:   Adresse3:
Ville:   État:   Code postal:
Province:   Identification De Fournisseur:
Téléphone:   DialCode:   Alt. Téléphone:
Exposition:   Email:
Commentaires:
- -
-


  - -
- - - - -
Version d'enchaînement-client de VICICADRAN:     CONSTRUCTION:               Serveur:              
-Montrez l'information de canal de conférence téléphonique
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TOUCHES DIRECTES INACTIVES - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc_fr/voicemail_check.php b/LANG_agc/agc_fr/voicemail_check.php deleted file mode 100644 index 0fbb86d2..00000000 --- a/LANG_agc/agc_fr/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Contrôle De Voicemail"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "boîte de voicemail $vmail_box est inadmissible\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_it/active_list_refresh.php b/LANG_agc/agc_it/active_list_refresh.php deleted file mode 100644 index ca2e42d8..00000000 --- a/LANG_agc/agc_it/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Esposizione Della Lista: "; -if ($ADD==1) {echo "Estensioni In tensione";} -if ($ADD==2) {echo "Estensioni Occupate";} -if ($ADD==3) {echo "Linee Esterne";} -if ($ADD==4) {echo "Estensioni Locali";} -if ($ADD==5) {echo "Congressi";} -if ($ADD==99999) {echo "AIUTO";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_it/astguiclient.php b/LANG_agc/agc_it/astguiclient.php deleted file mode 100644 index 76229631..00000000 --- a/LANG_agc/agc_it/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Ora avete annotato fuori. Grazie\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "web client astGUIclient: Inizio attività\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività
 
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIMANOPOLA|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIMANOPOLA|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client astGUIclient: Inizio attività Del Telefono\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Italiano
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Inizio attività Del Telefono
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client astGUIclient: Inizio attività Del Telefono\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività Del Telefono
 
Spiacente, il vostri inizio attività del telefono e parola d'accesso:
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client astGUIclient\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -TERMINE
\n"; ?> -
Pannello PrincipaleLinee Attive PannelloPannello Di CongressiControlli VoicemailVive La Chiamata
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Tronco Di Hangup   |   - Tronco Di Dirottamento   |   - Ascolta Il Tronco   |   - Rinfreschi   |   - Di nuovo alla finestra principale -
-
- - -
HANGUP LOCALE

- Menu Locale Attivo
- Local Di Hangup   |   - Local Di Dirottamento   |   - Ascolta Il Local   |   - Rinfreschi   |   - Di nuovo alla finestra principale -
-
- - - - - - - -
TRASFERIMENTO IN TENSIONE DI CHIAMATA
Manica da trasferire: Manica
Estensioni:
Menu Di Estensioni
-
- Trasmetta all'estensione selezionata

- Trasmetta alla scatola selezionata del vmail

- _ trasmett questo numero:


- Rinfreschi


- Di nuovo alla finestra principale

-
Congressi:
(scatti sopra un numero qui sotto per trasmettere ad un congresso)
Trasmetta la mia scanalatura anche
Menu Di Congressi
-
- - - - - -
Manopola LOCALE Di Estensioni
Telefono che denomina da: Manica
Estensioni:
Menu Di Estensioni
-
- Estensione selezionata chiamata

- Scatola del vmail selezionata chiamata

- Rinfreschi


- Di nuovo alla finestra principale

-
-
- - -
CHIAMATE PARCHEGGIATE:
- Di nuovo alla finestra principale

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NUOVO:     VECCHIO:             MANOPOLA MANUALE       MANOPOLA
CHIAMATE PARCHEGGIATE: 0                ESTENSIONI LOCALI DELLA MANOPOLA
CHIAMATE OUTBOUND:
CHIAMATE INBOUND:
VERSIONEE astGUIclient del fotoricettore-cliente: CONFIGURAZIONE:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITI       pubblichi
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITI

 
PRESENTI I CAMBIAMENTI dei FAVORITI - richiede il termine attività
DI NUOVO ALLA FINESTRA PRINCIPALE - ignori i cambiamenti fatti
-
- -
- - - - - - - - - - - - - -
-PAUSA | INIZIO     La velocità di rinfrescamento: 1000 ms Più velocemente | Più lento

-
Inizializzazione..
-
Estensioni Attive
-RINFRESCHI | -ORDINE | -
Linee Esterne
-RINFRESCHI | -ORDINE | -
Estensioni Locali
-RINFRESCHI | -ORDINE | -
- I Dati Vanno Qui

-
- I Dati Vanno Qui

Azione Del Tronco -
- I Dati Vanno Qui

Azione Locale -
-
- - - - -
- - -Lista Di Congressi - - - -
-Scatti sopra un numero di stanza di congresso a sinistra per l'Info su -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc_it/call_log_display.php b/LANG_agc/agc_it/call_log_display.php deleted file mode 100644 index cc1556c0..00000000 --- a/LANG_agc/agc_it/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Esposizione Del Ceppo Di Chiamata"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten è non valido o protocollo $protocol è non valido\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_it/conf_exten_check.php b/LANG_agc/agc_it/conf_exten_check.php deleted file mode 100644 index ceecdb82..00000000 --- a/LANG_agc/agc_it/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Controllo Di Estensione Di Conf"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten è non valido\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Condizione: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ManicaA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ManicaA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ManicaA[$counter] ~"; - # echo "$ManicaA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten è non valido or Exten $exten è non valido\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Congresso $conf_exten è stato registrato a $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_it/dbconnect.php b/LANG_agc/agc_it/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc_it/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc_it/inbound_popup.php b/LANG_agc/agc_it/inbound_popup.php deleted file mode 100644 index dc270cdd..00000000 --- a/LANG_agc/agc_it/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -CHIAMATA INBOUND IN TENSIONE"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

CHIAMATA INBOUND IN TENSIONE

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid è non valido\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Manica: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Manica=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "ABITUDINE - \n"; - - echo "
Il Numero Ha composto: $row[8]
Note: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "TRASMETTA AL MIO VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_it/live_exten_check.php b/LANG_agc/agc_it/live_exten_check.php deleted file mode 100644 index 857a5afa..00000000 --- a/LANG_agc/agc_it/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Controllo In tensione Di Estensione"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten è non valido o protocollo $protocol è non valido\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ManicaA[$loop_count] = "$row[0]"; - $ManicaB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $ManicaA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_it/manager_send.php b/LANG_agc/agc_it/manager_send.php deleted file mode 100644 index 4f552da2..00000000 --- a/LANG_agc/agc_it/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Il Responsabile Trasmette: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AIUTO";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten è non valido or queryCID $queryCID è non valido, Originate ordine non inserito\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate ordine trasmesso per Exten $exten Manica $channel su $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nOriginateName Action non trasmesso\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nOriginateNameVmail Action non trasmesso\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten è non valido or queryCID $queryCID è non valido, Originate ordine non inserito\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate ordine trasmesso per Exten $exten Manica $channel su $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten è non valido or ext_context $ext_context or queryCID $queryCID è non valido, Hangup ordine non inserito\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Manica $channel è non valido or queryCID $queryCID è non valido, Hangup ordine non inserito\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel non è in tensione su $call_server_ip, Checking Live Manica...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Manica $channel non è in tensione su $call_server_ip, Hangup ordine non inserito $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup ordine trasmesso per Manica $channel su $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "auto_dial_level $auto_dial_level deve essere regolato\n"; - echo "campaign $campaign deve essere regolato\n"; - echo "uniqueid $uniqueid deve essere regolato\n"; - echo "lead_id $lead_id deve essere regolato\n"; - echo "\nRedirectVD Action non trasmesso\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "parkedby $parkedby deve essere regolato\n"; - echo "\nRedirectToPark Action non trasmesso\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirectFromPark Action non trasmesso\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirectName Action non trasmesso\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirectNameVmail Action non trasmesso\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "ExtraManica $extrachannel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirect Action non trasmesso\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Non può trovare il congresso vuoto su $server_ip, Redirect ordine non inserito\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Manica $channel non è in tensione su $call_server_ip, Redirect ordine non inserito\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Manica $channel non è in tensione su $server_ip, Redirect ordine non inserito\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra ordine trasmesso per Manica $channel and \nExtraManica $extrachannel\n to $exten su $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra ordine trasmesso per Manica $channel su $call_server_ip and \nExtraManica $extrachannel\n to $exten su $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirect Action non trasmesso\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Manica $channel non è in tensione su $server_ip, Redirect ordine non inserito\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect ordine trasmesso per Manica $channel su $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Manica $channel è non valido or queryCID $queryCID è non valido or filename: $filename è non valido, $ACTION ordine non inserito\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Manica $channel non è in tensione su $server_ip, $ACTION ordine non inserito\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION ordine trasmesso per Manica $channel su $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Manica $channel è non valido or exten $exten è non valido or filename: $filename è non valido, $ACTION ordine non inserito\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going su in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION ordine trasmesso per Manica $channel su $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n LA REGISTRAZIONE DURERÀ FINO A 60 MINUTI\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_it/park_calls_display.php b/LANG_agc/agc_it/park_calls_display.php deleted file mode 100644 index 75c0a25f..00000000 --- a/LANG_agc/agc_it/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Esposizione Parcheggiata Di Chiamate"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten è non valido o protocollo $protocol è non valido\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_it/vdc_db_query.php b/LANG_agc/agc_it/vdc_db_query.php deleted file mode 100644 index ea28cf72..00000000 --- a/LANG_agc/agc_it/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Scritto Di Domanda Della Base di dati"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Scelta Del Gruppo $closer_choice è non valido\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Scelta Del Gruppo $closer_choice è stato registrato all'utente $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "TRAMOGGIA VUOTA\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context è non valido\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NUMERO\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCHIAMATA - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "TRAMOGGIA VUOTA\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context è non valido\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCHIAMATA - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CHIAMATA NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context è non valido\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID è non valido\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "CEPPO NON INSERITO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign è non valido\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserito: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "CEPPO NON INSERITO\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CHIAMATA_LOG Inserito: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "CEPPO NON INSERITO\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "CEPPO NON INSERITO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id è non valido\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "CEPPO NON INSERITO\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campagna $campaign è non valido\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCHIAMATA in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCHIAMATA - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCHIAMATA - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCHIAMATA - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send su to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If CHIAMATABK, change vicidial_callback record to INACTIVE - if ($dispo == 'CHIAMATABK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user su $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten è non valido\n"; - exit; - } -else - { - ##### Insert a TERMINE record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','TERMINE','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation su the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id è non valido\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CHIAMATABACK ENTRY - if ( ($dispo_choice == 'CBHVECCHIO') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' è stato cambiato a ' . $dispo_choice . " Condizione\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id è non valido\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id le informazioni sono state aggiornate\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage è non valido\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' è ora nella condizione ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list è non valido\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc_it/vicidial.php b/LANG_agc/agc_it/vicidial.php deleted file mode 100644 index a6b51ad1..00000000 --- a/LANG_agc/agc_it/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "Ora avete annotato fuori. Grazie\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of secondi for campaign call and agent stats - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "Web client di VICIMANOPOLA: Re-Inizio attività\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Italiano
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Inizio attività
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Campagna: $camp_form_code

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "Web client di VICIMANOPOLA: Inizio attività Di Campagna\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Inizio attività Dell'Utente

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività Di Campagna
 
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Campagna: $camp_form_code

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "Web client di VICIMANOPOLA: Inizio attività\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Campagna: $camp_form_code

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "Web client di VICIMANOPOLA: Inizio attività Del Telefono\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Italiano
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Inizio attività Del Telefono
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_secondi=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "La campagna non attiva, prova prego ancora
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "L'inizio attività errato, prova prego ancora
"; - } - } - if ($VDloginDISPLAY) - { - echo "Web client di VICIMANOPOLA: Inizio attività Di Campagna\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività Di Campagna
 
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Campagna: $camp_form_code

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "Web client di VICIMANOPOLA: Inizio attività Del Telefono Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività Error
 
Spiacente, il vostri inizio attività del telefono e parola d'accesso:
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "Web client di VICIMANOPOLA\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed su this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login su phone: $SIP_user alla campagna: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NUOVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "Web client di VICIMANOPOLA: VICIMANOPOLA Inizio attività Di Campagna\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "Spiacenti, non ci sono cavi nella tramoggia per questa campagna\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Inizio attività: \n
"; - echo "Parola d'accesso:
\n"; - echo "Campagna: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "Web client di VICIMANOPOLA: VICIMANOPOLA Inizio attività Di Campagna\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Inizio attività: \n
"; - echo "Parola d'accesso:
\n"; - echo "Campagna: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -TERMINE\n"; ?> -
-
- - - - - - - - -
VICIMANOPOLASCRIPT   LIVE     ID di sessione: Vive La Chiamata
-
- - - - -

VICIMANOPOLA
-
- - -MANOPOLA MANUALE
-
- - -X CHIAMATE RIPETUTE ATTIVE
-
- - -
CHIAMATE RIPETUTE PER L'AGENTE :
Scatti sopra una chiamata ripetuta qui sotto ora per denominare la parte posteriore del cliente. Se scattate sopra un'annotazione qui sotto per denominarli, sarà rimossa dalla lista. -
-
-
  - Rinfreschi -                 - Vada Indietro -
-
- - -
NUOVO CAVO MANUALE DELLA MANOPOLA PER :

Fornisca le informazioni qui sotto per il nuovo cavo che desiderate denominare. -
- \n"; - } - ?> - Nota: tutti i nuovi cavi manuali della manopola entreranno nella lista 999

- - - - - - - - - - - - - - - -
Codice Della Manopola:   (Ciò è solitamente un 1 negli S.U.A. e nel Canada)
Telefono Number:   (un massimo delle 10 cifre - cifre soltanto)
Cavi Esistenti Di Ricerca:   (Questa opzione se controllato tenterà di trovare il numero di telefono nel sistema prima dell'inserimento esso come cavo nuovo)


Se desiderate comporre un numero e farli non aggiungere come nuovo cavo, entri nel dialstring esatto quel voi desiderano denominare nel giacimento della sovrapposizione di un comando manuale della manopola qui sotto. Al hangup questa chiamata dovrete aprire le CHIAMATE in QUESTO collegamento di SESSIONE alla parte inferiore dello schermo ed appenderli in su scattandosi sul relativo collegamento della scanalatura là.
 
Sovrapposizione di un comando manuale Della Manopola:   (le cifre soddisfano soltanto)
-
- Manopola Ora -                 - Vada Indietro -
-
- - - - -La Vostra Condizione:
Calls Dialing: -
- - - - - -
- - Trasferimento - Congresso
- PIÙ VICINO INTERNO - LOCAL PIÙ VICINO - CODE - Linea Di Xfer Di Hangup - Hangup Entrambe le Linee - -
- - Numero da denominare   - secondi   - channel - - OVERRIDE   - D1 - D2 -
- - Manopola Con Il Cliente - Manopola Del Cliente Del Parco - CHIAMATA DI PERMESSO 3-WAY - Trasferimento Dei Ciechi Della Manopola - Blind Transfer VMail Message -
-
-
- - - - -
Cavo Dispositioned As:

- -
-
-
- - - - - - - -
Chiavi Calde Di Disposizione: - Una volta attivo, premi semplicemente la chiave di tastiera per la:
- - - - - -
-
- - -
Nessuno è nella vostra sessione:
- Vada Indietro -

- Agente Di Chiamata Ancora -
-
- - -
Il cliente ha appeso in su:
- Vada Indietro -

- Rivestimento e chiamata di disposizione - -
-
- - -
Chiamata Wrapup: secondi restanti nel wrapup

- -

- Rivestimento Wrapup e pass - -
-
- - -

TERMINE
-
- - -
-
- - -
 
-
- - -
Tutti i cambiamenti fatti al cliente che le informazioni qui sotto attualmente non saranno comitted, voi devono cambiare le informazioni del cliente prima di voi hangup la chiamata.
-
- - -
CHIAMATA DI DISPOSIZIONE :       Hangup Ancora       minimizzi
- Estremità-de-denomini La Selezione Di Disposizione -
- SMETTA DI DENOMINARE
- RISISTEMAZIONE | - PRESENTI -

- WEB FORM PRESENTI -

  -
-
- - - -
Selezioni una data di chiamata ripetuta :
- - - Selezioni una data qui sotto   -     - Hour: -   - Minutes: -   - -  
- LA MIA CHIAMATA RIPETUTA SOLTANTO
";} - ?> - Osservazioni dei CB:

- - PRESENTI

- -

  -
-
- - -
SELEZIONE DI GRUPPO INBOUND PIÙ VICINA
- Selezione Di Gruppo Inbound Più vicina -
- CHIAMATA MESCOLATA(outbound attivato)
- RISISTEMAZIONE | - PRESENTI -



  -
-
- - - - Manica - Manica - LA MIA CHIAMATA RIPETUTA SOLTANTO
";} - ?> -
- - - - - - - -
TRASFERIMENTO IN TENSIONE DI CHIAMATA
Manica da trasferire: Manica
Estensioni:
Menu Di Estensioni
-
- Trasmetta all'estensione selezionata

- Trasmetta alla scatola selezionata del vmail

- _ trasmett questo numero:


- RINFRESCHI


- Di nuovo alla finestra principale

-
Congressi:
(scatti sopra un numero qui sotto per trasmettere ad un congresso)
Trasmetta la mia scanalatura anche
Menu Di Congressi
-
- - - - -
VICIMANOPOLA SCRIPT
-
- - - - - - - - - - - - - - - - - -
CONDIZIONE:
-
-Numero Seguente Della Manopola
- PREVISIONE DEL CAVO
- ALT DEL TELEFONO
- - -LIMA DI REGISTRAZIONE:
-
-
-IDENTIFICAZIONE ANNOTAZIONE:
-
- -Inizi A registrare
-
-Forma Di Fotoricettore
-
-Chiamata Del Parco
-Trasferimento - Congresso
-
-Cliente Di Hangup
-
-Trasmetta DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
secondi:   Manica:   Tempo Di Cust:
Le Informazioni Del Cliente:
Titolo:   In primo luogo:   Mi:  Ultimo:
Indirizzo1:
Indirizzo2:   Indirizzo3:
Città:   Dichiari:   PostCode:
Provincia:   Identificazione Del Fornitore:
Telefono:   DialCode:   Alt. Telefono:
Esposizione:   Email:
Osservazioni:
- -
-


  - -
- - - - -
Versione del fotoricettore-cliente di VICIMANOPOLA:     CONFIGURAZIONE:               Assistente:              
-Mostri le informazioni della scanalatura di chiamata di congresso
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -CHIAVI CALDE INATTIVE - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc_it/voicemail_check.php b/LANG_agc/agc_it/voicemail_check.php deleted file mode 100644 index 4910d435..00000000 --- a/LANG_agc/agc_it/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Controllo Di Voicemail"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "scatola del voicemail $vmail_box è non valido\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_pt/active_list_refresh.php b/LANG_agc/agc_pt/active_list_refresh.php deleted file mode 100644 index 11e2d444..00000000 --- a/LANG_agc/agc_pt/active_list_refresh.php +++ /dev/null @@ -1,463 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.7'; -$build = '60421-1155'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Exposição Da Lista: "; -if ($ADD==1) {echo "Extensões Vivas";} -if ($ADD==2) {echo "Extensões Ocupadas";} -if ($ADD==3) {echo "Linhas Exteriores";} -if ($ADD==4) {echo "Extensões Locais";} -if ($ADD==5) {echo "Conferências";} -if ($ADD==99999) {echo "AJUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_pt/astguiclient.php b/LANG_agc/agc_pt/astguiclient.php deleted file mode 100644 index d222bbd0..00000000 --- a/LANG_agc/agc_pt/astguiclient.php +++ /dev/null @@ -1,2890 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.11'; -$build = '60421-1043'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Você tem registrado agora para fora. Obrigado\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "web client astGUIclient: Início de uma sessão\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Português
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICISELETOR|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICISELETOR|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client astGUIclient: Início de uma sessão Do Telefone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Português
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Início de uma sessão Do Telefone
 
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client astGUIclient: Início de uma sessão Do Telefone\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Português
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão Do Telefone
 
Pesaroso, seus início de uma sessão do telefone e senha não seja:
 
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client astGUIclient\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
Painel PrincipalLinhas Ativas PainelPainel Das ConferênciasVerifique VoicemailVive A Chamada
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Tronco Do Hangup   |   - Tronco Do Hijack   |   - Escuta O Tronco   |   - Refresque   |   - Para trás à janela principal -
-
- - -
HANGUP LOCAL

- Menu Local Ativo
- Local Do Hangup   |   - Local Do Hijack   |   - Escuta O Local   |   - Refresque   |   - Para trás à janela principal -
-
- - - - - - - -
TRANSFERÊNCIA VIVA DA CHAMADA
Canaleta a ser transferida: Canaleta
Extensões:
Menu Das Extensões
-
- Emita à extensão selecionada

- Emita à caixa selecionada do vmail

- Emita a este número:


- Refresque


- Para trás à janela principal

-
Conferências:
(estale sobre um número abaixo para emitir a uma conferência)
Emita minha canaleta demasiado
Menu Das Conferências
-
- - - - - -
Seletor LOCAL Das Extensões
Telefone que chama-se de: Canaleta
Extensões:
Menu Das Extensões
-
- Extensão selecionada chamada

- Caixa selecionada chamada do vmail

- Refresque


- Para trás à janela principal

-
-
- - -
CHAMADAS ESTACIONADAS:
- Para trás à janela principal

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NOVO:     VELHO:             SELETOR MANUAL       SELETOR
CHAMADAS ESTACIONADAS: 0                EXTENSÕES LOCAIS DO SELETOR
CHAMADAS OUTBOUND :
CHAMADAS INBOUND:
VERSÃO astGUIclient do correia-cliente: CONFIGURAÇÃO:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITOS       edite
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITOS

 
SUBMETA MUDANÇAS dos FAVORITOS - requer o logout
PARA TRÁS À JANELA PRINCIPAL - ignore as mudanças feitas
-
- -
- - - - - - - - - - - - - -
-PAUSA | COMEÇO     Refresque a taxa: 1000 ms Mais rapidamente | Mais lento

-
Inicializar..
-
Extensões Ativas
-REFRESQUE | -ORDEM | -
Linhas Exteriores
-REFRESQUE | -ORDEM | -
Extensões Locais
-REFRESQUE | -ORDEM | -
- Os Dados Vão Aqui

-
- Os Dados Vão Aqui

Ação Do Tronco -
- Os Dados Vão Aqui

Ação Local -
-
- - - - -
- - -Lista Das Conferências - - - -
-Estale sobre um número de quarto da conferência na esquerda para o -
- - - -
- - - - - - - - - - - - - - diff --git a/LANG_agc/agc_pt/call_log_display.php b/LANG_agc/agc_pt/call_log_display.php deleted file mode 100644 index 5da9fe51..00000000 --- a/LANG_agc/agc_pt/call_log_display.php +++ /dev/null @@ -1,192 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.7'; -$build = '60421-1401'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Exposição Do Registro Da Chamada"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten é inválido ou protocolo $protocol é inválido\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_pt/conf_exten_check.php b/LANG_agc/agc_pt/conf_exten_check.php deleted file mode 100644 index 51b67358..00000000 --- a/LANG_agc/agc_pt/conf_exten_check.php +++ /dev/null @@ -1,258 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.8'; -$build = '60421-1405'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificação Da Extensão De Conf"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten é inválido\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanaletaA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanaletaA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$CanaletaA[$counter] ~"; - # echo "$CanaletaA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten é inválido or Exten $exten é inválido\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conferência $conf_exten foi registado a $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_pt/dbconnect.php b/LANG_agc/agc_pt/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/LANG_agc/agc_pt/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/LANG_agc/agc_pt/inbound_popup.php b/LANG_agc/agc_pt/inbound_popup.php deleted file mode 100644 index 16abb2a8..00000000 --- a/LANG_agc/agc_pt/inbound_popup.php +++ /dev/null @@ -1,348 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60421-1043'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -CHAMADA INBOUND VIVA"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

CHAMADA INBOUND VIVA

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid é inválido\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Canaleta: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Canaleta=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "COSTUME - \n"; - - echo "
O Número Marcou: $row[8]
Notas: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "EMITA A MEU VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_pt/live_exten_check.php b/LANG_agc/agc_pt/live_exten_check.php deleted file mode 100644 index ef528784..00000000 --- a/LANG_agc/agc_pt/live_exten_check.php +++ /dev/null @@ -1,273 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.11'; -$build = '60421-1359'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificação Viva Da Extensão"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten é inválido ou protocolo $protocol é inválido\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $CanaletaA[$loop_count] = "$row[0]"; - $CanaletaB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $CanaletaA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_pt/manager_send.php b/LANG_agc/agc_pt/manager_send.php deleted file mode 100644 index a1309814..00000000 --- a/LANG_agc/agc_pt/manager_send.php +++ /dev/null @@ -1,903 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.23'; -$build = '60421-1413'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "O Gerente Emite: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AJUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten é inválido or queryCID $queryCID é inválido, Originate comando não introduzido\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando emitido para Exten $exten Canaleta $channel em $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nOriginateName Action não emitido\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nOriginateNameVmail Action não emitido\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten é inválido or queryCID $queryCID é inválido, Originate comando não introduzido\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando emitido para Exten $exten Canaleta $channel em $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten é inválido or ext_context $ext_context or queryCID $queryCID é inválido, Hangup comando não introduzido\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Canaleta $channel é inválido or queryCID $queryCID é inválido, Hangup comando não introduzido\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel não está vivo em $call_server_ip, Checking Live Canaleta...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Canaleta $channel não está vivo em $call_server_ip, Hangup comando não introduzido $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup comando emitido para Canaleta $channel em $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "auto_dial_level $auto_dial_level deve ser ajustado\n"; - echo "campaign $campaign deve ser ajustado\n"; - echo "uniqueid $uniqueid deve ser ajustado\n"; - echo "lead_id $lead_id deve ser ajustado\n"; - echo "\nRedirectVD Action não emitido\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "parkedby $parkedby deve ser ajustado\n"; - echo "\nRedirectToPark Action não emitido\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirectFromPark Action não emitido\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirectName Action não emitido\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirectNameVmail Action não emitido\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "ExtraCanaleta $extrachannel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirect Action não emitido\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Não pode encontrar a conferência vazia em $server_ip, Redirect comando não introduzido\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Canaleta $channel não está vivo em $call_server_ip, Redirect comando não introduzido\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Canaleta $channel não está vivo em $server_ip, Redirect comando não introduzido\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando emitido para Canaleta $channel and \nExtraCanaleta $extrachannel\n to $exten em $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando emitido para Canaleta $channel em $call_server_ip and \nExtraCanaleta $extrachannel\n to $exten em $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirect Action não emitido\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canaleta $channel não está vivo em $server_ip, Redirect comando não introduzido\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect comando emitido para Canaleta $channel em $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canaleta $channel é inválido or queryCID $queryCID é inválido or filename: $filename é inválido, $ACTION comando não introduzido\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canaleta $channel não está vivo em $server_ip, $ACTION comando não introduzido\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION comando emitido para Canaleta $channel em $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canaleta $channel é inválido or exten $exten é inválido or filename: $filename é inválido, $ACTION comando não introduzido\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going em in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION comando emitido para Canaleta $channel em $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n A GRAVAÇÃO DURARÁ ATÉ 60 MINUTOS\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/LANG_agc/agc_pt/park_calls_display.php b/LANG_agc/agc_pt/park_calls_display.php deleted file mode 100644 index 620cff28..00000000 --- a/LANG_agc/agc_pt/park_calls_display.php +++ /dev/null @@ -1,142 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.3'; -$build = '60421-1111'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Exposição Estacionada Das Chamadas"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten é inválido ou protocolo $protocol é inválido\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/LANG_agc/agc_pt/vdc_db_query.php b/LANG_agc/agc_pt/vdc_db_query.php deleted file mode 100644 index db511ca0..00000000 --- a/LANG_agc/agc_pt/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Certificado Da Pergunta Da Base de dados"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Escolha Do Grupo $closer_choice é inválido\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Escolha Do Grupo $closer_choice foi registado ao usuário $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "FUNIL VAZIO\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context é inválido\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NÚMERO\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "FUNIL VAZIO\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context é inválido\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CHAMADA NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context é inválido\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID é inválido\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "REGISTRO NÃO ENTRADO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign é inválido\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Introduzido: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "REGISTRO NÃO ENTRADO\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CHAMADA_LOG Introduzido: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "REGISTRO NÃO ENTRADO\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "REGISTRO NÃO ENTRADO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id é inválido\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "REGISTRO NÃO ENTRADO\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campanha $campaign é inválido\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCHAMADA in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCHAMADA - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCHAMADA - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send em to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If CHAMADABK, change vicidial_callback record to INACTIVE - if ($dispo == 'CHAMADABK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user em $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten é inválido\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation em the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id é inválido\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CHAMADABACK ENTRY - if ( ($dispo_choice == 'CBHVELHO') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' foi mudado a ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id é inválido\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id a informação foi atualizada\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage é inválido\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' está agora no status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list é inválido\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/LANG_agc/agc_pt/vicidial.php b/LANG_agc/agc_pt/vicidial.php deleted file mode 100644 index 5f6c2a90..00000000 --- a/LANG_agc/agc_pt/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "Você tem registrado agora para fora. Obrigado\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of segundos for campaign call and agent stats - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "Web client de VICISELETOR: Re-Início de uma sessão\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Português
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Início de uma sessão
 
Início de uma sessão Do Telefone:
Senha Do Telefone:
Início de uma sessão Do Usuário:
Senha Do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "Web client de VICISELETOR: Início de uma sessão Da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Português
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Início de uma sessão Do Usuário

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão Da Campanha
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "Web client de VICISELETOR: Início de uma sessão\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Português
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão
 
Início de uma sessão Do Telefone:
Senha Do Telefone:
Início de uma sessão Do Usuário:
Senha Do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "Web client de VICISELETOR: Início de uma sessão Do Telefone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "
English Português
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Início de uma sessão Do Telefone
 
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_segundos=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "A campanha nao ativa, tenta por favor outra vez
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "O início de uma sessão incorreto, tenta por favor outra vez
"; - } - } - if ($VDloginDISPLAY) - { - echo "Web client de VICISELETOR: Início de uma sessão Da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Português
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão Da Campanha
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "Web client de VICISELETOR: Início de uma sessão Do Telefone Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Português
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão Error
 
Pesaroso, seus início de uma sessão do telefone e senha não seja:
 
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "Web client de VICISELETOR\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed em this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login em phone: $SIP_user à campanha: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NOVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "Web client de VICISELETOR: VICISELETOR Início de uma sessão Da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Português
\n"; - echo "Pesaroso, não há nenhuma ligação no funil para esta campanha\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Início de uma sessão: \n
"; - echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "Web client de VICISELETOR: VICISELETOR Início de uma sessão Da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Português
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Início de uma sessão: \n
"; - echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICISELETORSCRIPT   LIVE     sessão ID: Vive A Chamada
-
- - - - -

VICISELETOR
-
- - -SELETOR MANUAL
-
- - -X RECHAMADAS ATIVAS
-
- - -
RECHAMADAS PARA O AGENTE :
Estale sobre uma rechamada abaixo para chamar agora a parte traseira do cliente. Se você estalar sobre um registro abaixo para o chamar, estará removido da lista. -
-
-
  - Refresque -                 - Vá Para trás -
-
- - -
LIGAÇÃO MANUAL NOVA DO SELETOR PARA :

Incorpore a informação abaixo para a ligação que nova você deseja se chamar. -
- \n"; - } - ?> - Nota: todas as ligações manuais novas do seletor entrarão na lista 999

- - - - - - - - - - - - - - - -
Código Do Seletor:   (Este é geralmente um 1 nos EUA e no Canadá)
Telefone Number:   (máximo de 10 dígitos - dígitos somente)
Ligações Existentes Da Busca:   (Esta opção se verificado tentará encontrar o número de telefone no sistema antes de introduzi-lo como uma ligação nova)


Se você quiser marcar um número e o ter não adicionado como uma ligação nova, entre no dialstring exato esse você querem chamar-se abaixo no campo da ultrapassagem do seletor. Ao hangup esta chamada você terá que abrir as CHAMADAS ncEsta ligação da SESSÃO no fundo da tela e pendurá-las acima estalando em sua ligação da canaleta lá.
 
Ultrapassagem Do Seletor:   (os dígitos satisfazem somente)
-
- Seletor Agora -                 - Vá Para trás -
-
- - - - -Seu Status:
Calls Dialing: -
- - - - - -
- - Transferência - Conferência
- MAIS PRÓXIMO INTERNO - LOCAL MAIS PRÓXIMO - CODE - Linha De Xfer Do Hangup - Hangup Ambas as Linhas - -
- - Número a chamar-se   - segundos   - channel - - OVERRIDE   - D1 - D2 -
- - Seletor Com Cliente - Seletor Do Cliente Do Parque - CHAMADA DA LICENÇA 3-WAY - Transferência Da Cortina Do Seletor - Blind Transfer VMail Message -
-
-
- - - - -
Ligação Dispositioned Como:

- -
-
-
- - - - - - - -
Chaves Quentes Da Disposição: - Quando ativo, pressione simplesmente a chave de teclado para a:
- - - - - -
-
- - -
Noone está em sua sessão:
- Vá Para trás -

- Agente Da Chamada Outra vez -
-
- - -
O cliente pendurou acima:
- Vá Para trás -

- Revestimento e chamada da disposição - -
-
- - -
Chamada Wrapup: segundos restantes no wrapup

- -

- Revestimento Wrapup e movimento sobre - -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Todas as mudanças feitas ao cliente que a informação abaixo neste tempo não será comitted, você devem mudar a informação do cliente antes de você hangup a chamada.
-
- - -
CHAMADA DA DISPOSIÇÃO :       Hangup Outra vez       minimize
- Extremidade-$$$-CHAME A Seleção Da Disposição -
- PARE DE CHAMAR-SE
- RESTAURAÇÃO | - SUBMETA -

- WEB FORM SUBMETA -

  -
-
- - - -
Selecione uma data da rechamada :
- - - Selecione uma data abaixo   -     - Hour: -   - Minutes: -   - -  
- MINHA RECHAMADA SOMENTE
";} - ?> - Comentários dos CB:

- - SUBMETA

- -

  -
-
- - -
SELEÇÃO DE GRUPO INBOUND MAIS PRÓXIMA
- Seleção De Grupo Inbound Mais próxima -
- CHAMADA MISTURADA(outbound ativado)
- RESTAURAÇÃO | - SUBMETA -



  -
-
- - - - Canaleta - Canaleta - MINHA RECHAMADA SOMENTE
";} - ?> -
- - - - - - - -
TRANSFERÊNCIA VIVA DA CHAMADA
Canaleta a ser transferida: Canaleta
Extensões:
Menu Das Extensões
-
- Emita à extensão selecionada

- Emita à caixa selecionada do vmail

- Emita a este número:


- REFRESQUE


- Para trás à janela principal

-
Conferências:
(estale sobre um número abaixo para emitir a uma conferência)
Emita minha canaleta demasiado
Menu Das Conferências
-
- - - - -
VICISELETOR SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Número Seguinte Do Seletor
- INSPECÇÃO PRÉVIA DA LIGAÇÃO
- ALT DO TELEFONE
- - -LIMA DE GRAVAÇÃO:
-
-
-ID REGISTRO:
-
- -Comece Gravar
-
-Formulário Da Correia fotorreceptora
-
-Chamada Do Parque
-Transferência - Conferência
-
-Cliente Do Hangup
-
-Emita DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
segundos:   Canaleta:   Tempo De Cust:
Informação Do Cliente:
Título:   Primeiramente:   Mi:  Último:
Endereço1:
Endereço2:   Endereço3:
Cidade:   Estado:   PostCode:
Província:   Vendedor Id:
Telefone:   DialCode:   Alt. Telefone:
Mostra:   Email:
Comentários:
- -
-


  - -
- - - - -
Versão do correia-cliente de VICISELETOR:     CONFIGURAÇÃO:               Usuário:              
-Mostre a informação da canaleta da chamada de conferência
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -CHAVES QUENTES INATIVAS - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/LANG_agc/agc_pt/voicemail_check.php b/LANG_agc/agc_pt/voicemail_check.php deleted file mode 100644 index b12b1a83..00000000 --- a/LANG_agc/agc_pt/voicemail_check.php +++ /dev/null @@ -1,136 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.4'; -$build = '60421-1147'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificação De Voicemail"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "caixa do voicemail $vmail_box é inválido\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/DBI-scripts/AST_VDhopper.pl b/Net-MySQL_scripts/AST_VDhopper.pl similarity index 60% rename from DBI-scripts/AST_VDhopper.pl rename to Net-MySQL_scripts/AST_VDhopper.pl index 414bdded..ab55395c 100644 --- a/DBI-scripts/AST_VDhopper.pl +++ b/Net-MySQL_scripts/AST_VDhopper.pl @@ -1,10 +1,9 @@ #!/usr/bin/perl # -# AST_VDhopper.pl version 0.10 -# *** DBI version *** +# AST_VDhopper.pl version 0.9 # # DESCRIPTION: -# uses DBD::MySQL to update the VICIDIAL leads hopper for the streamlined +# uses Net::MySQL to update the VICIDIAL leads hopper for the new streamlined # approach of allocating leads to client machines. # # SUMMARY: @@ -75,7 +74,7 @@ if (length($ARGV[0])>1) if ($args =~ /--help/i) { - 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"; + 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 { @@ -133,20 +132,28 @@ require("/home/cron/AST_SERVER_conf.pl"); # local configuration file if (!$DB_port) {$DB_port='3306';} -use DBI; +sleep(1); ### sleep for 5 seconds to stagger cron script load -$dbhA = DBI->connect("DBI:mysql:$DB_database:$DB_server:$DB_port", "$DB_user", "$DB_pass") - or die "Couldn't connect to database: " . DBI->errstr; +#use lib './lib', '../lib'; +use Net::MySQL; + + my $dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") + or die "Couldn't connect to database: $DB_server - $DB_database\n"; ### Grab Server values from the database $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; -$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; -$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; -@aryA = $sthA->fetchrow_array; -$DBSERVER_GMT = $aryA[0]; -if (length($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} -$sthA->finish(); +$dbhA->query("$stmtA"); +if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $DBSERVER_GMT = "$record->[0]"; + if (length($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} + } + } + $secX = time(); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($secX); @@ -154,6 +161,7 @@ $secX = time(); $LOCAL_GMT_OFF_STD = $SERVER_GMT; if ($isdst) {$LOCAL_GMT_OFF++;} + $GMT_now = ($secX - ($LOCAL_GMT_OFF * 3600)); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_now); $mon++; @@ -164,93 +172,105 @@ $GMT_now = ($secX - ($LOCAL_GMT_OFF * 3600)); if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} + if ($DB) {print "TIME DEBUG: $LOCAL_GMT_OFF_STD|$LOCAL_GMT_OFF|$isdst| GMT: $hour:$min\n";} if ($wipe_hopper_clean) { $stmtA = "DELETE from $vicidial_hopper;"; - $affected_rows = $dbhA->do($stmtA); + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print "Hopper Wiped Clean: $affected_rows\n";} $event_string = "|HOPPER WIPE CLEAN|"; &event_logger; 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; -$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; -$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; -$sthArows=$sthA->rows; -while ($sthArows > $inactive_lists_count) - { - @aryA = $sthA->fetchrow_array; - $inactive_list = $aryA[0]; - $inactive_lists .= "'$inactive_list',"; - $inactive_lists_count++; - } -$sthA->finish(); +$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);"; - $affected_rows = $dbhA->do($stmtA); + $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 $stmtA = "SELECT count(*) FROM vicidial_callbacks where callback_time <= '$now_date' and status='ACTIVE';"; -$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; -$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; -@aryA = $sthA->fetchrow_array; -$CBHOLD_count = $aryA[0]; +$dbhA->query("$stmtA"); +if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $CBHOLD_count = "$record->[0]"; + } + } + if ($DB) {print "CALLBACK HOLD: $CBHOLD_count|$stmtA|\n";} -$sthA->finish(); if ($CBHOLD_count > 0) { $update_leads=''; - $cbc=0; - $cba=0; $stmtA = "SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now FROM vicidial_callbacks,vicidial_list where callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE' and vicidial_callbacks.lead_id=vicidial_list.lead_id;"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - while ($sthArows > $cbc) + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $lead_ids[$cbc] = $aryA[0]; - $recipient = $aryA[1]; - $update_leads .= "'$lead_ids[$cbc]',"; - if ($recipient == 'ANYONE') + $iter=$dbhA->create_record_iterator; + $cbc=0; + $cba=0; + while ( $record = $iter->each) { - $CA_lead_id[$cba] = $aryA[0]; - $CA_campaign_id[$cba] = $aryA[2]; - $CA_list_id[$cba] = $aryA[3]; - $CA_gmt_offset_now[$cba] = $aryA[4]; - $cba++; + $lead_ids[$cbc] = $record->[0]; + $recipient = $record->[1]; + $update_leads .= "'$lead_ids[$cbc]',"; + if ($recipient == 'ANYONE') + { + $CA_lead_id[$cba] = $record->[0]; + $CA_campaign_id[$cba] = $record->[2]; + $CA_list_id[$cba] = $record->[3]; + $CA_gmt_offset_now[$cba] = $record->[4]; + $cba++; + } + $cbc++; } - $cbc++; } - $sthA->finish(); if ($cbc > 0) { chop($update_leads); $stmtA = "UPDATE vicidial_list set status='CALLBK', called_since_last_reset='N' where lead_id IN($update_leads);"; - $affected_rows = $dbhA->do($stmtA); + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print "Scheduled Callbacks Activated: $affected_rows\n";} $event_string = "|CALLBACKS LISTACT|$affected_rows|"; &event_logger; $stmtA = "UPDATE vicidial_callbacks set status='LIVE' where lead_id IN($update_leads);"; - $affected_rows = $dbhA->do($stmtA); + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print "Scheduled Callbacks Activated: $affected_rows\n";} $event_string = "|CALLBACKS CB ACT |$affected_rows|"; &event_logger; @@ -259,15 +279,14 @@ if ($CBHOLD_count > 0) ### INSERT ANYONE CALLBACKS INTO HOPPER DIRECTLY ### if ( ($cba > 0) && ($insert_auto_CB_to_hopper) ) { - if ($DB) {print "ANYONE Scheduled Callbacks to Insert into hopper: $cba\n";} + if ($DB) {print "ANYONE Scheduled Callbacks Inserted into hopper: $cba\n";} $event_string = "|ANYONE CB HOPPER |$cba|"; &event_logger; $CAu=0; foreach(@CA_lead_id) { $stmtA = "INSERT INTO $vicidial_hopper SET lead_id='$CA_lead_id[$CAu]',campaign_id='$CA_campaign_id[$CAu]',list_id='$CA_list_id[$CAu]',gmt_offset_now='$CA_gmt_offset_now[$CAu]';"; - $affected_rows = $dbhA->do($stmtA); - if ($DB) {print "ANYONE Scheduled Callback Inserted into hopper: $affected_rows|$CA_lead_id[$CAu]\n";} + $dbhA->query("$stmtA"); $CAu++; } } @@ -275,6 +294,7 @@ if ($CBHOLD_count > 0) ### END Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed + @campaign_id=@MT; if ($CLIcampaign) @@ -285,37 +305,48 @@ else { $stmtA = "SELECT * from vicidial_campaigns where active='Y'"; } -$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; -$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; -$sthArows=$sthA->rows; -$rec_count=0; -while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $campaign_id[$rec_count] = "$aryA[0]"; - $dial_status_a[$rec_count] = "$aryA[3]"; - $dial_status_b[$rec_count] = "$aryA[4]"; - $dial_status_c[$rec_count] = "$aryA[5]"; - $dial_status_d[$rec_count] = "$aryA[6]"; - $dial_status_e[$rec_count] = "$aryA[7]"; - $lead_order[$rec_count] = "$aryA[8]"; - if (!$CLIlevel) - {$hopper_level[$rec_count] = "$aryA[13]";} - else - {$hopper_level[$rec_count] = "$CLIlevel";} - $local_call_time[$rec_count] = "$aryA[16]"; - $lead_filter_id[$rec_count] = "$aryA[35]"; - $use_internal_dnc[$rec_count] = "$aryA[43]"; - $rec_count++; - } -$sthA->finish(); -if ($DB) {print "CAMPAIGNS TO PROCESSES HOPPER FOR: $rec_count|$#campaign_id\n";} +$dbhA->query("$stmtA"); +if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $rec_count=0; + while ( $record = $iter->each) + { + $campaign_id[$rec_count] = "$record->[0]"; + $dial_status_a[$rec_count] = "$record->[3]"; + $dial_status_b[$rec_count] = "$record->[4]"; + $dial_status_c[$rec_count] = "$record->[5]"; + $dial_status_d[$rec_count] = "$record->[6]"; + $dial_status_e[$rec_count] = "$record->[7]"; + $lead_order[$rec_count] = "$record->[8]"; + if (!$CLIlevel) + {$hopper_level[$rec_count] = "$record->[13]";} + else + {$hopper_level[$rec_count] = "$CLIlevel";} + $local_call_time[$rec_count] = "$record->[16]"; + $lead_filter_id[$rec_count] = "$record->[35]"; + $use_internal_dnc[$rec_count] = "$record->[43]"; + $rec_count++; + } + } -##### LOOP THROUGH EACH CAMPAIGN AND PROCESS THE HOPPER ##### $i=0; foreach(@campaign_id) { + ### close out MySQL connection and re-connect to start new connection ### +# $dbhA->close(); +# my $dbhA = ''; + + ### Make sure this file is in a libs path or put the absolute path to it +# require("/home/cron/AST_SERVER_conf.pl"); # local configuration file +# if (!$DB_port) {$DB_port='3306';} +# use Net::MySQL; + +# my $dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") +# or die "Couldn't connect to database: $DB_server - $DB_database\n"; + + $VCSdialable_leads=0; $VCScalls_today=0; $VCSdrops_today=0; @@ -323,56 +354,49 @@ foreach(@campaign_id) $vicidial_log = 'vicidial_log'; $stmtA = "SELECT dialable_leads from vicidial_campaign_stats where campaign_id='$campaign_id[$i]';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $VCSdialable_leads = "$aryA[0]"; - $rec_count++; - } - $sthA->finish(); - + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $rec_count=0; + while ( $record = $iter->each) + { + $VCSdialable_leads = "$record->[0]"; + } + } $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_date';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $VCScalls_today = "$aryA[0]"; - $rec_count++; - } - $sthA->finish(); + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $rec_count=0; + while ( $record = $iter->each) + { + $VCScalls_today = "$record->[0]"; + } + } if ($VCScalls_today > 0) { $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_date' and status IN('DROP','XDROP');"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $VCSdrops_today = "$aryA[0]"; - if ($VCSdrops_today > 0) + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $rec_count=0; + while ( $record = $iter->each) { - $VCSdrops_today_pct = ( ($VCSdrops_today / $VCScalls_today) * 100 ); - $VCSdrops_today_pct = sprintf("%.2f", $VCSdrops_today_pct); + $VCSdrops_today = "$record->[0]"; + if ($VCSdrops_today > 0) + { + $VCSdrops_today_pct = ( ($VCSdrops_today / $VCScalls_today) * 100 ); + $VCSdrops_today_pct = sprintf("%.2f", $VCSdrops_today_pct); + } } - $rec_count++; - } - $sthA->finish(); + } } - - $stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today',drops_today='$VCSdrops_today',drops_today_pct='$VCSdrops_today_pct' where campaign_id='$campaign_id[$i]';"; - $affected_rows = $dbhA->do($stmtA); - if ($DBX) {print "campaign stats updated: $affected_rows|$VCScalls_today|$VCSdrops_today|$VCSdrops_today_pct|$campaign_id[$i]|\n";} + $dbhA->query("$stmtA"); ##### BEGIN calculate what gmt_offset_now values are within the allowed local_call_time setting ### $g=0; @@ -398,33 +422,31 @@ foreach(@campaign_id) $stmtA = "SELECT * FROM vicidial_call_times where call_time_id='$local_call_time[$i]';"; if ($DBX) {print " |$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $Gct_default_start = "$aryA[3]"; - $Gct_default_stop = "$aryA[4]"; - $Gct_sunday_start = "$aryA[5]"; - $Gct_sunday_stop = "$aryA[6]"; - $Gct_monday_start = "$aryA[7]"; - $Gct_monday_stop = "$aryA[8]"; - $Gct_tuesday_start = "$aryA[9]"; - $Gct_tuesday_stop = "$aryA[10]"; - $Gct_wednesday_start = "$aryA[11]"; - $Gct_wednesday_stop = "$aryA[12]"; - $Gct_thursday_start = "$aryA[13]"; - $Gct_thursday_stop = "$aryA[14]"; - $Gct_friday_start = "$aryA[15]"; - $Gct_friday_stop = "$aryA[16]"; - $Gct_saturday_start = "$aryA[17]"; - $Gct_saturday_stop = "$aryA[18]"; - $Gct_state_call_times = "$aryA[19]"; - $rec_count++; + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $Gct_default_start = "$record->[3]"; + $Gct_default_stop = "$record->[4]"; + $Gct_sunday_start = "$record->[5]"; + $Gct_sunday_stop = "$record->[6]"; + $Gct_monday_start = "$record->[7]"; + $Gct_monday_stop = "$record->[8]"; + $Gct_tuesday_start = "$record->[9]"; + $Gct_tuesday_stop = "$record->[10]"; + $Gct_wednesday_start = "$record->[11]"; + $Gct_wednesday_stop = "$record->[12]"; + $Gct_thursday_start = "$record->[13]"; + $Gct_thursday_stop = "$record->[14]"; + $Gct_friday_start = "$record->[15]"; + $Gct_friday_stop = "$record->[16]"; + $Gct_saturday_start = "$record->[17]"; + $Gct_saturday_stop = "$record->[18]"; + $Gct_state_call_times = "$record->[19]"; + } } - $sthA->finish(); $ct_states = ''; $ct_state_gmt_SQL = ''; @@ -442,35 +464,33 @@ foreach(@campaign_id) { $stmtA = "SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; if ($DBX) {print " |$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $Gstate_call_time_id = "$aryA[0]"; - $Gstate_call_time_state = "$aryA[1]"; - $Gsct_default_start = "$aryA[4]"; - $Gsct_default_stop = "$aryA[5]"; - $Gsct_sunday_start = "$aryA[6]"; - $Gsct_sunday_stop = "$aryA[7]"; - $Gsct_monday_start = "$aryA[8]"; - $Gsct_monday_stop = "$aryA[9]"; - $Gsct_tuesday_start = "$aryA[10]"; - $Gsct_tuesday_stop = "$aryA[11]"; - $Gsct_wednesday_start = "$aryA[12]"; - $Gsct_wednesday_stop = "$aryA[13]"; - $Gsct_thursday_start = "$aryA[14]"; - $Gsct_thursday_stop = "$aryA[15]"; - $Gsct_friday_start = "$aryA[16]"; - $Gsct_friday_stop = "$aryA[17]"; - $Gsct_saturday_start = "$aryA[18]"; - $Gsct_saturday_stop = "$aryA[19]"; - $ct_states .="'$Gstate_call_time_state',"; - $rec_count++; + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $Gstate_call_time_id = "$record->[0]"; + $Gstate_call_time_state = "$record->[1]"; + $Gsct_default_start = "$record->[4]"; + $Gsct_default_stop = "$record->[5]"; + $Gsct_sunday_start = "$record->[6]"; + $Gsct_sunday_stop = "$record->[7]"; + $Gsct_monday_start = "$record->[8]"; + $Gsct_monday_stop = "$record->[9]"; + $Gsct_tuesday_start = "$record->[10]"; + $Gsct_tuesday_stop = "$record->[11]"; + $Gsct_wednesday_start = "$record->[12]"; + $Gsct_wednesday_stop = "$record->[13]"; + $Gsct_thursday_start = "$record->[14]"; + $Gsct_thursday_stop = "$record->[15]"; + $Gsct_friday_start = "$record->[16]"; + $Gsct_friday_stop = "$record->[17]"; + $Gsct_saturday_start = "$record->[18]"; + $Gsct_saturday_stop = "$record->[19]"; + $ct_states .="'$Gstate_call_time_state',"; + } } - $sthA->finish(); $r=0; $state_gmt=''; @@ -753,23 +773,23 @@ foreach(@campaign_id) ##### BEGIN lead recycling parsing and prep ### $stmtA = "SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id[$i]' and active='Y';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - @recycle_status=@MT; - @recycle_delay=@MT; - @recycle_maximum=@MT; - @RSQLdate=@MT; + $dbhA->query("$stmtA"); $rec_ct=0; - while ($sthArows > $rec_ct) + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $recycle_status[$rec_ct] = "$aryA[2]"; - $recycle_delay[$rec_ct] = "$aryA[3]"; - $recycle_maximum[$rec_ct] = "$aryA[4]"; - $rec_ct++; + @recycle_status=@MT; + @recycle_delay=@MT; + @recycle_maximum=@MT; + @RSQLdate=@MT; + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $recycle_status[$rec_ct] = $record->[2]; + $recycle_delay[$rec_ct] = $record->[3]; + $recycle_maximum[$rec_ct] = $record->[4]; + $rec_ct++; + } } - $sthA->finish(); if ($rec_ct > 0) { @@ -814,34 +834,36 @@ foreach(@campaign_id) ### Delete the DONE leads if there are any $stmtA = "DELETE from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('DONE');"; - $affected_rows = $dbhA->do($stmtA); + $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 ($del_gmtSQL);"; - $affected_rows = $dbhA->do($stmtA); + $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; $stmtA = "SELECT count(*) from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status='READY';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $hopper_ready_count = $aryA[0]; - if ($DB) {print " hopper READY count: $hopper_ready_count\n";} - if ($DBX) {print " |$stmtA|\n";} - $rec_count++; + $iter=$dbhA->create_record_iterator; + $rec_countA=0; + while ( $record = $iter->each) + { + $hopper_ready_count = $record->[0]; + if ($DB) {print " hopper READY count: $hopper_ready_count\n";} + if ($DBX) {print " |$stmtA|\n";} + $rec_countA++; + } } - $sthA->finish(); - $event_string = "|$campaign_id[$i]|$hopper_level[$i]|$hopper_ready_count|$local_call_time[$i]||"; - &event_logger; + $event_string = "|$campaign_id[$i]|$hopper_level[$i]|$hopper_ready_count|$local_call_time[$i]||"; + &event_logger; ##### IF hopper level is below set minimum, then try to add more leads ##### if ($hopper_ready_count < $hopper_level[$i]) @@ -850,21 +872,19 @@ foreach(@campaign_id) ### Get list of the lists in the campaign ### $stmtA = "SELECT list_id FROM vicidial_lists where campaign_id='$campaign_id[$i]' and active='Y';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_countLISTS=0; - $camp_lists = ''; - while ($sthArows > $rec_countLISTS) + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $camp_lists .= "'$aryA[0]',"; - $rec_countLISTS++; + $iter=$dbhA->create_record_iterator; + $rec_countLISTS=0; + $camp_lists = ''; + while ( $record = $iter->each) + { + $camp_lists .= "'$record->[0]',"; + $rec_countLISTS++; + } + chop($camp_lists); } - $sthA->finish(); - if (length($camp_lists)<3) {$camp_lists="''";} - else {chop($camp_lists);} - if ($DB) {print " campaign lists count: $rec_countLISTS | $camp_lists\n";} if ($DBX) {print " |$stmtA|\n";} @@ -872,17 +892,15 @@ foreach(@campaign_id) { ### Get SQL of lead filter for the campaign ### $stmtA = "SELECT lead_filter_sql FROM vicidial_lead_filters where lead_filter_id='$lead_filter_id[$i]';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $lead_filter_sql[$i] = "$aryA[0]"; - $rec_count++; + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $lead_filter_sql[$i] = "$record->[0]"; + } } - $sthA->finish(); $lead_filter_sql[$i] =~ s/^and|and$|^or|or$|^ and|and $|^ or|or $//gi; $lead_filter_sql[$i] = "and $lead_filter_sql[$i]"; if ($DB) {print " campaign lists count: $rec_countLISTS | $camp_lists\n";} @@ -898,36 +916,33 @@ foreach(@campaign_id) $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 ($all_gmtSQL) $lead_filter_sql[$i];"; if ($DBX) {print " |$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) + $dbhA->query("$stmtA"); + $campaign_leads_to_call=0; + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $campaign_leads_to_call = "$aryA[0]"; - if ($DB) {print " leads to call count: $campaign_leads_to_call\n";} - if ($DBX) {print " |$stmtA|\n";} - $rec_count++; + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $campaign_leads_to_call = "$record->[0]"; + if ($DB) {print " leads to call count: $campaign_leads_to_call\n";} + if ($DBX) {print " |$stmtA|\n";} + } } - $sthA->finish(); - if ($lead_order[$i] =~ /DOWN COUNT 2nd NEW|DOWN COUNT 3rd NEW|DOWN COUNT 4th NEW/) { $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and ($all_gmtSQL) $lead_filter_sql[$i];"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) + $dbhA->query("$stmtA"); + $NEW_campaign_leads_to_call=0; + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $NEW_campaign_leads_to_call = "$aryA[0]"; - if ($DB) {print " NEW leads to call count: $NEW_campaign_leads_to_call\n";} - if ($DBX) {print " |$stmtA|\n";} - $rec_count++; + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $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";} + } } - $sthA->finish(); } ##### IF no NEW leads to be called, error out of this campaign ##### @@ -944,8 +959,7 @@ foreach(@campaign_id) if ($VCSdialable_leads > 0) { $stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0' where campaign_id='$campaign_id[$i]';"; - $affected_rows = $dbhA->do($stmtA); - if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";} + $dbhA->query("$stmtA"); } } else @@ -953,170 +967,162 @@ foreach(@campaign_id) if ($VCSdialable_leads != $campaign_leads_to_call) { $stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='$campaign_leads_to_call' where campaign_id='$campaign_id[$i]';"; - $affected_rows = $dbhA->do($stmtA); - if ($DBX) {print "CAMPAIGN STATS: $affected_rows|$stmtA|\n";} + $dbhA->query("$stmtA"); } if ($DB) {print " Getting Leads to add to hopper\n";} ### grab leads already in hopper so we don't duplicate $stmtA = "SELECT lead_id FROM $vicidial_hopper where campaign_id='$campaign_id[$i]';"; if ($DBX) {print " |$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; + $dbhA->query("$stmtA"); + $rec_countLISTS=0; $lead_id_lists = ''; - $rec_countLISTS=0; - while ($sthArows > $rec_countLISTS) + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - $lead_id_lists .= "'$aryA[0]',"; - $rec_countLISTS++; - } - $sthA->finish(); - $lead_id_lists .= "'0'"; - $order_stmt=''; - $NEW_count = 0; - $NEW_level = 0; - $OTHER_level = $hopper_level[$i]; - if ($lead_order[$i] eq "DOWN") {$order_stmt = 'order by lead_id asc';} - if ($lead_order[$i] eq "UP") {$order_stmt = 'order by lead_id desc';} - if ($lead_order[$i] eq "UP LAST NAME") {$order_stmt = 'order by last_name desc, lead_id asc';} - if ($lead_order[$i] eq "DOWN LAST NAME") {$order_stmt = 'order by last_name, lead_id asc';} - if ($lead_order[$i] eq "UP PHONE") {$order_stmt = 'order by phone_number desc, lead_id asc';} - if ($lead_order[$i] eq "DOWN PHONE") {$order_stmt = 'order by phone_number, lead_id asc';} - if ($lead_order[$i] eq "UP COUNT") {$order_stmt = 'order by called_count desc, lead_id asc';} - if ($lead_order[$i] eq "DOWN COUNT") {$order_stmt = 'order by called_count, lead_id asc';} - if ($lead_order[$i] eq "DOWN COUNT 2nd NEW") {$NEW_count = 2;} - if ($lead_order[$i] eq "DOWN COUNT 3rd NEW") {$NEW_count = 3;} - if ($lead_order[$i] eq "DOWN COUNT 4th NEW") {$NEW_count = 4;} - - ### BEGIN recycle grab leads ### - if ($rec_ct > 0) - { - if ($DB) {print " looking for RECYCLE leads, maximum of 100\n";} - - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where $recycle_SQL and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] limit 100;"; - if ($DBX) {print " |$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($DB) {print " RECYCLE leads to call count: $sthArows\n";} - if ($DBX) {print " |$stmtA|\n";} - $REC_rec_countLEADS=0; - @REC_leads_to_hopper=@MT; - @REC_lists_to_hopper=@MT; - @REC_phone_to_hopper=@MT; - while ($sthArows > $REC_rec_countLEADS) + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) { - @aryA = $sthA->fetchrow_array; - $REC_leads_to_hopper[$REC_rec_countLEADS] = "$aryA[0]"; - $REC_lists_to_hopper[$REC_rec_countLEADS] = "$aryA[1]"; - $REC_gmt_to_hopper[$REC_rec_countLEADS] = "$aryA[2]"; - $REC_phone_to_hopper[$REC_rec_countLEADS] = "$aryA[3]"; - $REC_state_to_hopper[$REC_rec_countLEADS] = "$aryA[4]"; - if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} - $REC_rec_countLEADS++; - } - $sthA->finish(); + $lead_id_lists .= "'$record->[0]',"; + $rec_countLISTS++; + } + $lead_id_lists .= "'0'"; } - ### END recycle grab leads ### + + $order_stmt=''; + $NEW_count = 0; + $NEW_level = 0; + $OTHER_level = $hopper_level[$i]; + if ($lead_order[$i] eq "DOWN") {$order_stmt = 'order by lead_id asc';} + if ($lead_order[$i] eq "UP") {$order_stmt = 'order by lead_id desc';} + if ($lead_order[$i] eq "UP LAST NAME") {$order_stmt = 'order by last_name desc, lead_id asc';} + if ($lead_order[$i] eq "DOWN LAST NAME") {$order_stmt = 'order by last_name, lead_id asc';} + if ($lead_order[$i] eq "UP PHONE") {$order_stmt = 'order by phone_number desc, lead_id asc';} + if ($lead_order[$i] eq "DOWN PHONE") {$order_stmt = 'order by phone_number, lead_id asc';} + if ($lead_order[$i] eq "UP COUNT") {$order_stmt = 'order by called_count desc, lead_id asc';} + if ($lead_order[$i] eq "DOWN COUNT") {$order_stmt = 'order by called_count, lead_id asc';} + if ($lead_order[$i] eq "DOWN COUNT 2nd NEW") {$NEW_count = 2;} + if ($lead_order[$i] eq "DOWN COUNT 3rd NEW") {$NEW_count = 3;} + if ($lead_order[$i] eq "DOWN COUNT 4th NEW") {$NEW_count = 4;} - - - - - - - - if ($NEW_count > 0) - { - $NEW_level = int($hopper_level[$i] / $NEW_count); - $OTHER_level = ($hopper_level[$i] - $NEW_level); - $order_stmt = 'order by called_count, lead_id asc'; - 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 ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $NEW_level;"; - if ($DBX) {print " |$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $NEW_rec_countLEADS=0; - @NEW_leads_to_hopper=@MT; - @NEW_lists_to_hopper=@MT; - @NEW_phone_to_hopper=@MT; - while ($sthArows > $NEW_rec_countLEADS) + ### BEGIN recycle grab leads ### + if ($rec_ct > 0) { - @aryA = $sthA->fetchrow_array; - $NEW_leads_to_hopper[$NEW_rec_countLEADS] = "$aryA[0]"; - $NEW_lists_to_hopper[$NEW_rec_countLEADS] = "$aryA[1]"; - $NEW_gmt_to_hopper[$NEW_rec_countLEADS] = "$aryA[2]"; - $NEW_phone_to_hopper[$NEW_rec_countLEADS] = "$aryA[3]"; - $NEW_state_to_hopper[$NEW_rec_countLEADS] = "$aryA[4]"; - if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} - $NEW_rec_countLEADS++; + if ($DB) {print " looking for RECYCLE leads, maximum of 100\n";} + + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where $recycle_SQL and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] limit 100;"; + if ($DBX) {print " |$stmtA|\n";} + $REC_rec_countLEADS=0; + @REC_leads_to_hopper=@MT; + @REC_lists_to_hopper=@MT; + @REC_phone_to_hopper=@MT; + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $REC_leads_to_hopper[$REC_rec_countLEADS] = "$record->[0]"; + $REC_lists_to_hopper[$REC_rec_countLEADS] = "$record->[1]"; + $REC_gmt_to_hopper[$REC_rec_countLEADS] = "$record->[2]"; + $REC_phone_to_hopper[$REC_rec_countLEADS] = "$record->[3]"; + $REC_state_to_hopper[$REC_rec_countLEADS] = "$record->[4]"; + if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} + $REC_rec_countLEADS++; + } + } + if ($DB) {print " RECYCLE leads to call count: $REC_rec_countLEADS\n";} + if ($DBX) {print " |$stmtA|\n";} + } + ### END recycle grab leads ### + + if ($NEW_count > 0) + { + $NEW_level = int($hopper_level[$i] / $NEW_count); + $OTHER_level = ($hopper_level[$i] - $NEW_level); + $order_stmt = 'order by called_count, lead_id asc'; + 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 ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $NEW_level;"; + if ($DBX) {print " |$stmtA|\n";} + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $NEW_rec_countLEADS=0; + @NEW_leads_to_hopper=@MT; + @NEW_lists_to_hopper=@MT; + @NEW_phone_to_hopper=@MT; + while ( $record = $iter->each) + { + $NEW_leads_to_hopper[$NEW_rec_countLEADS] = "$record->[0]"; + $NEW_lists_to_hopper[$NEW_rec_countLEADS] = "$record->[1]"; + $NEW_gmt_to_hopper[$NEW_rec_countLEADS] = "$record->[2]"; + $NEW_phone_to_hopper[$NEW_rec_countLEADS] = "$record->[3]"; + $NEW_state_to_hopper[$NEW_rec_countLEADS] = "$record->[4]"; + if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} + $NEW_rec_countLEADS++; + } + } + } - $sthA->finish(); - } 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 ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;"; if ($DBX) {print " |$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_countLEADS=0; $NEW_dec=99; $NEW_in=0; - @leads_to_hopper=@MT; - @lists_to_hopper=@MT; - @gmt_to_hopper=@MT; - @state_to_hopper=@MT; - @phone_to_hopper=@MT; - $rec_count=0; - $REC_insert_count=0; - while ($sthArows > $rec_count) + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) { - @aryA = $sthA->fetchrow_array; - if ( ($NEW_count > 0) && ($NEW_rec_countLEADS > $NEW_in) ) + $iter=$dbhA->create_record_iterator; + $rec_countLEADS=0; $NEW_dec=99; $NEW_in=0; + @leads_to_hopper=@MT; + @lists_to_hopper=@MT; + @gmt_to_hopper=@MT; + @state_to_hopper=@MT; + @phone_to_hopper=@MT; + while ( $record = $iter->each) { - if ($DB_show_offset) {print "NEW_COUNT: $NEW_count|$NEW_dec|$NEW_in|$NEW_rec_countLEADS\n";} - if ($NEW_count > $NEW_dec) + if ( ($NEW_count > 0) && ($NEW_rec_countLEADS > $NEW_in) ) { - $NEW_dec++; + if ($DB_show_offset) {print "NEW_COUNT: $NEW_count|$NEW_dec|$NEW_in|$NEW_rec_countLEADS\n";} + if ($NEW_count > $NEW_dec) + { + $NEW_dec++; + } + else + { + $leads_to_hopper[$rec_countLEADS] = "$NEW_leads_to_hopper[$NEW_in]"; + $lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]"; + $gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]"; + $state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]"; + $phone_to_hopper[$rec_countLEADS] = "$NEW_phone_to_hopper[$NEW_in]"; + if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";} + $rec_countLEADS++; + $NEW_in++; + $NEW_dec=2; + } } - else + if ($REC_rec_countLEADS > $REC_insert_count) { - $leads_to_hopper[$rec_countLEADS] = "$NEW_leads_to_hopper[$NEW_in]"; - $lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]"; - $gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]"; - $state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]"; - $phone_to_hopper[$rec_countLEADS] = "$NEW_phone_to_hopper[$NEW_in]"; - if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";} + $leads_to_hopper[$rec_countLEADS] = "$REC_leads_to_hopper[$REC_insert_count]"; + $lists_to_hopper[$rec_countLEADS] = "$REC_lists_to_hopper[$REC_insert_count]"; + $gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]"; + $state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]"; + $phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]"; $rec_countLEADS++; - $NEW_in++; - $NEW_dec=2; + $REC_insert_count++; } - } - if ($REC_rec_countLEADS > $REC_insert_count) - { - $leads_to_hopper[$rec_countLEADS] = "$REC_leads_to_hopper[$REC_insert_count]"; - $lists_to_hopper[$rec_countLEADS] = "$REC_lists_to_hopper[$REC_insert_count]"; - $gmt_to_hopper[$rec_countLEADS] = "$REC_gmt_to_hopper[$REC_insert_count]"; - $state_to_hopper[$rec_countLEADS] = "$REC_state_to_hopper[$REC_insert_count]"; - $phone_to_hopper[$rec_countLEADS] = "$REC_phone_to_hopper[$REC_insert_count]"; + $leads_to_hopper[$rec_countLEADS] = "$record->[0]"; + $lists_to_hopper[$rec_countLEADS] = "$record->[1]"; + $gmt_to_hopper[$rec_countLEADS] = "$record->[2]"; + $state_to_hopper[$rec_countLEADS] = "$record->[4]"; + $phone_to_hopper[$rec_countLEADS] = "$record->[3]"; + if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} $rec_countLEADS++; - $REC_insert_count++; - } - $leads_to_hopper[$rec_countLEADS] = "$aryA[0]"; - $lists_to_hopper[$rec_countLEADS] = "$aryA[1]"; - $gmt_to_hopper[$rec_countLEADS] = "$aryA[2]"; - $state_to_hopper[$rec_countLEADS] = "$aryA[4]"; - $phone_to_hopper[$rec_countLEADS] = "$aryA[3]"; - if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} - $rec_countLEADS++; - $rec_count++; + } } - $sthA->finish(); - if ($DB) {print " Adding to hopper: $rec_countLEADS\n";} - $event_string = "|$campaign_id[$i]|Added to hopper $rec_countLEADS|"; - &event_logger; + + if ($DB) {print " Adding to hopper: $rec_countLEADS\n";} + $event_string = "|$campaign_id[$i]|Added to hopper $rec_countLEADS|"; + &event_logger; $h=0; foreach(@leads_to_hopper) @@ -1126,31 +1132,29 @@ foreach(@campaign_id) $DNClead=0; if ($use_internal_dnc[$i] =~ /Y/) { - if ($DB) {print " Doinbg DNC Check: $phone_to_hopper[$h] - $use_internal_dnc[$i]\n";} + if ($DB) {print " Doinbg DNC Check: $phone_to_hopper[$h]\n";} $stmtA = "SELECT count(*) from vicidial_dnc where phone_number='$phone_to_hopper[$h]';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $DNClead = "$aryA[0]"; - $rec_count++; - } - $sthA->finish(); + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $rec_count=0; + while ( $record = $iter->each) + { + $DNClead = "$record->[0]"; + } + } if ($DNClead != '0') { $stmtA = "UPDATE vicidial_list SET status='DNCL' where lead_id='$leads_to_hopper[$h]';"; - $affected_rows = $dbhA->do($stmtA); - if ($DBX) {print "Flagging DNC lead: $affected_rows $phone_to_hopper[$h]\n";} + $dbhA->query("$stmtA"); + if ($DB) {print "Flagging DNC lead: $leads_to_hopper[$h] $phone_to_hopper[$h]\n";} } } if ($DNClead == '0') { $stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]');"; - $affected_rows = $dbhA->do($stmtA); - if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";} + $dbhA->query("$stmtA"); } } $h++; @@ -1165,7 +1169,7 @@ foreach(@campaign_id) } -$dbhA->disconnect(); +$dbhA->close; if($DB){print "DONE... Exiting... Goodbye... See you later... Really, I mean it :)\n";} diff --git a/VICIDIAL_web/AST_CLOSERstats.php b/VICIDIAL_web/AST_CLOSERstats.php deleted file mode 100644 index b7a7bb8c..00000000 --- a/VICIDIAL_web/AST_CLOSERstats.php +++ /dev/null @@ -1,396 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select group_id from vicidial_inbound_groups;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Closer Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Closer Stats                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls placed from this Campaign:        $TOTALcalls\n";
-echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total DROP Calls:                             $DROPcalls  $DROPpercent%\n";
-echo "Average Length for DROP Calls in seconds:     $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/VICIDIAL_web/AST_VDADstats.php b/VICIDIAL_web/AST_VDADstats.php deleted file mode 100644 index 9ac17006..00000000 --- a/VICIDIAL_web/AST_VDADstats.php +++ /dev/null @@ -1,417 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: VDAD Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Auto-dial Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls placed from this Campaign:        $TOTALcalls\n";
-echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total DROP Calls:                             $DROPcalls  $DROPpercent%\n";
-echo "Average Length for DROP Calls in seconds:     $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- AUTO-DIAL NO ANSWERS\n";
-
-$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='NA' and (length_in_sec <= 60 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$NAcalls =	sprintf("%10s", $row[0]);
-$NApercent = (($NAcalls / $TOTALcalls) * 100);
-$NApercent = round($NApercent, 0);
-
-$average_na_seconds = ($row[1] / $row[0]);
-$average_na_seconds = round($average_na_seconds, 0);
-$average_na_seconds =	sprintf("%10s", $average_na_seconds);
-
-echo "Total NA calls -Busy,Disconnect,BTvoicemail:  $NAcalls  $NApercent%\n";
-echo "Average Call Length for NA Calls in seconds:  $average_na_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and  campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/VICIDIAL_web/AST_VICIDIAL_hopperlist.php b/VICIDIAL_web/AST_VICIDIAL_hopperlist.php deleted file mode 100644 index 1824a939..00000000 --- a/VICIDIAL_web/AST_VICIDIAL_hopperlist.php +++ /dev/null @@ -1,161 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.10.15';} - -$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $campaign_id[$i] =$row[0]; - $campaign_name[$i] =$row[1]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Hopper List\n"; -echo "
\n"; -#echo "\n"; -#echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY \n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Live Current Hopper List                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-
-echo "Total leads in hopper right now:       $TOTALcalls\n";
-
-
-##############################
-#########  LEAD STATS
-
-echo "\n";
-echo "---------- LEADS IN HOPPER\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-echo "|      | LEAD_ID   | PHONE NUM  | STATE | STATUS | COUNT | GMT    |\n";
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$FMT_i =		sprintf("%-4s", $i);
-	$lead_id =		sprintf("%-9s", $row[0]);
-	$phone_number =	sprintf("%-10s", $row[1]);
-	$state =		sprintf("%-5s", $row[2]);
-	$status =		sprintf("%-6s", $row[3]);
-	$count =		sprintf("%-5s", $row[4]);
-	$gmt =			sprintf("%-6s", $row[5]);
-
-	echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt |\n";
-
-	$i++;
-	}
-
-echo "+------+-----------+------------+-------+--------+-------+--------+\n";
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/VICIDIAL_web/AST_admin_log_display.php b/VICIDIAL_web/AST_admin_log_display.php deleted file mode 100644 index b5286873..00000000 --- a/VICIDIAL_web/AST_admin_log_display.php +++ /dev/null @@ -1,118 +0,0 @@ - LICENSE: GPLv2 -### - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-echo "VICIDIAL ADMIN CHANGE LOG                             $NOW_TIME\n";
-
-#passthru("grep $Gquery_date /home/www/htdocs/vicidial/admin_changes_log.txt");
-passthru("grep $Gquery_date $WeBServeRRooT/vicidial/admin_changes_log.txt");
-
-
-?>
-
- - \ No newline at end of file diff --git a/VICIDIAL_web/AST_agent_performance.php b/VICIDIAL_web/AST_agent_performance.php deleted file mode 100644 index a489bc7d..00000000 --- a/VICIDIAL_web/AST_agent_performance.php +++ /dev/null @@ -1,232 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Agent Performance\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:33:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:33:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:33:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:33:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/VICIDIAL_web/AST_agent_performance_detail.php b/VICIDIAL_web/AST_agent_performance_detail.php
deleted file mode 100644
index 2dd3dc5e..00000000
--- a/VICIDIAL_web/AST_agent_performance_detail.php
+++ /dev/null
@@ -1,406 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($group)) {$group = '';}
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-$stmt="select campaign_id from vicidial_campaigns;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$campaigns_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $campaigns_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Performance\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 03:45:00";   
-	$query_date_END = "$query_date 15:15:00";
-	$time_BEGIN = "03:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:15:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$TOTtotWAIT=($TOTtotWAIT + $row[7]);
-	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
-	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
-	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-	$USERtotPAUSE =	$row[5];
-	$USERavgPAUSE =	$row[6];
-	$USERtotWAIT =	$row[7];
-	$USERavgWAIT =	$row[8];
-	$USERtotDISPO =	$row[9];
-	$USERavgDISPO =	$row[10];
-
-	$USERtime_M = ($USERtime / 60);
-	$USERtime_M = round($USERtime_M, 2);
-	$USERtime_M_int = intval("$USERtime_M");
-	$USERtime_S = ($USERtime_M - $USERtime_M_int);
-	$USERtime_S = ($USERtime_S * 60);
-	$USERtime_S = round($USERtime_S, 0);
-	if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
-	$USERtime_MS = "$USERtime_M_int:$USERtime_S";
-	$pfUSERtime_MS[$i] =		sprintf("%7s", $USERtime_MS);
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-
-	$USERtotPAUSE_M = ($USERtotPAUSE / 60);
-	$USERtotPAUSE_M = round($USERtotPAUSE_M, 2);
-	$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M");
-	$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
-	$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
-	$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
-	if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
-	$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
-	$pfUSERtotPAUSE_MS[$i] =		sprintf("%6s", $USERtotPAUSE_MS);
-
-	$USERavgPAUSE_M = ($USERavgPAUSE / 60);
-	$USERavgPAUSE_M = round($USERavgPAUSE_M, 2);
-	$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M");
-	$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
-	$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
-	$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
-	if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
-	$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
-	$pfUSERavgPAUSE_MS[$i] =		sprintf("%6s", $USERavgPAUSE_MS);
-
-	$USERtotWAIT_M = ($USERtotWAIT / 60);
-	$USERtotWAIT_M = round($USERtotWAIT_M, 2);
-	$USERtotWAIT_M_int = intval("$USERtotWAIT_M");
-	$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
-	$USERtotWAIT_S = ($USERtotWAIT_S * 60);
-	$USERtotWAIT_S = round($USERtotWAIT_S, 0);
-	if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
-	$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
-	$pfUSERtotWAIT_MS[$i] =		sprintf("%6s", $USERtotWAIT_MS);
-
-	$USERavgWAIT_M = ($USERavgWAIT / 60);
-	$USERavgWAIT_M = round($USERavgWAIT_M, 2);
-	$USERavgWAIT_M_int = intval("$USERavgWAIT_M");
-	$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
-	$USERavgWAIT_S = ($USERavgWAIT_S * 60);
-	$USERavgWAIT_S = round($USERavgWAIT_S, 0);
-	if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
-	$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
-	$pfUSERavgWAIT_MS[$i] =		sprintf("%6s", $USERavgWAIT_MS);
-	
-	$USERtotDISPO_M = ($USERtotDISPO / 60);
-	$USERtotDISPO_M = round($USERtotDISPO_M, 2);
-	$USERtotDISPO_M_int = intval("$USERtotDISPO_M");
-	$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
-	$USERtotDISPO_S = ($USERtotDISPO_S * 60);
-	$USERtotDISPO_S = round($USERtotDISPO_S, 0);
-	if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
-	$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
-	$pfUSERtotDISPO_MS[$i] =		sprintf("%6s", $USERtotDISPO_MS);
-
-	$USERavgDISPO_M = ($USERavgDISPO / 60);
-	$USERavgDISPO_M = round($USERavgDISPO_M, 2);
-	$USERavgDISPO_M_int = intval("$USERavgDISPO_M");
-	$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
-	$USERavgDISPO_S = ($USERavgDISPO_S * 60);
-	$USERavgDISPO_S = round($USERavgDISPO_S, 0);
-	if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
-	$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
-	$pfUSERavgDISPO_MS[$i] =		sprintf("%6s", $USERavgDISPO_MS);
-
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]);	$TOT_CB = ($TOT_CB + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtime_M = ($TOTtime / 60);
-	$TOTtime_M = round($TOTtime_M, 2);
-	$TOTtime_M_int = intval("$TOTtime_M");
-	$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
-	$TOTtime_S = ($TOTtime_S * 60);
-	$TOTtime_S = round($TOTtime_S, 0);
-	if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
-	$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
-	$TOTtime_MS =		sprintf("%7s", $TOTtime_MS);
-		while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOTtotDISPO_M = ($TOTtotDISPO / 60);
-	$TOTtotDISPO_M = round($TOTtotDISPO_M, 2);
-	$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M");
-	$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
-	$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
-	$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
-	if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
-	$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
-	$TOTtotDISPO_MS =		sprintf("%7s", $TOTtotDISPO_MS);
-		while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
-
-	$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
-	$TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2);
-	$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M");
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
-	$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
-	$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
-	if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
-	$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
-	$TOTtotPAUSE_MS =		sprintf("%7s", $TOTtotPAUSE_MS);
-		while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
-
-	$TOTtotWAIT_M = ($TOTtotWAIT / 60);
-	$TOTtotWAIT_M = round($TOTtotWAIT_M, 2);
-	$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M");
-	$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
-	$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
-	$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
-	if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
-	$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
-	$TOTtotWAIT_MS =		sprintf("%7s", $TOTtotWAIT_MS);
-		while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
-
-
-	$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);
-	$TOTavgTALK_M = round($TOTavgTALK_M, 2);
-	$TOTavgTALK_M_int = intval("$TOTavgTALK_M");
-	$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
-	$TOTavgTALK_S = ($TOTavgTALK_S * 60);
-	$TOTavgTALK_S = round($TOTavgTALK_S, 0);
-	if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
-	$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
-	$TOTavgTALK_MS =		sprintf("%6s", $TOTavgTALK_MS);
-		while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
-
-	$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);
-	$TOTavgDISPO_M = round($TOTavgDISPO_M, 2);
-	$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M");
-	$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
-	$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
-	$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
-	if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
-	$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
-	$TOTavgDISPO_MS =		sprintf("%6s", $TOTavgDISPO_MS);
-		while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
-
-	$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);
-	$TOTavgPAUSE_M = round($TOTavgPAUSE_M, 2);
-	$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M");
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
-	$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
-	$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
-	if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
-	$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
-	$TOTavgPAUSE_MS =		sprintf("%6s", $TOTavgPAUSE_MS);
-		while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
-
-	$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);
-	$TOTavgWAIT_M = round($TOTavgWAIT_M, 2);
-	$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M");
-	$TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int);
-	$TOTavgWAIT_S = ($TOTavgWAIT_S * 60);
-	$TOTavgWAIT_S = round($TOTavgWAIT_S, 0);
-	if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";}
-	$TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S";
-	$TOTavgWAIT_MS =		sprintf("%6s", $TOTavgWAIT_MS);
-		while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
-
-	
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_CB = sprintf("%-5s", $TOT_CB);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/VICIDIAL_web/AST_agent_time_sheet.php b/VICIDIAL_web/AST_agent_time_sheet.php
deleted file mode 100644
index 46659eb6..00000000
--- a/VICIDIAL_web/AST_agent_time_sheet.php
+++ /dev/null
@@ -1,281 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1729 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
-	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["calls_summary"]))				{$calls_summary=$_GET["calls_summary"];}
-	elseif (isset($_POST["calls_summary"]))		{$calls_summary=$_POST["calls_summary"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from available agent log data\n";
-}
-
-else
-{
-$query_date_BEGIN = "$query_date 00:00:00";   
-$query_date_END = "$query_date 23:59:59";
-$time_BEGIN = "00:00:00";   
-$time_END = "23:59:59";
-
-$stmt="select full_name from vicidial_users where user='$agent';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$full_name = $row[0];
-
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n";
-
-if ($calls_summary)
-	{
-	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
-
-		$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "TOTAL CALLS TAKEN: $row[0]\n";
-	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
-	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
-	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
-	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
-	echo "----------------------------------------------------------------\n";
-	echo "TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/VICIDIAL_web/AST_agent_time_sheet_archive.php b/VICIDIAL_web/AST_agent_time_sheet_archive.php
deleted file mode 100644
index f14eca16..00000000
--- a/VICIDIAL_web/AST_agent_time_sheet_archive.php
+++ /dev/null
@@ -1,281 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1721 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["agent"]))				{$agent=$_GET["agent"];}
-	elseif (isset($_POST["agent"]))		{$agent=$_POST["agent"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["calls_summary"]))				{$calls_summary=$_GET["calls_summary"];}
-	elseif (isset($_POST["calls_summary"]))		{$calls_summary=$_POST["calls_summary"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Time Sheet\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n\n"; - -echo "
\n";
-
-
-if (!$agent)
-{
-echo "\n";
-echo "PLEASE SELECT AN AGENT ID AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from available agent log data\n";
-}
-
-else
-{
-$query_date_BEGIN = "$query_date 00:00:00";   
-$query_date_END = "$query_date 23:59:59";
-$time_BEGIN = "00:00:00";   
-$time_END = "23:59:59";
-
-$stmt="select full_name from vicidial_users where user='$agent';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$full_name = $row[0];
-
-echo "VICIDIAL: Agent Time Sheet                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENT TIME SHEET: $agent - $full_name -------------\n\n";
-
-if ($calls_summary)
-	{
-	$stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log_archive where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-
-	$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
-
-		$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
-		$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
-		$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
-		$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
-		$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
-		$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
-		$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
-		$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
-		$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
-		$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
-		if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
-		if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
-		$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
-		$pfTOTAL_TIME_HMS =		sprintf("%8s", $TOTAL_TIME_HMS);
-
-		$TALK_TIME_H = ($row[1] / 3600);
-		$TALK_TIME_H = round($TALK_TIME_H, 2);
-		$TALK_TIME_H_int = intval("$TALK_TIME_H");
-		$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
-		$TALK_TIME_M = ($TALK_TIME_M * 60);
-		$TALK_TIME_M = round($TALK_TIME_M, 2);
-		$TALK_TIME_M_int = intval("$TALK_TIME_M");
-		$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
-		$TALK_TIME_S = ($TALK_TIME_S * 60);
-		$TALK_TIME_S = round($TALK_TIME_S, 0);
-		if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
-		if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
-		$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
-		$pfTALK_TIME_HMS =		sprintf("%8s", $TALK_TIME_HMS);
-
-		$PAUSE_TIME_H = ($row[3] / 3600);
-		$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
-		$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
-		$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
-		$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
-		$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
-		$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
-		$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
-		$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
-		$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
-		if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
-		if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
-		$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
-		$pfPAUSE_TIME_HMS =		sprintf("%8s", $PAUSE_TIME_HMS);
-
-		$WAIT_TIME_H = ($row[5] / 3600);
-		$WAIT_TIME_H = round($WAIT_TIME_H, 2);
-		$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
-		$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
-		$WAIT_TIME_M = ($WAIT_TIME_M * 60);
-		$WAIT_TIME_M = round($WAIT_TIME_M, 2);
-		$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
-		$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
-		$WAIT_TIME_S = ($WAIT_TIME_S * 60);
-		$WAIT_TIME_S = round($WAIT_TIME_S, 0);
-		if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
-		if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
-		$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
-		$pfWAIT_TIME_HMS =		sprintf("%8s", $WAIT_TIME_HMS);
-
-		$WRAPUP_TIME_H = ($row[7] / 3600);
-		$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
-		$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
-		$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
-		$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
-		$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
-		$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
-		$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
-		if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
-		if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
-		$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
-		$pfWRAPUP_TIME_HMS =		sprintf("%8s", $WRAPUP_TIME_HMS);
-
-		$TALK_AVG_M = ($row[2] / 60);
-		$TALK_AVG_M = round($TALK_AVG_M, 2);
-		$TALK_AVG_M_int = intval("$TALK_AVG_M");
-		$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
-		$TALK_AVG_S = ($TALK_AVG_S * 60);
-		$TALK_AVG_S = round($TALK_AVG_S, 0);
-		if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
-		$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
-		$pfTALK_AVG_MS =		sprintf("%6s", $TALK_AVG_MS);
-
-		$PAUSE_AVG_M = ($row[4] / 60);
-		$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
-		$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
-		$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
-		$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
-		$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
-		if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
-		$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
-		$pfPAUSE_AVG_MS =		sprintf("%6s", $PAUSE_AVG_MS);
-
-		$WAIT_AVG_M = ($row[6] / 60);
-		$WAIT_AVG_M = round($WAIT_AVG_M, 2);
-		$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
-		$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
-		$WAIT_AVG_S = ($WAIT_AVG_S * 60);
-		$WAIT_AVG_S = round($WAIT_AVG_S, 0);
-		if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
-		$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
-		$pfWAIT_AVG_MS =		sprintf("%6s", $WAIT_AVG_MS);
-
-		$WRAPUP_AVG_M = ($row[8] / 60);
-		$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
-		$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
-		$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
-		$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
-		if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
-		$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
-		$pfWRAPUP_AVG_MS =		sprintf("%6s", $WRAPUP_AVG_MS);
-
-	echo "TOTAL CALLS TAKEN: $row[0]\n";
-	echo "TALK TIME:               $pfTALK_TIME_HMS     AVERAGE: $pfTALK_AVG_MS\n";
-	echo "PAUSE TIME:              $pfPAUSE_TIME_HMS     AVERAGE: $pfPAUSE_AVG_MS\n";
-	echo "WAIT TIME:               $pfWAIT_TIME_HMS     AVERAGE: $pfWAIT_AVG_MS\n";
-	echo "WRAPUP TIME:             $pfWRAPUP_TIME_HMS     AVERAGE: $pfWRAPUP_AVG_MS\n";
-	echo "----------------------------------------------------------------\n";
-	echo "TOTAL ACTIVE AGENT TIME: $pfTOTAL_TIME_HMS\n";
-
-	echo "\n";
-	}
-else
-	{
-	echo "Call Activity Summary\n\n";
-
-	}
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log_archive where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log_archive where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_H = ($login_time / 3600);
-	$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
-	$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
-	$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
-	$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
-	$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
-	$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
-	$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
-	$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
-	$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
-	if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
-	if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
-	$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
-	$pfLOGIN_TIME_HMS =		sprintf("%8s", $LOGIN_TIME_HMS);
-
-echo "-----------------------------------------\n";
-echo "TOTAL LOGGED-IN TIME:    $pfLOGIN_TIME_HMS\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/VICIDIAL_web/AST_parkstats.php b/VICIDIAL_web/AST_parkstats.php
deleted file mode 100644
index eef768ca..00000000
--- a/VICIDIAL_web/AST_parkstats.php
+++ /dev/null
@@ -1,396 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1717 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["group"]))				{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))		{$query_date=$_POST["query_date"];}
-if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
-
-$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
-$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
-
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
-
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
-	{
-    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
-    Header("HTTP/1.0 401 Unauthorized");
-    echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
-    exit;
-	}
-
-$NOW_DATE = date("Y-m-d");
-$NOW_TIME = date("Y-m-d H:i:s");
-$STARTtime = date("U");
-if (!isset($group)) {$group = '';}
-if (!isset($query_date)) {$query_date = $NOW_DATE;}
-
-$stmt="select distinct channel_group from park_log;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$groups_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $groups_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$groups[$i] =$row[0];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Park Stats\n";
-echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY | REPORTS \n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A GROUP AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Park Stats                             $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*),sum(parked_sec) from park_log where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls taken in this Group:              $TOTALcalls\n";
-echo "Average Hold Time(seconds) for all Calls:     $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(parked_sec) from park_log where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Dropped Calls:                          $DROPcalls  $DROPpercent%\n";
-echo "Average Hold Time(seconds) for Dropped Calls: $average_hold_seconds\n";
-
-
-##############################
-#########  USER STATS
-
-echo "\n";
-echo "---------- USER STATS\n";
-echo "+--------------------------+------------+--------+--------+\n";
-echo "| USER                     | CALLS      | TIME M | AVRG M |\n";
-echo "+--------------------------+------------+--------+--------+\n";
-
-$stmt="select park_log.user,full_name,count(*),sum(talked_sec),avg(talked_sec) from park_log,vicidial_users where parked_time >= '$query_date 00:00:01' and parked_time <= '$query_date 23:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and park_log.user is not null and talked_sec is not null and talked_sec > 4 and park_log.user=vicidial_users.user group by park_log.user;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$user =			sprintf("%-6s", $row[0]);
-	$full_name =	sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$USERcalls =	sprintf("%10s", $row[2]);
-	$USERtotTALK =	$row[3];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$USERtotTALK_MS =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
-
-	$i++;
-	}
-
-echo "+--------------------------+------------+--------+--------+\n";
-
-##############################
-#########  TIME STATS
-
-echo "\n";
-echo "---------- TIME STATS\n";
-
-echo "\n";
-
-$hi_hour_count=0;
-$last_full_record=0;
-$i=0;
-$h=0;
-while ($i <= 96)
-	{
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:00:00' and parked_time <= '$query_date $h:14:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:00:00' and parked_time <= '$query_date $h:14:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:15:00' and parked_time <= '$query_date $h:29:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:15:00' and parked_time <= '$query_date $h:29:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:30:00' and parked_time <= '$query_date $h:44:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:30:00' and parked_time <= '$query_date $h:44:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:45:00' and parked_time <= '$query_date $h:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$hour_count[$i] = $row[0];
-	if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-	if ($hour_count[$i] > 0) {$last_full_record = $i;}
-	$stmt="select count(*) from park_log where parked_time >= '$query_date $h:45:00' and parked_time <= '$query_date $h:59:59' and status ='HUNGUP' and channel_group='" . mysql_real_escape_string($group) . "' and (talked_sec < 5 or talked_sec is null);";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$drop_count[$i] = $row[0];
-	$i++;
-	$h++;
-	}
-
-$hour_multiplier = (100 / $hi_hour_count);
-#$hour_multiplier = round($hour_multiplier, 0);
-
-echo "\n";
-echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP\n";
-
-$k=1;
-$Mk=0;
-$call_scale = '0';
-while ($k <= 102) 
-	{
-	if ($Mk >= 5) 
-		{
-		$Mk=0;
-		$scale_num=($k / $hour_multiplier);
-		$scale_num = round($scale_num, 0);
-		$LENscale_num = (strlen($scale_num));
-		$k = ($k + $LENscale_num);
-		$call_scale .= "$scale_num";
-		}
-	else
-		{
-		$call_scale .= " ";
-		$k++;   $Mk++;
-		}
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-$ZZ = '00';
-$i=0;
-$h=4;
-$hour= -1;
-$no_lines_yet=1;
-
-while ($i <= 96)
-	{
-	$char_counter=0;
-	$time = '      ';
-	if ($h >= 4) 
-		{
-		$hour++;
-		$h=0;
-		if ($hour < 10) {$hour = "0$hour";}
-		$time = "+$hour$ZZ+";
-		}
-	if ($h == 1) {$time = "   15 ";}
-	if ($h == 2) {$time = "   30 ";}
-	if ($h == 3) {$time = "   45 ";}
-	$Ghour_count = $hour_count[$i];
-	if ($Ghour_count < 1) 
-		{
-		if ( ($no_lines_yet) or ($i > $last_full_record) )
-			{
-			$do_nothing=1;
-			}
-		else
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			echo "|$time|";
-			$k=0;   while ($k <= 102) {echo " ";   $k++;}
-			echo "| $hour_count[$i] |\n";
-			}
-		}
-	else
-		{
-		$no_lines_yet=0;
-		$Xhour_count = ($Ghour_count * $hour_multiplier);
-		$Yhour_count = (99 - $Xhour_count);
-
-		$Gdrop_count = $drop_count[$i];
-		if ($Gdrop_count < 1) 
-			{
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "*X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 101) {echo " ";   $char_counter++;}
-			echo "| 0     | $hour_count[$i] |\n";
-
-			}
-		else
-			{
-			$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-		#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-			$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-			$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-			$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-			echo "|$time|";
-			$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-			echo "D";   $char_counter++;
-			$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-			echo "X";   $char_counter++;
-			$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-				while ($char_counter <= 102) {echo " ";   $char_counter++;}
-			echo "| $drop_count[$i] | $hour_count[$i] |\n";
-			}
-		}
-	
-	
-	$i++;
-	$h++;
-	}
-
-
-echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/VICIDIAL_web/AST_server_performance.php b/VICIDIAL_web/AST_server_performance.php deleted file mode 100644 index fdedb9d9..00000000 --- a/VICIDIAL_web/AST_server_performance.php +++ /dev/null @@ -1,310 +0,0 @@ - LICENSE: GPLv2 -# -# CHANGES -# -# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -# path from root to where ploticus files will be stored -$DOCroot = "$WeBServeRRooT/vicidial/ploticus/"; - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($group)) {$group = '';} - -$stmt="select server_ip from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Server Performance\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "             REPORTS \n"; -echo "
\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:32:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:15:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:32:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:15:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- TOTALS, PEAKS and AVERAGES\n";
-
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGload =	sprintf("%10s", $row[0]);
-$AVGchannels =	sprintf("%10s", $row[1]);
-
-$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGcpuUSER =	sprintf("%10s", $row[0]);
-$AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
-$AVGcpuIDLE =	sprintf("%10s", $row[2]);
-
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-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','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
-
-
-echo "Total Calls in/out on this server:        $TOTALcalls\n";
-echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
-echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
-echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
-echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
-
-echo "\n";
-echo "---------- LINE GRAPH:\n";
-
-
-
-##############################
-#########  Graph stats
-
-$DAT = '.dat';
-$HTM = '.htm';
-$PNG = '.png';
-$filedate = date("Y-m-d_His");
-$DATfile = "$group$query_date$shift$filedate$DAT";
-$HTMfile = "$group$query_date$shift$filedate$HTM";
-$PNGfile = "$group$query_date$shift$filedate$PNG";
-
-$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
-$DATfp = fopen ("$DOCroot/$DATfile", "a");
-
-$stmt="select DATE_FORMAT(start_time,'%H:%i:%s') as timex,sysload,processes,channels_total,live_recordings,cpu_user_percent,cpu_system_percent from server_performance where server_ip='" . mysql_real_escape_string($group) . "' and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' order by timex;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$row[5] = intval(($row[5] + $row[6]) * $HIGHmulti);
-	$row[6] = intval($row[6] * $HIGHmulti);
-	fwrite ($DATfp, "$row[5]\t$row[6]\t$row[0]\t$row[1]\t$row[2]\t$row[3]\n");
-	$i++;
-	}
-fclose($DATfp);
-
-$rows_to_max = ($rows_to_print + 100);
-
-
-
-$HTMcontent  = '';
-$HTMcontent .= "#proc page\n";
-$HTMcontent .= "#if @DEVICE in png,gif\n";
-$HTMcontent .= "   scale: 0.6\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#endif\n";
-$HTMcontent .= "#proc getdata\n";
-$HTMcontent .= "file: $DOCroot/$DATfile\n";
-$HTMcontent .= "fieldnames: userproc sysproc time load processes channels\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc areadef\n";
-$HTMcontent .= "title: Server $group   $query_date_BEGIN to $query_date_END\n";
-$HTMcontent .= "titledetails: size=14  align=C\n";
-$HTMcontent .= "rectangle: 1 1 14 7\n";
-$HTMcontent .= "xscaletype: time hh:mm:ss\n";
-$HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
-$HTMcontent .= "stubformat: hh:mm:ssa\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc yaxis\n";
-$HTMcontent .= "stubs: inc 50\n";
-$HTMcontent .= "grid: color=yellow\n";
-$HTMcontent .= "gridskip: min\n";
-$HTMcontent .= "ticincrement: 100 1000\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: userproc\n";
-$HTMcontent .= "linedetails: color=purple width=.5\n";
-$HTMcontent .= "fill: lavender\n";
-$HTMcontent .= "legendlabel: user proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: sysproc\n";
-$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
-$HTMcontent .= "fill: dullyellow\n";
-$HTMcontent .= "legendlabel: system proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: load\n";
-$HTMcontent .= "linedetails: color=blue width=.5\n";
-$HTMcontent .= "legendlabel: load\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: processes\n";
-$HTMcontent .= "linedetails: color=red width=.5\n";
-$HTMcontent .= "legendlabel: processes\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: channels\n";
-$HTMcontent .= "linedetails: color=green width=.5\n";
-$HTMcontent .= "legendlabel: channels\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc legend\n";
-$HTMcontent .= "location: max-2 max\n";
-$HTMcontent .= "seglen: 0.2\n";
-$HTMcontent .= "\n";
-
-fwrite ($HTMfp, "$HTMcontent");
-fclose($HTMfp);
-
-
-passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
-
-sleep(1);
-
-echo "
\n"; -echo "\n"; -echo "\n"; - - -echo ""; - -} - - - -?> - - \ No newline at end of file diff --git a/VICIDIAL_web/AST_timeonVDAD.php b/VICIDIAL_web/AST_timeonVDAD.php deleted file mode 100644 index 52efd9cc..00000000 --- a/VICIDIAL_web/AST_timeonVDAD.php +++ /dev/null @@ -1,255 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 60620-1040 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Agents Time On Calls                         $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL    | STATUS | START TIME          | MINUTES |\n";
-echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	$agentcount=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED",$row[4]))
-			{
-			$row[3]='';
-			$row[5]=' - WAITING - ';
-			$row[6]=$row[7];
-			}
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$sessionid =		sprintf("%-9s", $row[2]);
-		$channel =			sprintf("%-10s", $row[3]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[4]);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 5) {$G=''; $EG='';}
-		if ($call_time_M_int >= 10) {$G=''; $EG='';}
-		if (eregi("PAUSED",$row[4])) 
-			{
-			if ($call_time_M_int >= 1) 
-				{$i++; continue;} 
-			else
-				{$G=''; $EG='';}
-			}
-
-		$agentcount++;
-		echo "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+------------+--------+---------------------+---------+\n";
-		echo "  $agentcount agents logged in on server $server_ip\n\n";
-
-		echo "             - Paused agents\n";
-		echo "             - 5 minutes or more on call\n";
-		echo "             - Over 10 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-echo "| CHANNEL    | STATUS | CAMPAIGN | PHONE NUMBER       | START TIME          | MINUTES |\n";
-echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 10) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 10) {$cc=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-8s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$start_time =		sprintf("%-19s", $row[5]);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+--------+----------+--------------------+---------------------+---------+\n";
-		echo "  $i calls being placed on server $server_ip\n\n";
-
-		echo "             - LIVE CALL WAITING\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "******************************* NO LIVE CALLS WAITING *********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - diff --git a/VICIDIAL_web/AST_timeonVDAD_closer.php b/VICIDIAL_web/AST_timeonVDAD_closer.php deleted file mode 100644 index eb7d3c39..00000000 --- a/VICIDIAL_web/AST_timeonVDAD_closer.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer -# -# CHANGES -# -# 60620-1037 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; -# $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where grab_time < '$timeSIXhoursAGO' and (hangup_time is null or hangup_time='');"; -# $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - } - } - -?> - - - -\n"; -echo " - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD\n"; -echo "
";
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-echo "VICIDIAL: Agents Time On Calls                         $NOW_TIME    REPORTS\n\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-
-
-$stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
-			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
-			}
-		$extension[$i] =		sprintf("%-10s", $row[0]);
-		$user[$i] =				sprintf("%-6s", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
-			$cc[$i]=0;
-		while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
-			{
-			$channel[$i] = eregi_replace(".$","",$channel[$i]);   
-			$cc[$i]++;
-			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
-			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
-			$cd[$i]=0;
-		while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
-			{
-			$start_time[$i] = eregi_replace("^.","",$start_time[$i]);   
-			$cd[$i]++;
-			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
-			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
-
-		$call_time_M[$i] = ($call_time_S[$i] / 60);
-		$call_time_M[$i] = round($call_time_M[$i], 2);
-		$call_time_M_int[$i] = intval("$call_time_M[$i]");
-		$call_time_SEC[$i] = ($call_time_M[$i] - $call_time_M_int[$i]);
-		$call_time_SEC[$i] = ($call_time_SEC[$i] * 60);
-		$call_time_SEC[$i] = round($call_time_SEC[$i], 0);
-		if ($call_time_SEC[$i] < 10) {$call_time_SEC[$i] = "0$call_time_SEC[$i]";}
-		$call_time_MS[$i] = "$call_time_M_int[$i]:$call_time_SEC[$i]";
-		$call_time_MS[$i] =		sprintf("%7s", $call_time_MS[$i]);
-		$i++;
-		}
-		$ext_count = $i;
-		$i=0;
-	while ($i < $ext_count)
-		{
-
-		$stmt="select campaign_id from vicidial_auto_calls where uniqueid='$uniqueid[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$camp_to_print = mysql_num_rows($rslt);
-		if ($camp_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$campaign = sprintf("%-12s", $row[0]);
-			$camp_color = $row[0];
-			}
-		else
-			{$campaign = 'DEAD        ';   	$camp_color = 'DEAD';}
-		if (eregi("READY|PAUSED|CLOSER",$status[$i]))
-			{$campaign = '            ';   	$camp_color = '';}
-
-		$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$xfer_to_print = mysql_num_rows($rslt);
-		if ($xfer_to_print > 0)
-			{
-			$row=mysql_fetch_row($rslt);
-			$fronter = sprintf("%-6s", $row[0]);
-			}
-		else
-			{$fronter = '      ';}
-
-		$G = '';		$EG = '';
-		$G=""; $EG='';
-	#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
-	#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-
-		echo "| $G$extension[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-		echo "  $i agents logged in on server $server_ip\n\n";
-
-	#	echo "             - 5 minutes or more on call\n";
-	#	echo "             - Over 10 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-###################################################################################
-###### OUTBOUND CALLS
-###################################################################################
-#echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Time On VDAD                                              $NOW_TIME\n\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-echo "| CHANNEL             | STATUS | CAMPAIGN     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-19s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 19) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 19) {$cc=101;}
-			}
-		$start_time =		sprintf("%-8s", $row[5]);
-			$cd=0;
-		while ( (strlen($start_time) > 8) and ($cd < 100) )
-			{
-			$start_time = eregi_replace("^.","",$start_time);   
-			$cd++;
-			if (strlen($start_time) <= 8) {$cd=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-12s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-		echo "  $i calls being placed on server $server_ip\n\n";
-
-		echo "             - LIVE CALL WAITING\n";
-	#	echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	echo "******************************* NO LIVE CALLS WAITING *********************************\n";
-	echo "***************************************************************************************\n";
-	echo "***************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/VICIDIAL_web/AST_timeonVDADall.php b/VICIDIAL_web/AST_timeonVDADall.php deleted file mode 100644 index aaf07c56..00000000 --- a/VICIDIAL_web/AST_timeonVDADall.php +++ /dev/null @@ -1,391 +0,0 @@ - LICENSE: GPLv2 -# -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60511-1343 - Added leads and drop info at the top of the screen -# 60608-1539 - Fixed CLOSER tallies for active calls -# 60619-1658 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 60626-1453 - Added display of system load to bottom (Angelito Manansala) -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($group)) {$group='';} - -function get_server_load($windows = false) { -$os = strtolower(PHP_OS); -if(strpos($os, "win") === false) { -if(file_exists("/proc/loadavg")) { -$load = file_get_contents("/proc/loadavg"); -$load = explode(' ', $load); -return $load[0]; -} -elseif(function_exists("shell_exec")) { -$load = explode(' ', `uptime`); -return $load[count($load)-1]; -} -else { -return false; -} -} -elseif($windows) { -if(class_exists("COM")) { -$wmi = new COM("WinMgmts:\\\\."); -$cpus = $wmi->InstancesOf("Win32_Processor"); - -$cpuload = 0; -$i = 0; -while ($cpu = $cpus->Next()) { -$cpuload += $cpu->LoadPercentage; -$i++; -} - -$cpuload = round($cpuload / $i, 2); -return "$cpuload%"; -} -else { -return false; -} -} -} - -$load_ave = get_server_load(true); - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -$rslt=mysql_query($stmt, $link); -if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!isset($RR)) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if (!isset($reset_counter)) {$reset_counter=0;} -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VICIDIAL: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$HOPlev = $row[8]; - -echo "
"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$VDhop = $row[0]; - -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
DIAL LEVEL:  $row[0]    STATUSES:  $row[1], $row[2], $row[3], $row[4], $row[5]     ORDER:  $row[6]     FILTER:  $row[7]    
HOPPER LEVEL:  $HOPlev     LEADS IN HOPPER:  $VDhop     DIALABLE LEADS:  $DAleads       TIME:
CALLS TODAY:  $callsTODAY     CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
"; - - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; - } -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load Average: $load_ave\n\n"; - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - diff --git a/VICIDIAL_web/AST_timeonVDADall_SIPmonitor.php b/VICIDIAL_web/AST_timeonVDADall_SIPmonitor.php deleted file mode 100644 index 8d740be1..00000000 --- a/VICIDIAL_web/AST_timeonVDADall_SIPmonitor.php +++ /dev/null @@ -1,395 +0,0 @@ - LICENSE: GPLv2 -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 60626-1455 - Added display of system load to bottom (Angelito Manansala) -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($group)) {$group='';} - -function get_server_load($windows = false) { -$os = strtolower(PHP_OS); -if(strpos($os, "win") === false) { -if(file_exists("/proc/loadavg")) { -$load = file_get_contents("/proc/loadavg"); -$load = explode(' ', $load); -return $load[0]; -} -elseif(function_exists("shell_exec")) { -$load = explode(' ', `uptime`); -return $load[count($load)-1]; -} -else { -return false; -} -} -elseif($windows) { -if(class_exists("COM")) { -$wmi = new COM("WinMgmts:\\\\."); -$cpus = $wmi->InstancesOf("Win32_Processor"); - -$cpuload = 0; -$i = 0; -while ($cpu = $cpus->Next()) { -$cpuload += $cpu->LoadPercentage; -$i++; -} - -$cpuload = round($cpuload / $i, 2); -return "$cpuload%"; -} -else { -return false; -} -} -} - -$load_ave = get_server_load(true); - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$NOW_DAY = date("Y-m-d"); -$NOW_HOUR = date("H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -$rslt=mysql_query($stmt, $link); -if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!isset($RR)) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if (!isset($reset_counter)) {$reset_counter=0;} -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VICIDIAL: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$HOPlev = $row[8]; - -echo "
"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$VDhop = $row[0]; - -$stmt="select dialable_leads,calls_today,drops_today,drops_today_pct from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
DIAL LEVEL:  $row[0]    STATUSES:  $row[1], $row[2], $row[3], $row[4], $row[5]     ORDER:  $row[6]     FILTER:  $row[7]    
HOPPER LEVEL:  $HOPlev     LEADS IN HOPPER:  $VDhop     DIALABLE LEADS:  $DAleads       TIME:
CALLS TODAY:  $callsTODAY     CALLS DROPPED:  $dropsTODAY     DROPPED PERCENT:  $drpctTODAY%       $NOW_TIME
"; - - -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; - } -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+------------------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "' order by status,last_call_time;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 1) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - - $agentcount++; - #$Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - $sessionid=trim($sessionid); - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$sessionid$EG LISTEN | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " System Load Average: $load_ave\n\n"; - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n\n"; - $Aecho .= " NOTE: Click LISTEN to monitor agent call, you must have softphone installed on you machine.\n\n"; - - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- - - - diff --git a/VICIDIAL_web/AST_timeoncall.php b/VICIDIAL_web/AST_timeoncall.php deleted file mode 100644 index 074160c3..00000000 --- a/VICIDIAL_web/AST_timeoncall.php +++ /dev/null @@ -1,202 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1043 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Call\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Call                        $NOW_TIME    REPORTS\n\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-echo "| STATION    | SESSIONID | CHANNEL   | NUMBER DIALED    | START TIME          | MINUTES |\n";
-echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-
-$stmt="SELECT count(*) from live_sip_channels where server_ip='" . mysql_real_escape_string($server_ip) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="select extension from live_channels where server_ip='" . mysql_real_escape_string($server_ip) . "';";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$ext_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_zap_counter=0;
-	$sessions = '';
-	while ($i < $ext_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if (preg_match("/^8600/i",$row[0]))
-			{
-			$sessions .= "$row[0]|";
-			}
-		$i++;
-		}
-	$sessions = preg_replace("/\|$/",'',$sessions);
-
-	if ($DB) {echo "SESSIONS: -$sessions-\n";}
-
-	$stmt="select * from live_sip_channels where server_ip='" . mysql_real_escape_string($server_ip) . "' order by channel;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	$live_calls_counter=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ( (preg_match("/Zap\/|internal|ring/i",$row[3])) or (preg_match("/Local\//i",$row[0])) )
-			{
-			if ($DB) {echo "NOT STATION |$row[0]|$row[3]|\n";}
-			$session_id = '';
-			}
-		else 
-			{
-			if (preg_match("/$row[3]/i",$sessions))
-				{
-				if ($DB) {echo "LIVE STATION|$row[0]|$row[3]|\n";}
-				$session_id = $row[3];
-				$station = preg_replace("/SIP\//",'',$row[0]);
-				$station = preg_replace("/-.*/",'',$station);
-			
-				$LIVE_sessions[$live_calls_counter] =			"$session_id";
-				$LIVE_sessions_FORMAT[$live_calls_counter] =	sprintf("%-9s", $session_id);
-				$LIVE_stations[$live_calls_counter] =			"$station";
-				$LIVE_stations_FORMAT[$live_calls_counter] =	sprintf("%-10s", $station);
-
-		#		echo "| $station | $session_id | \n";
-
-				$live_calls_counter++;
-				}
-			else
-				{
-				if ($DB) {echo "NOT STATIONZ|$row[0]|$row[3]|\n";}
-				$session_id = '';
-				}
-			}
-
-		$i++;
-		}
-
-		if ($live_calls_counter > 0)
-		{
-		$i=0;
-		$LC_counter = $live_calls_counter;
-
-		while ($i < $live_calls_counter)
-			{
-			$stmt="select channel,extension,number_dialed,start_time,start_epoch from call_log where extension='$LIVE_stations[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid desc LIMIT 1;";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$parked_to_print = mysql_num_rows($rslt);
-			$row=mysql_fetch_row($rslt);
-
-			$channel =			sprintf("%-9s", $row[0]);
-			$number_dialed =	sprintf("%-16s", $row[2]);
-			$start_time =		sprintf("%-19s", $row[3]);
-			$call_time_S = ($STARTtime - $row[4]);
-
-			$call_time_M = ($call_time_S / 60);
-			$call_time_M = round($call_time_M, 2);
-			$call_time_M_int = intval("$call_time_M");
-			$call_time_SEC = ($call_time_M - $call_time_M_int);
-			$call_time_SEC = ($call_time_SEC * 60);
-			$call_time_SEC = round($call_time_SEC, 0);
-			if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-			$call_time_MS = "$call_time_M_int:$call_time_SEC";
-			$call_time_MS =		sprintf("%7s", $call_time_MS);
-			$G = '';		$EG = '';
-			if ($call_time_M_int >= 12) {$G=''; $EG='';}
-			if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-			echo "| $G$LIVE_stations_FORMAT[$i]$EG | $G$LIVE_sessions_FORMAT[$i]$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-			$i++;
-			}
-
-		echo "+------------+-----------+-----------+------------------+---------------------+---------+\n";
-		echo "  $i stations on live calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on live call\n";
-		echo "             - Over 30 minutes on live call\n";
-
-		}
-		else
-		{
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*************************************** NO LIVE STATIONS ********************************\n";
-		echo "*****************************************************************************************\n";
-		echo "*****************************************************************************************\n";
-		}
-
-	}
-	else
-	{
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*************************************** NO LIVE STATIONS ********************************\n";
-	echo "*****************************************************************************************\n";
-	echo "*****************************************************************************************\n";
-	}
-
-?>
-
- - \ No newline at end of file diff --git a/VICIDIAL_web/AST_timeonpark.php b/VICIDIAL_web/AST_timeonpark.php deleted file mode 100644 index 3cedd09f..00000000 --- a/VICIDIAL_web/AST_timeonpark.php +++ /dev/null @@ -1,219 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1042 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["reset_counter"])) {$reset_counter=$_GET["reset_counter"];} - elseif (isset($_POST["reset_counter"])) {$reset_counter=$_POST["reset_counter"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$timeONEhoursAGO = ($STARTtime - 3600); -$epochHALFhoursAGO = ($STARTtime - 1860); -$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO); -$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - $stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Park\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Park         $NOW_TIME    REPORTS\n\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 1) {$G=''; $EG='';}
-		if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+-----------------+---------------------+---------+\n";
-		echo "  $i callers waiting on server $server_ip\n\n";
-
-		echo "             - 1 minute or more on hold\n";
-		echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	echo "******************** NO LIVE CALLS WAITING *********************\n";
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	}
-
-###################################################################################
-###### TIME ON INBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Agents Time On Inbound Calls                             $NOW_TIME\n\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-echo "| STATION    | USER   | CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 12) {$G=''; $EG='';}
-		if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-		echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-		echo "  $i agents on calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on call\n";
-		echo "             - Over 30 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/VICIDIAL_web/admin.php b/VICIDIAL_web/admin.php deleted file mode 100644 index 816dd7d1..00000000 --- a/VICIDIAL_web/admin.php +++ /dev/null @@ -1,6514 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["user_level"])) {$user_level=$_GET["user_level"];} - elseif (isset($_POST["user_level"])) {$user_level=$_POST["user_level"];} -if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} - elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["campaign_name"])) {$campaign_name=$_GET["campaign_name"];} - elseif (isset($_POST["campaign_name"])) {$campaign_name=$_POST["campaign_name"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["park_ext"])) {$park_ext=$_GET["park_ext"];} - elseif (isset($_POST["park_ext"])) {$park_ext=$_POST["park_ext"];} -if (isset($_GET["park_file_name"])) {$park_file_name=$_GET["park_file_name"];} - elseif (isset($_POST["park_file_name"])) {$park_file_name=$_POST["park_file_name"];} -if (isset($_GET["web_form_address"])) {$web_form_address=$_GET["web_form_address"];} - elseif (isset($_POST["web_form_address"])) {$web_form_address=$_POST["web_form_address"];} -if (isset($_GET["allow_closers"])) {$allow_closers=$_GET["allow_closers"];} - elseif (isset($_POST["allow_closers"])) {$allow_closers=$_POST["allow_closers"];} -if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} - elseif (isset($_POST["hopper_level"])) {$hopper_level=$_POST["hopper_level"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["next_agent_call"])) {$next_agent_call=$_GET["next_agent_call"];} - elseif (isset($_POST["next_agent_call"])) {$next_agent_call=$_POST["next_agent_call"];} -if (isset($_GET["local_call_time"])) {$local_call_time=$_GET["local_call_time"];} - elseif (isset($_POST["local_call_time"])) {$local_call_time=$_POST["local_call_time"];} -if (isset($_GET["voicemail_ext"])) {$voicemail_ext=$_GET["voicemail_ext"];} - elseif (isset($_POST["voicemail_ext"])) {$voicemail_ext=$_POST["voicemail_ext"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} - elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} -if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} - elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["group_color"])) {$group_color=$_GET["group_color"];} - elseif (isset($_POST["group_color"])) {$group_color=$_POST["group_color"];} -if (isset($_GET["fronter_display"])) {$fronter_display=$_GET["fronter_display"];} - elseif (isset($_POST["fronter_display"])) {$fronter_display=$_POST["fronter_display"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} - elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} -if (isset($_GET["dial_status_a"])) {$dial_status_a=$_GET["dial_status_a"];} - elseif (isset($_POST["dial_status_a"])) {$dial_status_a=$_POST["dial_status_a"];} -if (isset($_GET["dial_status_b"])) {$dial_status_b=$_GET["dial_status_b"];} - elseif (isset($_POST["dial_status_b"])) {$dial_status_b=$_POST["dial_status_b"];} -if (isset($_GET["dial_status_c"])) {$dial_status_c=$_GET["dial_status_c"];} - elseif (isset($_POST["dial_status_c"])) {$dial_status_c=$_POST["dial_status_c"];} -if (isset($_GET["dial_status_d"])) {$dial_status_d=$_GET["dial_status_d"];} - elseif (isset($_POST["dial_status_d"])) {$dial_status_d=$_POST["dial_status_d"];} -if (isset($_GET["dial_status_e"])) {$dial_status_e=$_GET["dial_status_e"];} - elseif (isset($_POST["dial_status_e"])) {$dial_status_e=$_POST["dial_status_e"];} -if (isset($_GET["lead_order"])) {$lead_order=$_GET["lead_order"];} - elseif (isset($_POST["lead_order"])) {$lead_order=$_POST["lead_order"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["campaign_vdad_exten"])) {$campaign_vdad_exten=$_GET["campaign_vdad_exten"];} - elseif (isset($_POST["campaign_vdad_exten"])) {$campaign_vdad_exten=$_POST["campaign_vdad_exten"];} -if (isset($_GET["campaign_rec_exten"])) {$campaign_rec_exten=$_GET["campaign_rec_exten"];} - elseif (isset($_POST["campaign_rec_exten"])) {$campaign_rec_exten=$_POST["campaign_rec_exten"];} -if (isset($_GET["campaign_recording"])) {$campaign_recording=$_GET["campaign_recording"];} - elseif (isset($_POST["campaign_recording"])) {$campaign_recording=$_POST["campaign_recording"];} -if (isset($_GET["campaign_rec_filename"])) {$campaign_rec_filename=$_GET["campaign_rec_filename"];} - elseif (isset($_POST["campaign_rec_filename"])) {$campaign_rec_filename=$_POST["campaign_rec_filename"];} -if (isset($_GET["hotkey"])) {$hotkey=$_GET["hotkey"];} - elseif (isset($_POST["hotkey"])) {$hotkey=$_POST["hotkey"];} -if (isset($_GET["reset_list"])) {$reset_list=$_GET["reset_list"];} - elseif (isset($_POST["reset_list"])) {$reset_list=$_POST["reset_list"];} -if (isset($_GET["old_campaign_id"])) {$old_campaign_id=$_GET["old_campaign_id"];} - elseif (isset($_POST["old_campaign_id"])) {$old_campaign_id=$_POST["old_campaign_id"];} -if (isset($_GET["OLDuser_group"])) {$OLDuser_group=$_GET["OLDuser_group"];} - elseif (isset($_POST["OLDuser_group"])) {$OLDuser_group=$_POST["OLDuser_group"];} -if (isset($_GET["status_name"])) {$status_name=$_GET["status_name"];} - elseif (isset($_POST["status_name"])) {$status_name=$_POST["status_name"];} -if (isset($_GET["selectable"])) {$selectable=$_GET["selectable"];} - elseif (isset($_POST["selectable"])) {$selectable=$_POST["selectable"];} -if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} - elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["delete_users"])) {$delete_users=$_GET["delete_users"];} - elseif (isset($_POST["delete_users"])) {$delete_users=$_POST["delete_users"];} -if (isset($_GET["delete_user_groups"])) {$delete_user_groups=$_GET["delete_user_groups"];} - elseif (isset($_POST["delete_user_groups"])) {$delete_user_groups=$_POST["delete_user_groups"];} -if (isset($_GET["delete_lists"])) {$delete_lists=$_GET["delete_lists"];} - elseif (isset($_POST["delete_lists"])) {$delete_lists=$_POST["delete_lists"];} -if (isset($_GET["delete_campaigns"])) {$delete_campaigns=$_GET["delete_campaigns"];} - elseif (isset($_POST["delete_campaigns"])) {$delete_campaigns=$_POST["delete_campaigns"];} -if (isset($_GET["delete_ingroups"])) {$delete_ingroups=$_GET["delete_ingroups"];} - elseif (isset($_POST["delete_ingroups"])) {$delete_ingroups=$_POST["delete_ingroups"];} -if (isset($_GET["delete_remote_agents"])) {$delete_remote_agents=$_GET["delete_remote_agents"];} - elseif (isset($_POST["delete_remote_agents"])) {$delete_remote_agents=$_POST["delete_remote_agents"];} -if (isset($_GET["load_leads"])) {$load_leads=$_GET["load_leads"];} - elseif (isset($_POST["load_leads"])) {$load_leads=$_POST["load_leads"];} -if (isset($_GET["campaign_detail"])) {$campaign_detail=$_GET["campaign_detail"];} - elseif (isset($_POST["campaign_detail"])) {$campaign_detail=$_POST["campaign_detail"];} -if (isset($_GET["ast_admin_access"])) {$ast_admin_access=$_GET["ast_admin_access"];} - elseif (isset($_POST["ast_admin_access"])) {$ast_admin_access=$_POST["ast_admin_access"];} -if (isset($_GET["ast_delete_phones"])) {$ast_delete_phones=$_GET["ast_delete_phones"];} - elseif (isset($_POST["ast_delete_phones"])) {$ast_delete_phones=$_POST["ast_delete_phones"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} -if (isset($_GET["delete_scripts"])) {$delete_scripts=$_GET["delete_scripts"];} - elseif (isset($_POST["delete_scripts"])) {$delete_scripts=$_POST["delete_scripts"];} -if (isset($_GET["script_id"])) {$script_id=$_GET["script_id"];} - elseif (isset($_POST["script_id"])) {$script_id=$_POST["script_id"];} -if (isset($_GET["script_name"])) {$script_name=$_GET["script_name"];} - elseif (isset($_POST["script_name"])) {$script_name=$_POST["script_name"];} -if (isset($_GET["script_comments"])) {$script_comments=$_GET["script_comments"];} - elseif (isset($_POST["script_comments"])) {$script_comments=$_POST["script_comments"];} -if (isset($_GET["script_text"])) {$script_text=$_GET["script_text"];} - elseif (isset($_POST["script_text"])) {$script_text=$_POST["script_text"];} -if (isset($_GET["reset_hopper"])) {$reset_hopper=$_GET["reset_hopper"];} - elseif (isset($_POST["reset_hopper"])) {$reset_hopper=$_POST["reset_hopper"];} -if (isset($_GET["get_call_launch"])) {$get_call_launch=$_GET["get_call_launch"];} - elseif (isset($_POST["get_call_launch"])) {$get_call_launch=$_POST["get_call_launch"];} -if (isset($_GET["am_message_exten"])) {$am_message_exten=$_GET["am_message_exten"];} - elseif (isset($_POST["am_message_exten"])) {$am_message_exten=$_POST["am_message_exten"];} -if (isset($_GET["amd_send_to_vmx"])) {$amd_send_to_vmx=$_GET["amd_send_to_vmx"];} - elseif (isset($_POST["amd_send_to_vmx"])) {$amd_send_to_vmx=$_POST["amd_send_to_vmx"];} -if (isset($_GET["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_GET["xferconf_a_dtmf"];} - elseif (isset($_POST["xferconf_a_dtmf"])) {$xferconf_a_dtmf=$_POST["xferconf_a_dtmf"];} -if (isset($_GET["xferconf_a_number"])) {$xferconf_a_number=$_GET["xferconf_a_number"];} - elseif (isset($_POST["xferconf_a_number"])) {$xferconf_a_number=$_POST["xferconf_a_number"];} -if (isset($_GET["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_GET["xferconf_b_dtmf"];} - elseif (isset($_POST["xferconf_b_dtmf"])) {$xferconf_b_dtmf=$_POST["xferconf_b_dtmf"];} -if (isset($_GET["xferconf_b_number"])) {$xferconf_b_number=$_GET["xferconf_b_number"];} - elseif (isset($_POST["xferconf_b_number"])) {$xferconf_b_number=$_POST["xferconf_b_number"];} -if (isset($_GET["modify_leads"])) {$modify_leads=$_GET["modify_leads"];} - elseif (isset($_POST["modify_leads"])) {$modify_leads=$_POST["modify_leads"];} -if (isset($_GET["hotkeys_active"])) {$hotkeys_active=$_GET["hotkeys_active"];} - elseif (isset($_POST["hotkeys_active"])) {$hotkeys_active=$_POST["hotkeys_active"];} -if (isset($_GET["change_agent_campaign"])) {$change_agent_campaign=$_GET["change_agent_campaign"];} - elseif (isset($_POST["change_agent_campaign"])) {$change_agent_campaign=$_POST["change_agent_campaign"];} -if (isset($_GET["agent_choose_ingroups"])) {$agent_choose_ingroups=$_GET["agent_choose_ingroups"];} - elseif (isset($_POST["agent_choose_ingroups"])) {$agent_choose_ingroups=$_POST["agent_choose_ingroups"];} -if (isset($_GET["alt_number_dialing"])) {$alt_number_dialing=$_GET["alt_number_dialing"];} - elseif (isset($_POST["alt_number_dialing"])) {$alt_number_dialing=$_POST["alt_number_dialing"];} -if (isset($_GET["scheduled_callbacks"])) {$scheduled_callbacks=$_GET["scheduled_callbacks"];} - elseif (isset($_POST["scheduled_callbacks"])) {$scheduled_callbacks=$_POST["scheduled_callbacks"];} -if (isset($_GET["lead_filter_id"])) {$lead_filter_id=$_GET["lead_filter_id"];} - elseif (isset($_POST["lead_filter_id"])) {$lead_filter_id=$_POST["lead_filter_id"];} -if (isset($_GET["lead_filter_name"])) {$lead_filter_name=$_GET["lead_filter_name"];} - elseif (isset($_POST["lead_filter_name"])) {$lead_filter_name=$_POST["lead_filter_name"];} -if (isset($_GET["lead_filter_comments"])) {$lead_filter_comments=$_GET["lead_filter_comments"];} - elseif (isset($_POST["lead_filter_comments"])) {$lead_filter_comments=$_POST["lead_filter_comments"];} -if (isset($_GET["lead_filter_sql"])) {$lead_filter_sql=$_GET["lead_filter_sql"];} - elseif (isset($_POST["lead_filter_sql"])) {$lead_filter_sql=$_POST["lead_filter_sql"];} -if (isset($_GET["agentonly_callbacks"])) {$agentonly_callbacks=$_GET["agentonly_callbacks"];} - elseif (isset($_POST["agentonly_callbacks"])) {$agentonly_callbacks=$_POST["agentonly_callbacks"];} -if (isset($_GET["agentcall_manual"])) {$agentcall_manual=$_GET["agentcall_manual"];} - elseif (isset($_POST["agentcall_manual"])) {$agentcall_manual=$_POST["agentcall_manual"];} -if (isset($_GET["vicidial_recording"])) {$vicidial_recording=$_GET["vicidial_recording"];} - elseif (isset($_POST["vicidial_recording"])) {$vicidial_recording=$_POST["vicidial_recording"];} -if (isset($_GET["vicidial_transfers"])) {$vicidial_transfers=$_GET["vicidial_transfers"];} - elseif (isset($_POST["vicidial_transfers"])) {$vicidial_transfers=$_POST["vicidial_transfers"];} -if (isset($_GET["delete_filters"])) {$delete_filters=$_GET["delete_filters"];} - elseif (isset($_POST["delete_filters"])) {$delete_filters=$_POST["delete_filters"];} -if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_options=$_GET["alter_agent_interface_options"];} - elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];} -if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];} - elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];} -if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];} - elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];} -if (isset($_GET["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} - elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} -if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];} - elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];} -if (isset($_GET["drop_message"])) {$drop_message=$_GET["drop_message"];} - elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} -if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];} - elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];} -if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];} - elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];} -if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];} - elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];} -if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];} - elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];} -if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];} - elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];} -if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];} - elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];} -if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];} - elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];} -if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];} - elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];} -if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];} - elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];} -if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];} - elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];} -if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];} - elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];} -if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];} - elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];} -if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];} - elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];} -if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];} - elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];} -if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];} - elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];} -if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];} - elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];} -if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];} - elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];} -if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];} - elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];} -if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];} - elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];} -if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];} - elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];} -if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];} - elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];} -if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];} - elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];} -if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];} - elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];} -if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];} - elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];} -if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];} - elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} -if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} - elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} -if (isset($_GET["attempt_delay"])) {$attempt_delay=$_GET["attempt_delay"];} - elseif (isset($_POST["attempt_delay"])) {$attempt_delay=$_POST["attempt_delay"];} -if (isset($_GET["attempt_maximum"])) {$attempt_maximum=$_GET["attempt_maximum"];} - elseif (isset($_POST["attempt_maximum"])) {$attempt_maximum=$_POST["attempt_maximum"];} - - if (isset($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS ONLY ### -$user_level = ereg_replace("[^0-9]","",$user_level); -$wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); -$xferconf_a_number = ereg_replace("[^0-9]","",$xferconf_a_number); -$xferconf_b_number = ereg_replace("[^0-9]","",$xferconf_b_number); -$drop_call_seconds = ereg_replace("[^0-9]","",$drop_call_seconds); -$voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); -$safe_harbor_exten = ereg_replace("[^0-9]","",$safe_harbor_exten); -$am_message_exten = ereg_replace("[^0-9]","",$am_message_exten); -$campaign_rec_exten = ereg_replace("[^0-9]","",$campaign_rec_exten); -$campaign_vdad_exten = ereg_replace("[^0-9]","",$campaign_vdad_exten); -$drop_exten = ereg_replace("[^0-9]","",$drop_exten); -$dial_timeout = ereg_replace("[^0-9]","",$dial_timeout); -$park_ext = ereg_replace("[^0-9]","",$park_ext); -$hopper_level = ereg_replace("[^0-9]","",$hopper_level); -$agent_choose_ingroups = ereg_replace("[^0-9]","",$agent_choose_ingroups); -$hotkeys_active = ereg_replace("[^0-9]","",$hotkeys_active); -$agentonly_callbacks = ereg_replace("[^0-9]","",$agentonly_callbacks); -$agentcall_manual = ereg_replace("[^0-9]","",$agentcall_manual); -$vicidial_recording = ereg_replace("[^0-9]","",$vicidial_recording); -$vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); -$closer_default_blended = ereg_replace("[^0-9]","",$closer_default_blended); -$alter_agent_interface_options = ereg_replace("[^0-9]","",$alter_agent_interface_options); -$delete_users = ereg_replace("[^0-9]","",$delete_users); -$delete_user_groups = ereg_replace("[^0-9]","",$delete_user_groups); -$delete_scripts = ereg_replace("[^0-9]","",$delete_scripts); -$delete_remote_agents = ereg_replace("[^0-9]","",$delete_remote_agents); -$delete_lists = ereg_replace("[^0-9]","",$delete_lists); -$delete_ingroups = ereg_replace("[^0-9]","",$delete_ingroups); -$delete_filters = ereg_replace("[^0-9]","",$delete_filters); -$delete_campaigns = ereg_replace("[^0-9]","",$delete_campaigns); -$delete_call_times = ereg_replace("[^0-9]","",$delete_call_times); -$load_leads = ereg_replace("[^0-9]","",$delete_call_times); -$campaign_detail = ereg_replace("[^0-9]","",$campaign_detail); -$ast_delete_phones = ereg_replace("[^0-9]","",$ast_delete_phones); -$ast_admin_access = ereg_replace("[^0-9]","",$ast_admin_access); -$modify_leads = ereg_replace("[^0-9]","",$modify_leads); -$change_agent_campaign = ereg_replace("[^0-9]","",$change_agent_campaign); -$modify_call_times = ereg_replace("[^0-9]","",$modify_call_times); -$ct_wednesday_stop = ereg_replace("[^0-9]","",$ct_wednesday_stop); -$ct_wednesday_start = ereg_replace("[^0-9]","",$ct_wednesday_start); -$ct_tuesday_stop = ereg_replace("[^0-9]","",$ct_tuesday_stop); -$ct_tuesday_start = ereg_replace("[^0-9]","",$ct_tuesday_start); -$ct_thursday_stop = ereg_replace("[^0-9]","",$ct_thursday_stop); -$ct_thursday_start = ereg_replace("[^0-9]","",$ct_thursday_start); -$ct_sunday_stop = ereg_replace("[^0-9]","",$ct_sunday_stop); -$ct_sunday_start = ereg_replace("[^0-9]","",$ct_sunday_start); -$ct_saturday_stop = ereg_replace("[^0-9]","",$ct_saturday_stop); -$ct_saturday_start = ereg_replace("[^0-9]","",$ct_saturday_start); -$ct_monday_stop = ereg_replace("[^0-9]","",$ct_monday_stop); -$ct_monday_start = ereg_replace("[^0-9]","",$ct_monday_start); -$ct_friday_stop = ereg_replace("[^0-9]","",$ct_friday_stop); -$ct_friday_start = ereg_replace("[^0-9]","",$ct_friday_start); -$ct_default_stop = ereg_replace("[^0-9]","",$ct_default_stop); -$ct_default_start = ereg_replace("[^0-9]","",$ct_default_start); -$number_of_lines = ereg_replace("[^0-9]","",$number_of_lines); -$user_start = ereg_replace("[^0-9]","",$user_start); -$phone_number = ereg_replace("[^0-9]","",$phone_number); -$remote_agent_id = ereg_replace("[^0-9]","",$remote_agent_id); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$attempt_maximum = ereg_replace("[^0-9]","",$attempt_maximum); -$attempt_delay = ereg_replace("[^0-9]","",$attempt_delay); -$hotkey = ereg_replace("[^0-9]","",$hotkey); -$list_id = ereg_replace("[^0-9]","",$list_id); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); -$allow_closers = ereg_replace("[^NY]","",$allow_closers); -$reset_hopper = ereg_replace("[^NY]","",$reset_hopper); -$amd_send_to_vmx = ereg_replace("[^NY]","",$amd_send_to_vmx); -$alt_number_dialing = ereg_replace("[^NY]","",$alt_number_dialing); -$safe_harbor_message = ereg_replace("[^NY]","",$safe_harbor_message); -$selectable = ereg_replace("[^NY]","",$selectable); -$reset_list = ereg_replace("[^NY]","",$reset_list); -$fronter_display = ereg_replace("[^NY]","",$fronter_display); -$drop_message = ereg_replace("[^NY]","",$drop_message); -$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc); - -### ALPHA-NUMERIC ONLY ### -$user = ereg_replace("[^0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^0-9a-zA-Z]","",$pass); -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); -$submit = ereg_replace("[^0-9a-zA-Z]","",$submit); -$CoNfIrM = ereg_replace("[^0-9a-zA-Z]","",$CoNfIrM); -$campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid); -$get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch); -$campaign_recording = ereg_replace("[^0-9a-zA-Z]","",$campaign_recording); -$ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD); -$dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix); -$state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state); -$scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); - -### DIGITS and Dots -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$auto_dial_level = ereg_replace("[^\.0-9]","",$auto_dial_level); - -### DIGITS and spaces and hash and star and comma -$xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_a_dtmf); -$xferconf_b_dtmf = ereg_replace("[^ \,\*\#0-9]","",$xferconf_b_dtmf); - -### ALPHA-NUMERIC and underscore and dash -$dial_status_e = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_e); -$dial_status_d = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_d); -$dial_status_c = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_c); -$dial_status_b = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_b); -$dial_status_a = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status_a); -$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage); -$lead_filter_id = ereg_replace("[^-\_0-9a-zA-Z]","",$lead_filter_id); -$campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id); -$old_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_campaign_id); -$park_file_name = ereg_replace("[^-\_0-9a-zA-Z]","",$park_file_name); -$next_agent_call = ereg_replace("[^-\_0-9a-zA-Z]","",$next_agent_call); -$local_call_time = ereg_replace("[^-\_0-9a-zA-Z]","",$local_call_time); -$call_time_id = ereg_replace("[^-\_0-9a-zA-Z]","",$call_time_id); -$phone_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_pass); -$phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); -$group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$group_id); -$user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$user_group); -$OLDuser_group = ereg_replace("[^-\_0-9a-zA-Z]","",$OLDuser_group); -$state_rule = ereg_replace("[^-\_0-9a-zA-Z]","",$state_rule); - -### ALPHA-NUMERIC and spaces -$lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); -### ALPHA-NUMERIC and hash -$group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); -$campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); -$status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); -$HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); -$status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); -$script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); -$script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); -$list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); -$lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); -$lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); -$campaign_rec_filename = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_rec_filename); -$call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); -$call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - -### remove semi-colons ### -$lead_filter_sql = ereg_replace(";","",$lead_filter_sql); - -### VARIABLES TO BE mysql_real_escape_string ### -# $web_form_address -# $script_text - -##### END VARIABLE FILTERING FOR SECURITY ##### - - -# AST GUI database administration -# admin.php -# -# CHANGES -# 50315-1110 - Added Custom Campaign Statuses -# 50317-1438 - Added Fronter Display var to inbound groups -# 50322-1355 - Added custom callerID per campaign -# 50517-1356 - Added user_groups sections and user_group to vicidial_users -# 50517-1440 - Added ability to logout (must click OK with empty user/pass) -# 50602-1622 - Added lead loader pages to load new files into vicidial_list -# 50620-1351 - Added custom vdad transfer AGI extension per campaign -# 50810-1414 - modified in groups to kick out spaces and dashes -# 50908-2136 - Added Custom Campaign HotKeys -# 50914-0950 - Fixed user search by user_group -# 50926-1358 - Modified to allow for language translation -# 50926-1615 - Added WeBRooTWritablE write controls -# 51020-1008 - Added editable web address and park ext - NEW dial campaigns -# 51020-1056 - Added fields and help for campaign recording control -# 51123-1335 - Altered code to function in php globals=off -# 51208-1038 - Added user_level changes, function controls and default user phones -# 51208-1556 - Added deletion of users/lists/campaigns/in groups/remote agents -# 51213-1706 - Added add/delete/modify vicidial scripts -# 51214-1737 - Added preview of vicidial script in popup window -# 51219-1225 - Added campaign and ingroups script selector and get_call_launch field -# 51222-1055 - Added am_message_exten to campaigns to allow for AM Message button -# 51222-1125 - Fixed new vicidial_campaigns default values not being assigned bug -# 51222-1156 - Added LOG OUT ALL AGENTS ON THIS CAMPAIGN button to campaign screen -# 60204-0659 - Fixed hopper reset bug -# 60207-1413 - Added AMD send to voicemail extension and xfer-conf dtmf presets -# 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 -# 60417-1416 - Added vicidial_lead_filters sections -# - Changed the header links to color-coded sectional with sublinks below -# - Added filter name and script name to campaign and in-group modify sections -# - Added callback and alt dial options to campaigns section -# - Added callback, alt dial and other options to users section -# 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered -# 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60425-2355 - Added agent options to vicidial_users, reformatted user page -# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen -# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen -# 60505-1117 - Added initial framework for new local_call_times tables and definitions -# 60506-1033 - More revisions to the local_call_time section -# 60508-1354 - Finished call_times and state_call_times sections -# - Added modify/delete options for call_times -# 60509-1311 - Functionalize campaign dialable leads calculation -# - Change state_call_times selection from call_times to only allow one per state -# - Added dialable leads count popup to campaign screen if auto-calc is disabled -# - Added test dialable leads count popup to filter screen -# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen -# 60608-1401 - Added allowable inbound_groups checkboxes to CLOSER campaign detail screen -# 60609-1051 - Added add-to-dnc in LISTS section -# 60613-1415 - Added lead recycling options to campaign detail screen -# 60619-1523 - Added variable filtering to eliminate SQL injection attack threat -# 60622-1216 - Fixed HotKey addition form issues and variable filtering -# 60623-1159 - Fixed Scheduled Callbacks over-filtering bug and filter_sql bug -# - -# 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.12-3'; -$build = '60623-1159'; - -$STARTtime = date("U"); - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGuser_level =$row[4]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN: "; - -if (!isset($ADD)) {$ADD=0;} - -if ($ADD==1) {$hh='users'; echo "Add New User";} -if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";} -if ($ADD==111) {$hh='lists'; echo "Add New List";} -if ($ADD==121) {$hh='lists'; echo "Add New DNC";} -if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} -if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} -if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} -if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";} -if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";} -if ($ADD==111111111) {$hh='times'; echo "Add New Call Time";} -if ($ADD==1111111111) {$hh='times'; echo "Add New State Call Time";} -if ($ADD==2) {$hh='users'; echo "New User Addition";} -if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} -if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} -if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; echo "New Campaign Lead Recycle Addition";} -if ($ADD==211) {$hh='lists'; echo "New List Addition";} -if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} -if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";} -if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";} -if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";} -if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";} -if ($ADD==211111111) {$hh='times'; echo "New Call Time Addition";} -if ($ADD==2111111111) {$hh='times'; echo "New State Call Time Addition";} -if ($ADD==3) {$hh='users'; echo "Modify User";} -if ($ADD==31) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==34) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==311) {$hh='lists'; echo "Modify List";} -if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==311111111) {$hh='times'; echo "Modify Call Time";} -if ($ADD==321111111) {$hh='times'; echo "Modify Call Time State Definitions List";} -if ($ADD==3111111111) {$hh='times'; echo "Modify State Call Time";} -if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";} -if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";} -if ($ADD==4) {$hh='users'; echo "Modify User";} -if ($ADD==41) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==42) {$hh='campaigns'; echo "Modify Campaign Status";} -if ($ADD==43) {$hh='campaigns'; echo "Modify Campaign HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==45) {$hh='campaigns'; echo "Modify Campaign Lead Recycle";} -if ($ADD==411) {$hh='lists'; echo "Modify List";} -if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==411111111) {$hh='times'; echo "Modify Call Time";} -if ($ADD==4111111111) {$hh='times'; echo "Modify State Call Time";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==52) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==511111111) {$hh='times'; echo "Delete Call Time";} -if ($ADD==5111111111) {$hh='times'; echo "Delete State Call Time";} -if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==65) {$hh='campaigns'; echo "Delete Lead Recycle";} -if ($ADD==611) {$hh='lists'; echo "Delete List";} -if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==611111111) {$hh='times'; echo "Delete Call Time";} -if ($ADD==6111111111) {$hh='times'; echo "Delete State Call Time";} -if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";} -if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} -if ($ADD==0) {$hh='users'; echo "Users List";} -if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} -if ($ADD==81) {$hh='campaigns'; echo "CallBacks Within Campaign";} -if ($ADD==811) {$hh='campaigns'; echo "CallBacks Within List";} -if ($ADD==10) {$hh='campaigns'; echo "Campaigns";} -if ($ADD==100) {$hh='lists'; echo "Lists";} -if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} -if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";} -if ($ADD==100000) {$hh='usergroups'; echo "User Groups";} -if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} -if ($ADD==10000000) {$hh='filters'; echo "Filters";} -if ($ADD==100000000) {$hh='times'; echo "Call Times";} -if ($ADD==1000000000) {$hh='times'; echo "State Call Times";} -if ($ADD==55) {$hh='users'; echo "Search Form";} -if ($ADD==66) {$hh='users'; echo "Search Results";} -if ($ADD==99999) {$hh='users'; echo "HELP";} - -if ( ($ADD>9) && ($ADD < 99998) ) - { - ##### get scripts listing for dynamic pulldown - $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $scripts_to_print = mysql_num_rows($rslt); - $scripts_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($scripts_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $scripts_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $scriptname_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - ##### get filters listing for dynamic pulldown - $stmt="SELECT lead_filter_id,lead_filter_name,lead_filter_sql from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - $filters_list="<option value=\"\">NONE</option>\n"; - - $o=0; - while ($filters_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $filters_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $filtername_list["$rowx[0]"] = "$rowx[1]"; - $filtersql_list["$rowx[0]"] = "$rowx[2]"; - $o++; - } - - ##### get call_times listing for dynamic pulldown - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $times_to_print = mysql_num_rows($rslt); - - $o=0; - while ($times_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $call_times_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $call_timename_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - } - -if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD==31) or ($ADD==41) or ($ADD=="4A") or ($ADD=="4B") ) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ($ADD==31) - { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - if ($ADD==3) - { - $stmt="SELECT closer_campaigns from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) - { - if ($group_id_value == $groups[$p]) - { - $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; - } - $p++; - } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; - $o++; - } - if (strlen($groups_value)>2) {$groups_value .= " -";} - } - - - - - -$NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; -$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
VICIDIAL ADMIN: HELP


\n"; - -?> -VICIDIAL_USERS TABLE

- -
-User ID - This field is where you put the VICIDIAL users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. - -
-
-
-Password - This field is where you put the VICIDIAL users password. Must be at least 2 characters in length. - -
-
-
-Full Name - This field is where you put the VICIDIAL users full name. Must be at least 2 characters in length. - -
-
-
-User Level - This menu is where you select the VICIDIAL users user level. Must be a level of 1 to log into VICIDIAL, Must be level greater than 2 to log in as a closer, Must be user level 8 or greater to get into admin web section. - -
-
-
-User Group - This menu is where you select the VICIDIAL users group that this user will belong to. This does not have any restrictions at this time, this is just to subdivide users and allow for future features based upon it. - -
-
-
-Phone Login - Here is where you can set a default phone login value for when the user logs into vicidial.php. This value will populate the phone_login automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen. - -
-
-
-Phone Pass - Here is where you can set a default phone pass value for when the user logs into vicidial.php. This value will populate the phone_pass automatically when the user logs in with their user-pass-campaign in the vicidial.php login screen. - -
-
-
-HotKeys Active - This option if set to 1 allows the user to use the HotKeys quick-dispositioning function in vicidial.php. - -
-
-
-Agent Choose Ingroups - This option if set to 1 allows the user to choose the ingroups that they will receive calls from when they login to a CLOSER or INBOUND campaign. Otherwise the Manager will need to set this in their user detail screen of the admin page. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - -
-
-
-Scheduled Callbacks - This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated. - -
-
-
-Agent-Only Callbacks - This option allows an agent to set a callback so that they are the only Agent that can call the customer back. This also allows the agent to see their callback listings and call them back any time they want to. - -
-
-
-Agent Call Manual - This option allows an agent to manually enter a new lead into the system and call them. This also allows the calling of any phone number from their vicidial screen and puts that call into their session. Use this option with caution. - -
-
-
-Vicidial Recording - This option can prevent an agent from doing any recordings after they log in to vicidial. This option must be on for vicidial to follow the campaign recording session. - -
-
-
-Vicidial Transfers - This option can prevent an agent from opening the transfer - conference session of vicidial. If this is disabled, the agent cannot third party call or blind transfer any calls. - -
-
-
-Closer Default Blended - This option simply defaults the Blended checkbox on a CLOSER login screen. - -
-
-
-Alter Agent Interface Options - This option if set to 1 allows the administrative user to modify the Agents interface options in admin.php. - -
-
-
-Delete Users - This option if set to 1 allows the user to delete other users of equal or lesser user level from the system. - -
-
-
-Delete User Groups - This option if set to 1 allows the user to delete user groups from the system. - -
-
-
-Delete Lists - This option if set to 1 allows the user to delete vicidial lists from the system. - -
-
-
-Delete Campaigns - This option if set to 1 allows the user to delete vicidial campaigns from the system. - -
-
-
-Delete In-Groups - This option if set to 1 allows the user to delete vicidial In-Groups from the system. - -
-
-
-Delete Remote Agents - This option if set to 1 allows the user to delete vicidial remote agents from the system. - -
-
-
-Load Leads - This option if set to 1 allows the user to load vicidial leads into the vicidial_list table by way of the web based lead loader. - -
-
-
-Campaign Detail - This option if set to 1 allows the user to view and modify the campaign detail screen elements. - -
-
-
-AGC Admin Access - This option if set to 1 allows the user to login to the astGUIclient admin pages. - -
-
-
-AGC Delete Phones - This option if set to 1 allows the user to delete phone entries in the astGUIclient admin pages. - -
-
-
-Delete Scripts - This option if set to 1 allows the user to delete Campaign scripts in the script modification screen. - -
-
-
-Modify Leads - This option if set to 1 allows the user to modify leads in the admin section lead search results page. - -
-
-
-Change Agent Campaign - This option if set to 1 allows the user to alter the campaign that an agent is logged into while they are logged into it. - -
-
-
-Delete Filters - This option allows the user to be able to delete vicidial lead filters from the system. - -
-
-
-Delete Call Times - This option allows the user to be able to delete vicidial call times records and vicidial state call times records from the system. - -
-
-
-Modify Call Times - This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen. - - - - -



- -VICIDIAL_CAMPAIGNS TABLE

-
-
-Campaign ID - This is the short name of the campaign, it is not editable after initial submission, cannot contain spaces and must be between 2 and 8 characters in length. - -
-
-
-Campaign Name - This is the description of the campaign, it must be between 6 and 40 characters in length. - -
-
-
-Active - This is where you set the campaign to Active or Inactive. If Inactive, noone can log into it. - -
-
-
-Park Extension - This is where you can customize the on-hold music for VICIDIAL. Make sure the extension is in place in the extensions.conf and that it points to the filename below. - -
-
-
-Park File Name - This is where you can customize the on-hold music for VICIDIAL. Make sure the filename is 10 characters in length or less and that the file is in place in the /var/lib/asterisk/sounds directory. - -
-
-
-Web Form - This is where you can set the custom web page that will be opened when the user clicks on the WEB FORM button. - -
-
-
-Allow Closers - This is where you can set whether the users of this campaign will have the option to send the call to a closer. - -
-
-
-Dial Status - This is where you set the statuses that you are wanting to dial on within the lists that are active for the campaign below - -
-
-
-List Order - This menu is where you select how the leads that match the statuses selected above will be put in the lead hopper: -
  - DOWN: select the first leads loaded into the vicidial_list table -
  - UP: select the last leads loaded into the vicidial_list table -
  - UP PHONE: select the highest phone number and works its way down -
  - DOWN PHONE: select the lowest phone number and works its way up -
  - UP LAST NAME: starts with last names starting with Z and works its way down -
  - DOWN LAST NAME: starts with last names starting with A and works its way up -
  - UP COUNT: starts with most called leads and works its way down -
  - DOWN COUNT: starts with least called leads and works its way up -
  - DOWN COUNT 2nd NEW: starts with least called leads and works its way up inserting a NEW lead in every other lead - Must NOT have NEW selected in the dial statuses -
  - DOWN COUNT 3nd NEW: starts with least called leads and works its way up inserting a NEW lead in every third lead - Must NOT have NEW selected in the dial statuses -
  - DOWN COUNT 4th NEW: starts with least called leads and works its way up inserting a NEW lead in every forth lead - Must NOT have NEW selected in the dial statuses - -
-
-
-Hopper Level - This is how many leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute. - -
-
-
-Lead Filter - This is a method of filtering your leads using a fragment of a SQL query. Use this feature with caution, it is easy to stop dialing accidentally with the slightest alteration to the SQL statement. Default is NONE. - -
-
-
-Force Reset of Hopper - This allows you to wipe out the hopper contents upon form submission. It should be filled again when the VDhopper script runs. - -
-
-
-Auto Dial Level - This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. -
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. - -
-
-
-Local Call Time - This is where you set during which hours you would like to dial, as determined by the local time in the are in which you are calling. This is controlled by area code and is adjusted for Daylight Savings time if applicable. General Guidelines in the USA for Business to Business is 9am to 5pm and Business to Consumer calls is 9am to 9pm. - -
-
-
-Dial Timeout - If defined, calls that would normally hangup after the timeout defined in extensions.conf would instead timeout at this amount of seconds if it is less than the extensions.conf timeout. This allows for quickly changing dial timeouts from server to server and limiting the effects to a single campaign. If you are having a lot of Answering Machine or Voicemail calls you may want to try changing this value to between 21-26 and see if results improve. - -
-
-
-Dial Prefix - This field allows for more easily changing a path of dialing to go out through a different method without doing a reload in Asterisk. Default is 9 based upon a 91NXXNXXXXXX in the dialplan - extensions.conf. - -
-
-
-Campaign CallerID - This field allows for the sending of a custom callerid number on the outbound calls. This is the number that would show up on the callerid of the person you are calling. The default is UNKNOWN. If you are using T1 or E1s to dial out this option is only available if you are using PRIs - ISDN T1s or E1s - that have the custom callerid feature turned on, this will not work with Robbed-bit service(RBS) circuits. This will also work through most VOIP(SIP or IAX trunks) providers that allow dynamic outbound callerID. The custom callerID only applies to calls placed for the VICIDIAL campaign directly, any 3rd party calls or transfers will not send the custom callerID. NOTE: Sometimes putting UNKNOWN or PRIVATE in the field will yield the sending of your default callerID number by your carrier with the calls. You may want to test this and put 0000000000 in the callerid field instead if you do not want to send you CallerID. - -
-
-
-Campaign VDAD extension - This field allows for a custom VDAD transfer extension. This allows you to use different VDADtransfer...agi scripts depending upon your campaign. The default transfer AGI - exten 8365 agi-VDADtransfer.agi - just immediately sends the calls on to agents as soon as they are picked up. An additional sample political survey AGI is also now included - 8366 agi-VDADtransferSURVEY.agi - that plays a message to the called person and allows them to make a choice by pressing buttons - effectively pre-screening the lead - . Please note that except for surveys, political calls and charities this form of calling is illegal in the United States. - -
-
-
-Campaign Rec extension - This field allows for a custom recording extension to be used with VICIDIAL. This allows you to use different extensions depending upon how long you want to allow a maximum recording and what type of codec you want to record in. The default exten is 8309 which if you follow the SCRATCH_INSTALL examples will record in the WAV format for upto one hour. Another option included in the examples is 8310 which will record in GSM format for upto one hour. - -
-
-
-Campaign Recording - This menu allows you to choose what level of recording is allowed on this campaign. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. - -
-
-
-Campaign Rec Filename - This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. - -
-
-
-Campaign Script - This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign. - -
-
-
-Get Call Launch - This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. - -
-
-
-Answering Machine Message - This field is for entering in an extension to blind transfer calls to when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this exten up in the dialplan - extensions.conf - and make sure it plays an audio file then hangs up. - -
-
-
-AMD send to vm exten - This menu allows you to define whether a message is left on an answering machine when it is detected. the call will be immediately forwarded to the Answering-Machine-Message extension if AMD is active and it is determined that the call is an answering machine. - -
-
-
-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. - -
-
-
-Agent Alt Num Dialing - This option allows an agent to manually dial the alternate phone number or address3 field after the main number has been called. - -
-
-
-Scheduled Callbacks - This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated. - -
-
-
-Drop Call Seconds - The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Safe Harbor Message - If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y. - -
-
-
-Safe Harbor Exten - This is the dialplan extension that the desired Safe Harbor audio file is located at on your server. - -
-
-
-Wrapup Seconds - The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition. - -
-
-
-Wrapup Message - This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set. - -
-
-
-Wrapup Message - This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set. - -
-
-
-Use Internal DNC List - This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N. - -
-
-
-Allowed Inbound Groups - For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound/outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups. - - - -



- -VICIDIAL_LISTS TABLE

-
-
-List ID - This is the numerical name of the list, it is not editable after initial submission, must contain only numbers and must be between 2 and 8 characters in length. - -
-
-
-List Name - This is the description of the list, it must be between 2 and 20 characters in length. - -
-
-
-Campaign - This is the campaign that this list belongs to. A list can only be dialed on a single campaign at one time. - -
-
-
-Active - This defines whether the list is to be dialed on or not. - -
-
-
-Reset Lead-Called-Status for this list - This resets all leads in this list to N for "not called since last reset" and means that any lead can now be called if it is the right status as defined in the campaign screen. - -
-
-
-VICIDIAL DNC List - This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add a number to this list so that it will not be called by campaigns that use the internal DNC list. - - - -



- -VICIDIAL_INBOUND_GROUPS TABLE

-
-
-Group ID - This is the short name of the inbound group, it is not editable after initial submission, must not contain any spaces and must be between 2 and 20 characters in length. - -
-
-
-Group Name - This is the description of the group, it must be between 2 and 30 characters in length. Cannot include dashes, plusses or spaces . - -
-
-
-Group Color - This is the color that displays in the VICIDIAL client app when a call comes in on this group. It must be between 2 and 7 characters long. If this is a hex color definition you must remember to put a # at the beginning of the string or VICIDIAL will not work properly. - -
-
-
-Active - This determines whether this group show up in the selection box when a VICIDIAL agent logs in. - -
-
-
-Web Form - This is the custom address that clicking on the WEB FORM button in VICIDIAL will take you to for calls that come in on this group. - -
-
-
-Next Agent Call - This determines which agent receives the next call that is available: -
  - random: orders by the random update value in the vicidial_live_agents table -
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. -
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. -
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. - -
-
-
-Fronter Display - This field determines whether the inbound VICIDIAL agent would have the fronter name - if there is one - displayed in the Status field when the call comes to the agent. - -
-
-
-Campaign Script - This menu allows you to choose the script that will appear on the agents screen for this campaign. Select NONE to show no script for this campaign. - -
-
-
-Get Call Launch - This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. - -
-
-
-Xfer-Conf DTMF - These four fields allow for you to have two sets of Transfer Conference and DTMF presets. When the call or campaign is loaded, the vicidial.php script will show two buttons on the transfer-conference frame and auto-populate the number-to-dial and the send-dtmf fields when pressed. - -
-
-
-Drop Call Seconds - The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls. - -
-
-
-Voicemail - If defined, calls that would normally DROP would instead be directed to this voicemail box to hear and leave a message. - -
-
-
-Drop Message - If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y. - -
-
-
-Drop Exten - This is the dialplan extension that the desired Dropped call audio file is located at on your server. - - - -



- -VICIDIAL_REMOTE_AGENTS TABLE

-
-
-User ID Start - This is the starting User ID that is used when the remote agent entries are inserted into the system. If the Number of Lines is set higher than 1, this number is incremented by one until each line has an entry. Make sure you create a new VICIDIAL user account with a user level of 4 or great if you want them to be able to use the vdremote.php page for remote web access of this account. - -
-
-
-Number of Lines - This defines how many remote agent entries the system creates, and determines how many lines it thinks it can safely send to the number below. - -
-
-
-Server IP - A remote agent entry is only good for one specific server, here is where you select which server you want. - -
-
-
-External Extension - This is the number that you want the calls forwarded to. Make sure that it is a full dialplan number and that if you need a 9 at the beginning you put it in here. Test by dialing this number from a phone on the system. - -
-
-
-Status - Here is where you turn the remote agent on and off. As soon as the agent is Active the system assumes that it can send calls to it. It may take up to 30 seconds once you change the status to Inactive to stop receiving calls. - -
-
-
-Campaign - Here is where you select the campaign that these remote agents will be logged into. Inbound needs to use the CLOSER campaign and select the inbound campaigns below that you want to receive calls from. - -
-
-
-Inbound Groups - Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - - -



- -VICIDIAL_CAMPAIGN_LISTS

-
-
-The lists within this campaign are listed here, whether they are active is denoted by the Y or N and you can go to the list screen by clicking on the list ID in the first column. - - -



- -VICIDIAL_CAMPAIGN_STATUSES TABLE

-
-
-Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition. - - - -



- -VICIDIAL_CAMPAIGN_HOTKEYS TABLE

-
-
-Through the use of custom campaign hotkeys, agents that use the vicidial web-client can hangup and disposition calls just by pressing a single key on their keyboard. - - - - -



- -VICIDIAL_LEAD_RECYCLE TABLE

-
-
-Through the use of lead recycling, you can call specific statuses of leads again at a specified interval without resetting the entire list. Lead recycling is campaign-specific and does not have to be a selected dialable status in your campaign. The attempt delay field is the number of seconds until the lead can be placed back in the hopper, this number must be at least 120 seconds. The attempt maximum field is the maximum number of times that a lead of this status can be attempted before the list needs to be reset, this number can be from 1 to 10. You can activate and deactivate a lead recycle entry with the provided links. This feature only works in auto-dial mode, where dial level is greater than 0. - - - - - -



- -VICIDIAL_USER_GROUPS TABLE

-
-
-User Group - This is the short name of a Vicidial User group, try not to use any spaces or punctuation for this field. max 20 characters, minimum of 2 characters. - -
-
-
-Group Name - This is the description of the vicidial user group max of 40 characters. - - - - - -



- -VICIDIAL_SCRIPTS TABLE

-
-
-Script ID - This is the short name of a Vicidial Script. This needs to be a unique identifier. Try not to use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Script Name - This is the title of a Vicidial Script. This is a short summary of the script. max 50 characters, minimum of 2 characters. There should be no spaces or punctuation of any kind in theis field. - -
-
-Script Comments - This is where you can place comments for a Vicidial Script such as -changed to free upgrade on Sept 23-. max 255 characters, minimum of 2 characters. - -
-
-Script Text - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today? - -
-
-
-Active - This determines whether this script can be selected to be used by a campaign. - - - - - -



- -VICIDIAL_LEAD_FILTERS TABLE

-
-
-Filter ID - This is the short name of a Vicidial Lead Filter. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Filter Name - This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters. - -
-
-Filter Comments - This is where you can place comments for a Vicidial Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters. - -
-
-Filter SQL - This is where you place the SQL query fragment that you want to filter by. do not begin or end with an AND, that will be added by the hopper cron script automatically. an example SQL query that would work here is- called_count > 4 and called_count < 8 -. - - - - - -



- -VICIDIAL_CALL TIMES TABLE

-
-
-Call Time ID - This is the short name of a Vicidial Call Time Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters. - -
-
-Call Time Name - This is a more descriptive name of the Call Time Definition. This is a short summary of the Call Time definition. max 30 characters, minimum of 2 characters. - -
-
-Call Time Comments - This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters. - -
-
-Default Start and Stop Times - This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400. - -
-
-Weekday Start and Stop Times - These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times. - -
-
-State Call Time Definitions - This is the list of State specific call time definitions that are followed in this Call Time Definition. - -
-
-State Call Time State - This is the two letter code for the state that this calling time definition is for. For this to be in effect the local call time that is set in the campaign must have this state call time record in it as well as all of the leads having two letter state codes in them. - - - - -



- -VICIDIAL LIST LOADER FUNCTIONALITY

-
-
-The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. There is also a new beta version super lead loader that allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation or check for duplicates in itself or other lists, so that is something you need to do before you load the leads. Also, make sure that you have created the list that these leads are to be under so that you can use them. There is also the matter of time-zone-coding these leads. You may want to increase the frequency that the ADMIN_adjust_GMTnow_on_leads.pl is being run in the cron on your Asterisk server so that any loaded leads can be coded faster. Here is a list of the fields in their proper order for the lead files: -
    -
  1. Vendor Lead Code - shows up in the Vendor ID field of the GUI -
  2. Source Code - internal use only for admins and DBAs -
  3. List ID - the list number that these leads will show up under -
  4. Phone Code - the prefix for the phone number - 1 for US, 01144 for UK, 01161 for AUS, etc -
  5. Phone Number - must be at least 8 digits long -
  6. Title - title of the customer - Mr. Ms. Mrs, etc... -
  7. First Name -
  8. Middle Initial -
  9. Last Name -
  10. Address Line 1 -
  11. Address Line 2 -
  12. Address Line 3 -
  13. City -
  14. State - limited to 2 characters -
  15. Province -
  16. Postal Code -
  17. Country -
  18. Gender -
  19. Date of Birth -
  20. Alternate Phone Number -
  21. Email Address -
  22. Security Phrase -
  23. Comments -
- -
NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /home/cron/AST_SERVER_conf.pl file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. - -







-







-THE END -
-\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$dial_status_a = $row[3]; -$dial_status_b = $row[4]; -$dial_status_c = $row[5]; -$dial_status_d = $row[6]; -$dial_status_e = $row[7]; -$local_call_time = $row[16]; -if ($lead_filter_id=='') - { - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') - { - $lead_filter_id='NONE'; - } - } - -$stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; -$rslt=mysql_query($stmt, $link); -$lists_to_print = mysql_num_rows($rslt); -$camp_lists=''; -$o=0; -while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; -if (ereg("Y", $rowx[1])) {$camp_lists .= "'$rowx[0]',";} -} -$camp_lists = eregi_replace(".$","",$camp_lists); - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - -echo "

\n"; -echo "Show Dialable Leads Count -

\n"; -echo "CAMPAIGN: $campaign_id
\n"; -echo "LISTS: $camp_lists
\n"; -echo "STATUSES: $dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e
\n"; -echo "FILTER: $lead_filter_id
\n"; -echo "CALL TIME: $local_call_time

\n"; - -### call function to calculate and print dialable leads -dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - -echo "

\n"; -echo "\n"; - -exit; -} - - -###################### -# ADD=7111111 view sample script with test variables -###################### - -if ($ADD==7111111) -{ - ##### TEST VARIABLES ##### - $vendor_lead_code = 'VENDORLEADCODE'; - $list_id = 'LISTID'; - $gmt_offset_now = 'GMTOFFSET'; - $phone_code = '1'; - $phone_number = '7275551212'; - $title = 'Mr.'; - $first_name = 'JOHN'; - $middle_initial = 'Q'; - $last_name = 'PUBLIC'; - $address1 = '1234 Main St.'; - $address2 = 'Apt. 3'; - $address3 = 'ADDRESS3'; - $city = 'CHICAGO'; - $state = 'IL'; - $province = 'PROVINCE'; - $postal_code = '33760'; - $country_code = 'USA'; - $gender = 'M'; - $date_of_birth = '1970-01-01'; - $alt_phone = '3125551212'; - $email = 'test@test.com'; - $security_phrase = 'SECUTIRY'; - $comments = 'COMMENTS FIELD'; - $RGfullname = 'JOE AGENT'; - $RGuser = '6666'; - -echo "\n"; -echo "\n"; -echo "\n"; -echo ""; - -$stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$script_name = $row[1]; -$script_text = $row[3]; - -$script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); -$script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); -$script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); -$script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); -$script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); -$script_text = eregi_replace('--A--title--B--',"$title",$script_text); -$script_text = eregi_replace('--A--first_name--B--',"$first_name",$script_text); -$script_text = eregi_replace('--A--middle_initial--B--',"$middle_initial",$script_text); -$script_text = eregi_replace('--A--last_name--B--',"$last_name",$script_text); -$script_text = eregi_replace('--A--address1--B--',"$address1",$script_text); -$script_text = eregi_replace('--A--address2--B--',"$address2",$script_text); -$script_text = eregi_replace('--A--address3--B--',"$address3",$script_text); -$script_text = eregi_replace('--A--city--B--',"$city",$script_text); -$script_text = eregi_replace('--A--state--B--',"$state",$script_text); -$script_text = eregi_replace('--A--province--B--',"$province",$script_text); -$script_text = eregi_replace('--A--postal_code--B--',"$postal_code",$script_text); -$script_text = eregi_replace('--A--country_code--B--',"$country_code",$script_text); -$script_text = eregi_replace('--A--gender--B--',"$gender",$script_text); -$script_text = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$script_text); -$script_text = eregi_replace('--A--alt_phone--B--',"$alt_phone",$script_text); -$script_text = eregi_replace('--A--email--B--',"$email",$script_text); -$script_text = eregi_replace('--A--security_phrase--B--',"$security_phrase",$script_text); -$script_text = eregi_replace('--A--comments--B--',"$comments",$script_text); -$script_text = eregi_replace('--A--fullname--B--',"$RGfullname",$script_text); -$script_text = eregi_replace('--A--user--B--',"$RGuser",$script_text); -$script_text = eregi_replace("\n","
",$script_text); - - -echo ""; - -echo "Preview Script: $script_id
\n"; -echo "
\n"; -echo "
$script_name
\n"; -echo "$script_text\n"; -echo "
\n"; - -echo "\n"; - -exit; -} - - - - -######################### HTML HEADER BEGIN ####################################### -if ($hh=='users') {$users_hh='bgcolor ="#FFFF99"'; $users_fc='BLACK';} # yellow - else {$users_hh=''; $users_fc='WHITE';} -if ($hh=='campaigns') {$campaigns_hh='bgcolor ="#FFCC99"'; $campaigns_fc='BLACK';} # orange - else {$campaigns_hh=''; $campaigns_fc='WHITE';} -if ($hh=='lists') {$lists_hh='bgcolor ="#FFCCCC"'; $lists_fc='BLACK';} # red - else {$lists_hh=''; $lists_fc='WHITE';} -if ($hh=='ingroups') {$ingroups_hh='bgcolor ="#CC99FF"'; $ingroups_fc='BLACK';} # purple - else {$ingroups_hh=''; $ingroups_fc='WHITE';} -if ($hh=='remoteagent') {$remoteagent_hh='bgcolor ="#CCFFCC"'; $remoteagent_fc='BLACK';} # green - else {$remoteagent_hh=''; $remoteagent_fc='WHITE';} -if ($hh=='usergroups') {$usergroups_hh='bgcolor ="#CCFFFF"'; $usergroups_fc='BLACK';} # cyan - else {$usergroups_hh=''; $usergroups_fc='WHITE';} -if ($hh=='scripts') {$scripts_hh='bgcolor ="#99FFCC"'; $scripts_fc='BLACK';} # light teal - else {$scripts_hh=''; $scripts_fc='WHITE';} -if ($hh=='filters') {$filters_hh='bgcolor ="#CCCCCC"'; $filters_fc='BLACK';} # grey - else {$filters_hh=''; $filters_fc='WHITE';} -if ($hh=='times') {$times_hh='bgcolor ="#99FF33"'; $times_fc='BLACK';} # hard teal - else {$times_hh=''; $times_fc='WHITE';} - -?> - - - - -\n"; -?> -
- - - - - - - - - - - - - - - - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - 1) { - ?> - - - - - -
  VICIDIAL ADMIN - Logout  
> SIZE=1> USERS > SIZE=1> CAMPAIGNS > SIZE=1> LISTS > SIZE=1> SCRIPTS > SIZE=1> FILTERS > SIZE=1> IN-GROUPS > SIZE=1> CALL TIMES > SIZE=1> USER GROUPS > SIZE=1> REMOTE AGENTS > REPORTS
  LIST USERS     |     ADD A NEW USER     |     SEARCH FOR A USER
  ADD CAMPAIGN     |     LIST CAMPAIGNS
  SHOW LISTS     |     ADD NEW LIST     |     SEARCH FOR A LEAD |     ADD NUMBER TO DNC           |     LOAD NEW LEADS
  ADD SCRIPT     |     VIEW SCRIPTS
  ADD FILTER     |     VIEW FILTERS
  SHOW IN-GROUPS     |     ADD NEW IN-GROUP
  SHOW CALL TIMES     |     ADD NEW CALL TIME     |     SHOW STATE CALL TIMES     |     ADD NEW STATE CALL TIME  
  ADD USER GROUP     |     LIST USER GROUPS     |     GROUP HOURLY
  SHOW REMOTE AGENTS     |     ADD NEW REMOTE AGENTS
 
-
\n"; -echo ""; - -echo "
ADD A NEW USER
\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "$NWB#vicidial_users-user_group$NWE\n"; -echo "\n"; -echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group:
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW CAMPAIGN FORM SCREEN -###################### - -if ($ADD==11) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW CAMPAIGN\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $NWB#vicidial_campaigns-park_ext$NWE
Park Filename: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List ID: (digits only)$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
\n"; - -} - - -###################### -# ADD=121 display the ADD NUMBER TO DNC FORM SCREEN and add a new number -###################### - -if ($ADD==121) -{ -echo "
\n"; -echo ""; - -if (strlen($phone_number) > 2) - { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NOT ADDED - This phone number is already in the Do Not Call List: $phone_number

\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$phone_number');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC ADDED: $phone_number

\n"; - - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n"); - fclose($fp); - } - } - } - -echo "
ADD A NUMBER TO THE DNC LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
Phone Number: (digits only)$NWB#vicidial_list-dnc$NWE
\n"; - -} - - -###################### -# ADD=1111 display the ADD NEW INBOUND GROUP SCREEN -###################### - -if ($ADD==1111) -{ -echo "
\n"; -echo ""; - -echo "
ADD A NEW INBOUND GROUP\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - -} - - -###################### -# ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN -###################### - -if ($ADD==11111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW REMOTE AGENTS\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dialplan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - -###################### -# ADD=111111 display the ADD NEW USERS GROUP SCREEN -###################### - -if ($ADD==111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW USERS GROUP\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -} - - -###################### -# ADD=1111111 display the ADD NEW SCRIPT SCREEN -###################### - -if ($ADD==1111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW SCRIPT\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Script ID: (no spaces or punctuation)$NWB#vicidial_scripts-script_id$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text: $NWB#vicidial_scripts-script_text$NWE
\n"; - -} - - -###################### -# ADD=11111111 display the ADD NEW FILTER SCREEN -###################### - -if ($ADD==11111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW FILTER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Filter ID: (no spaces or punctuation)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; -} - - -###################### -# ADD=111111111 display the ADD NEW CALL TIME SCREEN -###################### - -if ($ADD==111111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW CALL TIME\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; -} - - -###################### -# ADD=1111111111 display the ADD NEW STATE CALL TIME SCREEN -###################### - -if ($ADD==1111111111) -{ -echo "
\n"; -echo ""; - -echo "
ADD NEW STATE CALL TIME\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; -echo "
State Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (no spaces or punctuation)$NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 2 series, validates form data and inserts the new record into the database -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=2 adds the new user to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USER NOT ADDED - there is already a user in the system with this user number\n";} - else - { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 8) ) - { - echo "
USER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
user id must be between 2 and 8 characters long\n"; - echo "
full name and password must be at least 2 characters long\n"; - } - else - { - echo "
USER ADDED: $user\n"; - - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass) values('$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A USER |$PHP_AUTH_USER|$ip|'$user','$pass','$full_name','$user_level','$user_group','$phone_login','$phone_pass'|\n"); - fclose($fp); - } - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new campaign to the system -###################### - -if ($ADD==21) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN NOT ADDED - there is already a campaign in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($campaign_id) > 8) or (strlen($campaign_name) < 6) or (strlen($campaign_name) > 40) ) - { - echo "
CAMPAIGN NOT ADDED - Please go back and look at the data you entered\n"; - echo "
campaign ID must be between 2 and 8 characters in length\n"; - echo "
campaign name must be between 6 and 40 characters in length\n"; - } - else - { - echo "
CAMPAIGN ADDED: $campaign_id\n"; - - $stmt="INSERT INTO vicidial_campaigns (campaign_id,campaign_name,active,dial_status_a,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,campaign_script,get_call_launch) values('$campaign_id','$campaign_name','$active','NEW','DOWN','$park_ext','$park_file_name','" . mysql_real_escape_string($web_form_address) . "','$allow_closers','$hopper_level','$auto_dial_level','$next_agent_call','$local_call_time','$voicemail_ext','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - echo ""; - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - - } - } -$ADD=31; -} - -###################### -# ADD=22 adds the new campaign status to the system -###################### - -if ($ADD==22) -{ - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a campaign-status in the system with this name\n";} - else - { - $stmt="SELECT count(*) from vicidial_statuses where status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN STATUS NOT ADDED - there is already a global-status in the system with this name\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($status_name) < 2) ) - { - echo "
CAMPAIGN STATUS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 8 characters in length\n"; - echo "
status name must be between 2 and 30 characters in length\n"; - } - else - { - echo "
CAMPAIGN STATUS ADDED: $campaign_id - $status\n"; - - $stmt="INSERT INTO vicidial_campaign_statuses values('$status','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN STATUS |$PHP_AUTH_USER|$ip|'$status','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } - } -$ADD=31; -} - - -###################### -# ADD=23 adds the new campaign hotkey to the system -###################### - -if ($ADD==23) -{ - $HKstatus_data = explode('-----',$HKstatus); - $status = $HKstatus_data[0]; - $status_name = $HKstatus_data[1]; - - echo ""; - $stmt="SELECT count(*) from vicidial_campaign_hotkeys where campaign_id='$campaign_id' and hotkey='$hotkey' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN HOTKEY NOT ADDED - there is already a campaign-hotkey in the system with this hotkey\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
CAMPAIGN HOTKEY NOT ADDED - Please go back and look at the data you entered\n"; - echo "
hotkey must be a single character between 1 and 9 \n"; - echo "
status must be between 1 and 8 characters in length\n"; - } - else - { - echo "
CAMPAIGN HOTKEY ADDED: $campaign_id - $status - $hotkey\n"; - - $stmt="INSERT INTO vicidial_campaign_hotkeys values('$status','$hotkey','$status_name','$selectable','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CAMPAIGN HOTKEY |$PHP_AUTH_USER|$ip|'$status','$hotkey','$status_name','$selectable','$campaign_id'|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=25 adds the new campaign lead recycle entry to the system -###################### - -if ($ADD==25) -{ - $status = eregi_replace("-----.*",'',$status); - echo ""; - $stmt="SELECT count(*) from vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - there is already a lead-recycle for this campaign with this status\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT ADDED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD RECYCLE ADDED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="INSERT INTO vicidial_lead_recycle(campaign_id,status,attempt_delay,attempt_maximum,active) values('$campaign_id','$status','$attempt_delay','$attempt_maximum','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new list to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
LIST NOT ADDED - there is already a list in the system with this ID\n";} - else - { - if ( (strlen($campaign_id) < 2) or (strlen($list_name) < 2) or (strlen($list_id) < 2) or (strlen($list_id) > 8) ) - { - echo "
LIST NOT ADDED - Please go back and look at the data you entered\n"; - echo "
List ID must be between 2 and 8 characters in length\n"; - echo "
List name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST ADDED: $list_id\n"; - - $stmt="INSERT INTO vicidial_lists values('$list_id','$list_name','$campaign_id','$active');"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW LIST |$PHP_AUTH_USER|$ip|'$list_id','$list_name','$campaign_id','$active'|\n"); - fclose($fp); - } - } - } -$ADD=311; -} - - - -###################### -# ADD=2111 adds the new inbound group to the system -###################### - -if ($ADD==2111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
GROUP NOT ADDED - there is already a group in the system with this ID\n";} - else - { - if ( (strlen($group_id) < 2) or (strlen($group_name) < 2) or (strlen($group_color) < 2) or (strlen($group_id) > 20) or (eregi(' ',$group_id)) or (eregi("\-",$group_id)) or (eregi("\+",$group_id)) ) - { - echo "
GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group ID must be between 2 and 20 characters in length and contain no ' -+'.\n"; - echo "
Group name and group color must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch');"; - $rslt=mysql_query($stmt, $link); - - echo "
GROUP ADDED: $group_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW GROUP |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000; -} - - -###################### -# ADD=21111 adds new remote agents to the system -###################### - -if ($ADD==21111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_remote_agents where server_ip='$server_ip' and user_start='$user_start';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
REMOTE AGENTS NOT ADDED - there is already a remote agents entry starting with this userID\n";} - else - { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT ADDED - Please go back and look at the data you entered\n"; - echo "
User ID start and external extension must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTE AGENTS ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|'$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value'|\n"); - fclose($fp); - } - } - } -$ADD=10000; -} - -###################### -# ADD=211111 adds new user group to the system -###################### - -if ($ADD==211111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
USER GROUP NOT ADDED - there is already a user group entry with this name\n";} - else - { - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_user_groups values('$user_group','$group_name');"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP ADDED: $user_start\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW USER GROUP ENTRY |$PHP_AUTH_USER|$ip|'$user_group','$group_name'|\n"); - fclose($fp); - } - } - } -$ADD=100000; -} - -###################### -# ADD=2111111 adds new script to the system -###################### - -if ($ADD==2111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SCRIPT NOT ADDED - there is already a script entry with this name\n";} - else - { - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
SCRIPT NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Script name, description and text must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');"; - $rslt=mysql_query($stmt, $link); - - echo "
SCRIPT ADDED: $script_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=1000000; -} - - -###################### -# ADD=21111111 adds new filter to the system -###################### - -if ($ADD==21111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
FILTER NOT ADDED - there is already a filter entry with this ID\n";} - else - { - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Filter ID, name and SQL must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='$lead_filter_sql';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER ADDED: $lead_filter_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=10000000; -} - - -###################### -# ADD=211111111 adds new call time definition to the system -###################### - -if ($ADD==211111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; - echo "
Call Time ID and name must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments';"; - $rslt=mysql_query($stmt, $link); - - echo "
CALL TIME ADDED: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - } -$ADD=311111111; -} - - -###################### -# ADD=2111111111 adds new state call time definition to the system -###################### - -if ($ADD==2111111111) -{ - echo ""; - $stmt="SELECT count(*) from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
STATE CALL TIME DEFINITION NOT ADDED - there is already a call time entry with this ID\n";} - else - { - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
STATE CALL TIME DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; - echo "
State Call Time ID, name and state must be at least 2 characters in length\n"; - } - else - { - $stmt="INSERT INTO vicidial_state_call_times SET state_call_time_id='$call_time_id',state_call_time_name='$call_time_name',state_call_time_comments='$call_time_comments',state_call_time_state='$state_call_time_state';"; - $rslt=mysql_query($stmt, $link); - - echo "
STATE CALL TIME ADDED: $call_time_id\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - } -$ADD=3111111111; -} - - - - -###################################################################################################### -###################################################################################################### -####### 4 series, record modifications submitted and DB is modified, then on to 3 series forms below -###################################################################################################### -###################################################################################################### - - - -###################### -# ADD=4A submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4A") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - -###################### -# ADD=4B submit user modifications to the system - ADMIN -###################### - -if ($ADD=="4B") -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED - ADMIN: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - - - -###################### -# ADD=4 submit user modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - if ( (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_level) < 1) ) - { - echo "
USER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Password and Full Name each need ot be at least 2 characters in length\n"; - } - else - { - echo "
USER MODIFIED: $user\n"; - - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER INFO |$PHP_AUTH_USER|$ip|pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass' where user='$user'|\n"); - fclose($fp); - } - } - -$ADD=3; # go to user modification below -} - -###################### -# ADD=41 submit campaign modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level', next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=42 delete campaign status in the system -###################### - -if ($ADD==42) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN STATUS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - } - else - { - echo "
CUSTOM CAMPAIGN STATUS DELETED: $campaign_id - $status\n"; - - $stmt="DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=43 delete campaign hotkey in the system -###################### - -if ($ADD==43) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or (strlen($hotkey) < 1) ) - { - echo "
CAMPAIGN HOTKEY NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign id needs to be at least 2 characters in length\n"; - echo "
the campaign status needs to be at least 1 characters in length\n"; - echo "
the campaign hotkey needs to be at least 1 characters in length\n"; - } - else - { - echo "
CUSTOM CAMPAIGN HOTKEY DELETED: $campaign_id - $status - $hotkey\n"; - - $stmt="DELETE FROM vicidial_campaign_hotkeys where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE CAMPAIGN STATUS|$PHP_AUTH_USER|$ip|DELETE FROM vicidial_campaign_statuses where campaign_id='$campaign_id' and status='$status' and hotkey='$hotkey'|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=44 submit campaign modifications to the system - Basic View -###################### - -if ($ADD==44) -{ - echo ""; - - if ( (strlen($campaign_name) < 6) or (strlen($active) < 1) ) - { - echo "
CAMPAIGN NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
the campaign name needs to be at least 6 characters in length\n"; - } - else - { - echo "
CAMPAIGN MODIFIED: $campaign_id\n"; - - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',hopper_level='$hopper_level', auto_dial_level='$auto_dial_level',lead_filter_id='$lead_filter_id' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmtA, $link); - - if ($reset_hopper == 'Y') - { - echo "
RESETTING CAMPAIGN LEAD HOPPER\n"; - echo "
- Wait 1 minute before dialing next number\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id' and status='READY';"; - $rslt=mysql_query($stmt, $link); - - ### LOG HOPPER RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|CAMPAIGN HOPPERRESET|$PHP_AUTH_USER|$ip|campaign_name='$campaign_name'|\n"); - fclose($fp); - } - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CAMPAIGN INFO|$PHP_AUTH_USER|$ip|$stmtA|$reset_hopper|\n"); - fclose($fp); - } - } - -$ADD=34; # go to campaign modification form below -} - -###################### -# ADD=45 modify campaign lead recycle in the system -###################### - -if ($ADD==45) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) or ($attempt_delay < 120) or ($attempt_maximum < 1) or ($attempt_maximum > 10) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD MODIFIED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="UPDATE vicidial_lead_recycle SET attempt_delay='$attempt_delay',attempt_maximum='$attempt_maximum',active='$active' where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=411 submit list modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - if ( (strlen($list_name) < 2) or (strlen($campaign_id) < 2) ) - { - echo "
LIST NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
list name must be at least 2 characters in length\n"; - } - else - { - echo "
LIST MODIFIED: $list_id\n"; - - $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - if ($reset_list == 'Y') - { - echo "
RESETTING LIST-CALLED-STATUS\n"; - $stmt="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - ### LOG RESET TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|RESET LIST CALLED |$PHP_AUTH_USER|$ip|list_name='$list_name'|\n"); - fclose($fp); - } - } - if ($campaign_id != "$old_campaign_id") - { - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($old_campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id' and campaign_id='$old_campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY LIST INFO |$PHP_AUTH_USER|$ip|list_name='$list_name',campaign_id='$campaign_id',active='$active' where list_id='$list_id'|\n"); - fclose($fp); - } - } - -$ADD=311; # go to list modification form below -} - - -###################### -# ADD=4111 modify in-group info in the system -###################### - -if ($ADD==4111) -{ - echo ""; - - if ( (strlen($group_name) < 2) or (strlen($group_color) < 2) ) - { - echo "
GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
group name and group color must be at least 2 characters in length\n"; - } - else - { - echo "
GROUP MODIFIED: $group_id\n"; - - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_message='$drop_message',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten' where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY GROUP INFO |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111; # go to in-group modification form below -} - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) - { - echo "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
User ID Start and External Extension must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOTE AGENTS MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - } - -$ADD=31111; # go to remote agents modification form below -} - - - -###################### -# ADD=411111 modify user group info in the system -###################### - -if ($ADD==411111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or (strlen($group_name) < 2) ) - { - echo "
USER GROUP NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Group name and description must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group';"; - $rslt=mysql_query($stmt, $link); - - echo "
USER GROUP MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group'|\n"); - fclose($fp); - } - } - -$ADD=311111; # go to user group modification form below -} - -###################### -# ADD=4111111 modify script in the system -###################### - -if ($ADD==4111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or (strlen($script_name) < 2) or (strlen($script_text) < 2) ) - { - echo "
SCRIPT NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Script name, description and text must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_scripts set script_name='$script_name', script_comments='$script_comments', script_text='" . mysql_real_escape_string($script_text) . "', active='$active' where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
SCRIPT MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY SCRIPT ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111; # go to script modification form below -} - - -###################### -# ADD=41111111 modify filter in the system -###################### - -if ($ADD==41111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or (strlen($lead_filter_name) < 2) or (strlen($lead_filter_sql) < 2) ) - { - echo "
FILTER NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Filter ID, name and SQL must be at least 2 characters in length\n"; - } - else - { - $stmt="UPDATE vicidial_lead_filters set lead_filter_name='$lead_filter_name', lead_filter_comments='$lead_filter_comments', lead_filter_sql='$lead_filter_sql' where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
FILTER MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY FILTER ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31111111; # go to filter modification form below -} - - -###################### -# ADD=411111111 modify call time in the system -###################### - -if ($ADD==411111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) ) - { - echo "
CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
Call Time ID and name must be at least 2 characters in length\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
CALL TIME MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY CALL TIME ENTRY |$stmt|\n"); - fclose($fp); - } - } - -$ADD=311111111; # go to call time modification form below -} - - -###################### -# ADD=4111111111 modify state call time in the system -###################### - -if ($ADD==4111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or (strlen($call_time_name) < 2) or (strlen($state_call_time_state) < 2) ) - { - echo "
STATE CALL TIME NOT MODIFIED - Please go back and look at the data you entered\n"; - echo "
State Call Time ID, name and state must be at least 2 characters in length\n"; - } - else - { - $ct_default_start = preg_replace('/\D/', '', $ct_default_start); - $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); - $ct_sunday_start = preg_replace('/\D/', '', $ct_sunday_start); - $ct_sunday_stop = preg_replace('/\D/', '', $ct_sunday_stop); - $ct_monday_start = preg_replace('/\D/', '', $ct_monday_start); - $ct_monday_stop = preg_replace('/\D/', '', $ct_monday_stop); - $ct_tuesday_start = preg_replace('/\D/', '', $ct_tuesday_start); - $ct_tuesday_stop = preg_replace('/\D/', '', $ct_tuesday_stop); - $ct_wednesday_start = preg_replace('/\D/', '', $ct_wednesday_start); - $ct_wednesday_stop = preg_replace('/\D/', '', $ct_wednesday_stop); - $ct_thursday_start = preg_replace('/\D/', '', $ct_thursday_start); - $ct_thursday_stop = preg_replace('/\D/', '', $ct_thursday_stop); - $ct_friday_start = preg_replace('/\D/', '', $ct_friday_start); - $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); - $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); - $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_state_call_times set state_call_time_name='$call_time_name', state_call_time_comments='$call_time_comments', sct_default_start='$ct_default_start', sct_default_stop='$ct_default_stop', sct_sunday_start='$ct_sunday_start', sct_sunday_stop='$ct_sunday_stop', sct_monday_start='$ct_monday_start', sct_monday_stop='$ct_monday_stop', sct_tuesday_start='$ct_tuesday_start', sct_tuesday_stop='$ct_tuesday_stop', sct_wednesday_start='$ct_wednesday_start', sct_wednesday_stop='$ct_wednesday_stop', sct_thursday_start='$ct_thursday_start', sct_thursday_stop='$ct_thursday_stop', sct_friday_start='$ct_friday_start', sct_friday_stop='$ct_friday_stop', sct_saturday_start='$ct_saturday_start', sct_saturday_stop='$ct_saturday_stop', state_call_time_state='$state_call_time_state' where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
STATE CALL TIME MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY STATE CALL TIME ENTRY|$stmt|\n"); - fclose($fp); - } - } - -$ADD=3111111111; # go to state call time modification form below -} - - - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of user -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($user) < 2) or ($LOGdelete_users < 1) ) - { - echo "
USER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - echo "
USER DELETION CONFIRMATION: $user\n"; - echo "

Click here to delete user $user


\n"; - } - -$ADD='3'; # go to user modification below -} - -###################### -# ADD=51 confirmation before deletion of campaign -###################### - -if ($ADD==51) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or ($LOGdelete_campaigns < 1) ) - { - echo "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
CAMPAIGN DELETION CONFIRMATION: $campaign_id\n"; - echo "

Click here to delete campaign $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=52 confirmation before logging all agents out of campaign of campaign -###################### - -if ($ADD==52) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - echo "
AGENT LOGOUT CONFIRMATION: $campaign_id\n"; - echo "

Click here to log all agents out of $campaign_id


\n"; - } - -$ADD='31'; # go to campaign modification below -} - -###################### -# ADD=511 confirmation before deletion of list -###################### - -if ($ADD==511) -{ - echo ""; - - if ( (strlen($list_id) < 2) or ($LOGdelete_lists < 1) ) - { - echo "
LIST NOT DELETED - Please go back and look at the data you entered\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - echo "
LIST DELETION CONFIRMATION: $list_id\n"; - echo "

Click here to delete list and all of its leads $list_id


\n"; - } - -$ADD='311'; # go to campaign modification below -} - -###################### -# ADD=5111 confirmation before deletion of in-group -###################### - -if ($ADD==5111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($LOGdelete_ingroups < 1) ) - { - echo "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - echo "
IN-GROUP DELETION CONFIRMATION: $group_id\n"; - echo "

Click here to delete in-group $group_id


\n"; - } - -$ADD='3111'; # go to in-group modification below -} - -###################### -# ADD=51111 confirmation before deletion of remote agent record -###################### - -if ($ADD==51111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($LOGdelete_remote_agents < 1) ) - { - echo "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - echo "
REMOTE AGENT DELETION CONFIRMATION: $remote_agent_id\n"; - echo "

Click here to delete remote agent $remote_agent_id


\n"; - } - -$ADD='31111'; # go to remote agent modification below -} - -###################### -# ADD=511111 confirmation before deletion of user group record -###################### - -if ($ADD==511111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($LOGdelete_user_groups < 1) ) - { - echo "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - echo "
USER GROUP DELETION CONFIRMATION: $user_group\n"; - echo "

Click here to delete user group $user_group


\n"; - } - -$ADD='311111'; # go to user group modification below -} - -###################### -# ADD=5111111 confirmation before deletion of script record -###################### - -if ($ADD==5111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($LOGdelete_scripts < 1) ) - { - echo "
SCRIPT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Script_id must be at least 2 characters in length\n"; - } - else - { - echo "
SCRIPT DELETION CONFIRMATION: $script_id\n"; - echo "

Click here to delete script $script_id


\n"; - } - -$ADD='3111111'; # go to script modification below -} - -###################### -# ADD=51111111 confirmation before deletion of filter record -###################### - -if ($ADD==51111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($LOGdelete_filters < 1) ) - { - echo "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Filter ID must be at least 2 characters in length\n"; - } - else - { - echo "
FILTER DELETION CONFIRMATION: $lead_filter_id\n"; - echo "

Click here to delete filter $lead_filter_id


\n"; - } - -$ADD='31111111'; # go to filter modification below -} - -###################### -# ADD=511111111 confirmation before deletion of call time record -###################### - -if ($ADD==511111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - echo "
CALL TIME DELETION CONFIRMATION: $call_time_id\n"; - echo "

Click here to delete call time $call_time_id


\n"; - } - -$ADD='311111111'; # go to call time modification below -} - -###################### -# ADD=5111111111 confirmation before deletion of call time record -###################### - -if ($ADD==5111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - echo "
STATE CALL TIME DELETION CONFIRMATION: $call_time_id\n"; - echo "

Click here to delete state call time $call_time_id


\n"; - } - -$ADD='3111111111'; # go to state call time modification below -} - - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete user record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( ( strlen($user) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_users < 1) ) - { - echo "
USER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_users where user='$user' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING USER!!!!|$PHP_AUTH_USER|$ip|user='$user'|\n"); - fclose($fp); - } - echo "
USER DELETION COMPLETED: $user\n"; - echo "

\n"; - } - -$ADD='0'; # go to user list -} - -###################### -# ADD=61 delete campaign record -###################### - -if ($ADD==61) -{ - echo ""; - - if ( ( strlen($campaign_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_campaigns < 1) ) - { - echo "
CAMPAIGN NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_campaigns where campaign_id='$campaign_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($campaign_id)\n"; - $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!DELETING CAMPAIGN!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
CAMPAIGN DELETION COMPLETED: $campaign_id\n"; - echo "

\n"; - } - -$ADD='10'; # go to campaigns list -} - -###################### -# ADD=62 Logout all agents fro a campaign -###################### - -if ($ADD==62) -{ - echo ""; - - if (strlen($campaign_id) < 2) - { - echo "
AGENTS NOT LOGGED OUT OF CAMPAIGN - Please go back and look at the data you entered\n"; - echo "
Campaign_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_live_agents where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!AGENT LOGOUT!!!!!!|$PHP_AUTH_USER|$ip|campaign_id='$campaign_id'|\n"); - fclose($fp); - } - echo "
AGENT LOGOUT COMPLETED: $campaign_id\n"; - echo "

\n"; - } - -$ADD='31'; # go to campaign modification below -} - - -###################### -# ADD=65 delete campaign lead recycle in the system -###################### - -if ($ADD==65) -{ - echo ""; - - if ( (strlen($campaign_id) < 2) or (strlen($status) < 1) ) - { - echo "
CAMPAIGN LEAD RECYCLE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
status must be between 1 and 6 characters in length\n"; - echo "
attempt delay must be at least 120 seconds\n"; - echo "
maximum attempts must be from 1 to 10\n"; - } - else - { - echo "
CAMPAIGN LEAD RECYCLE DELETED: $campaign_id - $status - $attempt_delay\n"; - - $stmt="DELETE FROM vicidial_lead_recycle where campaign_id='$campaign_id' and status='$status';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|DELETE LEAD RECYCLE |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - } - } - -$ADD=31; # go to campaign modification form below -} - -###################### -# ADD=611 delete list record and all leads within it -###################### - -if ($ADD==611) -{ - echo ""; - - if ( ( strlen($list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_lists < 1) ) - { - echo "
LIST NOT DELETED - Please go back and look at the data you entered\n"; - echo "
List_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lists where list_id='$list_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST HOPPER LEADS FROM OLD CAMPAIGN HOPPER ($list_id)\n"; - $stmt="DELETE from vicidial_hopper where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - echo "
REMOVING LIST LEADS FROM VICIDIAL_LIST TABLE\n"; - $stmt="DELETE from vicidial_list where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING LIST!!!!|$PHP_AUTH_USER|$ip|list_id='$list_id'|\n"); - fclose($fp); - } - echo "
LIST DELETION COMPLETED: $list_id\n"; - echo "

\n"; - } - -$ADD='100'; # go to lists list -} - -###################### -# ADD=6111 delete in-group record -###################### - -if ($ADD==6111) -{ - echo ""; - - if ( (strlen($group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_ingroups < 1) ) - { - echo "
IN-GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Group_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_inbound_groups where group_id='$group_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING IN-GROUP!!|$PHP_AUTH_USER|$ip|group_id='$group_id'|\n"); - fclose($fp); - } - echo "
IN-GROUP DELETION COMPLETED: $group_id\n"; - echo "

\n"; - } - -$ADD='1000'; # go to in-group list -} - -###################### -# ADD=61111 delete remote agent record -###################### - -if ($ADD==61111) -{ - echo ""; - - if ( (strlen($remote_agent_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) - { - echo "
REMOTE AGENT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Remote_agent_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_remote_agents where remote_agent_id='$remote_agent_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING RMTAGENT!!|$PHP_AUTH_USER|$ip|remote_agent_id='$remote_agent_id'|\n"); - fclose($fp); - } - echo "
REMOTE AGENT DELETION COMPLETED: $remote_agent_id\n"; - echo "

\n"; - } - -$ADD='10000'; # go to remote agents list -} - -###################### -# ADD=611111 delete user group record -###################### - -if ($ADD==611111) -{ - echo ""; - - if ( (strlen($user_group) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_user_groups < 1) ) - { - echo "
USER GROUP NOT DELETED - Please go back and look at the data you entered\n"; - echo "
User_group be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_user_groups where user_group='$user_group' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING USRGROUP!!|$PHP_AUTH_USER|$ip|user_group='$user_group'|\n"); - fclose($fp); - } - echo "
USER GROUP DELETION COMPLETED: $user_group\n"; - echo "

\n"; - } - -$ADD='100000'; # go to user group list -} - -###################### -# ADD=6111111 delete script record -###################### - -if ($ADD==6111111) -{ - echo ""; - - if ( (strlen($script_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_scripts < 1) ) - { - echo "
SCRIPT NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Script_id be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_scripts where script_id='$script_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING SCRIPT!!!!|$PHP_AUTH_USER|$ip|script_id='$script_id'|\n"); - fclose($fp); - } - echo "
SCRIPT DELETION COMPLETED: $script_id\n"; - echo "

\n"; - } - -$ADD='1000000'; # go to script list -} - - -###################### -# ADD=61111111 delete filter record -###################### - -if ($ADD==61111111) -{ - echo ""; - - if ( (strlen($lead_filter_id) < 2) or ($CoNfIrM != 'YES') or ($LOGdelete_filters < 1) ) - { - echo "
FILTER NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Filter ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_lead_filters where lead_filter_id='$lead_filter_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING FILTER!!!!|$PHP_AUTH_USER|$ip|lead_filter_id='$lead_filter_id'|\n"); - fclose($fp); - } - echo "
FILTER DELETION COMPLETED: $lead_filter_id\n"; - echo "

\n"; - } - -$ADD='10000000'; # go to filter list -} - - -###################### -# ADD=611111111 delete call times record -###################### - -if ($ADD==611111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_call_times where call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
CALL TIME DELETION COMPLETED: $call_time_id\n"; - echo "

\n"; - } - -$ADD='100000000'; # go to call times list -} - - -###################### -# ADD=6111111111 delete call times record -###################### - -if ($ADD==6111111111) -{ - echo ""; - - if ( (strlen($call_time_id) < 2) or ($LOGdelete_call_times < 1) ) - { - echo "
STATE CALL TIME NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Call Time ID must be at least 2 characters in length\n"; - } - else - { - $stmt="DELETE from vicidial_state_call_times where state_call_time_id='$call_time_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT call_time_id,ct_state_call_times from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\" order by call_time_id;"; - $rslt=mysql_query($stmt, $link); - $sct_to_print = mysql_num_rows($rslt); - $sct_list=''; - - $o=0; - while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_ids[$o] = "$rowx[0]"; - $sct_states[$o] = "$rowx[1]"; - $o++; - } - $o=0; - - while ($sct_to_print > $o) { - $sct_states[$o] = eregi_replace("\|$call_time_id\|",'|',$sct_states[$o]); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$sct_states[$o]' where call_time_id='$sct_ids[$o]';"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - echo "State Rule Removed: $sct_ids[$o]
\n"; - $o++; - } - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!DELETING CALL TIME!|$PHP_AUTH_USER|$ip|state_call_time_id='$call_time_id'|\n"); - fclose($fp); - } - echo "
STATE CALL TIME DELETION COMPLETED: $call_time_id\n"; - echo "

\n"; - } - -$ADD='1000000000'; # go to call times list -} - - - - - - -###################################################################################################### -###################################################################################################### -####### 3 series, record modification forms -###################################################################################################### -###################################################################################################### - - - - -###################### -# ADD=3 modify user info in the system -###################### - -if ($ADD==3) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_level = $row[4]; - $user_group = $row[5]; - $phone_login = $row[6]; - $phone_pass = $row[7]; - $delete_users = $row[8]; - $delete_user_groups = $row[9]; - $delete_lists = $row[10]; - $delete_campaigns = $row[11]; - $delete_ingroups = $row[12]; - $delete_remote_agents = $row[13]; - $load_leads = $row[14]; - $campaign_detail = $row[15]; - $ast_admin_access = $row[16]; - $ast_delete_phones = $row[17]; - $delete_scripts = $row[18]; - $modify_leads = $row[19]; - $hotkeys_active = $row[20]; - $change_agent_campaign =$row[21]; - $agent_choose_ingroups =$row[22]; - $scheduled_callbacks = $row[24]; - $agentonly_callbacks = $row[25]; - $agentcall_manual = $row[26]; - $vicidial_recording = $row[27]; - $vicidial_transfers = $row[28]; - $delete_filters = $row[29]; - $alter_agent_interface_options =$row[30]; - $closer_default_blended = $row[31]; - $delete_call_times = $row[32]; - $modify_call_times = $row[33]; - -if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) - { - echo "
You do not have permissions to modify this user: $row[1]\n"; - } -else - { - echo "
MODIFY A USERS RECORD: $row[1]\n"; - if ($LOGuser_level > 8) - {echo "\n";} - else - { - if ($LOGalter_agent_interface == "1") - {echo "\n";} - else - {echo "\n";} - } - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") ) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - if ($LOGuser_level > 8) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "\n"; - echo "
User Number: $row[1]$NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group: $NWB#vicidial_users-user_group$NWE
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
AGENT INTERFACE OPTIONS:
Agent Choose Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
HotKeys Active: $NWB#vicidial_users-hotkeys_active$NWE
Scheduled Callbacks: $NWB#vicidial_users-scheduled_callbacks$NWE
Agent-Only Callbacks: $NWB#vicidial_users-agentonly_callbacks$NWE
Agent Call Manual: $NWB#vicidial_users-agentcall_manual$NWE
Vicidial Recording: $NWB#vicidial_users-vicidial_recording$NWE
Vicidial Transfers: $NWB#vicidial_users-vicidial_transfers$NWE
Closer Default Blended: $NWB#vicidial_users-closer_default_blended$NWE
Inbound Groups: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_users-closer_campaigns$NWE
ADMIN INTERFACE OPTIONS:
Alter Agent Interface Options: $NWB#vicidial_users-alter_agent_interface_options$NWE
Delete Users: $NWB#vicidial_users-delete_users$NWE
Delete User Groups: $NWB#vicidial_users-delete_user_groups$NWE
Delete Lists: $NWB#vicidial_users-delete_lists$NWE
Delete Campaigns: $NWB#vicidial_users-delete_campaigns$NWE
Delete In-Groups: $NWB#vicidial_users-delete_ingroups$NWE
Delete Remote Agents: $NWB#vicidial_users-delete_remote_agents$NWE
Delete Scripts: $NWB#vicidial_users-delete_scripts$NWE
Load Leads: $NWB#vicidial_users-load_leads$NWE
Campaign Detail: $NWB#vicidial_users-campaign_detail$NWE
AGC Admin Access: $NWB#vicidial_users-ast_admin_access$NWE
AGC Delete Phones: $NWB#vicidial_users-ast_delete_phones$NWE
Modify Leads: $NWB#vicidial_users-modify_leads$NWE
Change Agent Campaign: $NWB#vicidial_users-change_agent_campaign$NWE
Delete Filters: $NWB#vicidial_users-delete_filters$NWE
Delete Call Times: $NWB#vicidial_users-delete_call_times$NWE
Modify Call Times: $NWB#vicidial_users-modify_call_times$NWE
\n"; - - if ($LOGdelete_users > 0) - { - echo "

DELETE THIS USER\n"; - } - echo "

Click here for user time sheet\n"; - echo "

Click here for user status\n"; - echo "

Click here for user stats\n"; - echo "

Click here for user CallBack Holds\n"; - } - -} - - -###################### -# ADD=31 modify campaign info in the system - Detail view -###################### - -if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed - -if ($ADD==31) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $campaign_rec_exten = $row[22]; - $campaign_recording = $row[23]; - $campaign_rec_filename = $row[24]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $am_message_exten = $row[27]; - $amd_send_to_vmx = $row[28]; - $xferconf_a_dtmf = $row[29]; - $xferconf_a_number = $row[30]; - $xferconf_b_dtmf = $row[31]; - $xferconf_b_number = $row[32]; - $alt_number_dialing = $row[33]; - $scheduled_callbacks = $row[34]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $drop_call_seconds = $row[36]; - $safe_harbor_message = $row[37]; - $safe_harbor_exten = $row[38]; - $display_dialable_count = $row[39]; - $wrapup_seconds = $row[40]; - $wrapup_message = $row[41]; -# $closer_campaigns = $row[42]; - $use_internal_dnc = $row[43]; - -echo "
MODIFY A CAMPAIGNS RECORD: $row[0] - Basic View"; -echo " | Detail View | "; -echo "Realtime Screen\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -if (eregi("CLOSER", $campaign_id)) - { - echo "\n"; - } - - - -echo "\n"; -echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Dial status 1: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE
List Order: $NWB#vicidial_campaigns-lead_order$NWE
Lead Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Dial Timeout: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
Dial Prefix: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Campaign CallerID: $NWB#vicidial_campaigns-campaign_cid$NWE
Campaign VDAD exten: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Campaign Rec exten: $NWB#vicidial_campaigns-campaign_rec_exten$NWE
Campaign Recording: $NWB#vicidial_campaigns-campaign_recording$NWE
Campaign Rec Filename: $NWB#vicidial_campaigns-campaign_rec_filename$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
Answering Machine Message: $NWB#vicidial_campaigns-am_message_exten$NWE
AMD Send to VM exten: $NWB#vicidial_campaigns-amd_send_to_vmx$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Alt Number Dialing: $NWB#vicidial_campaigns-alt_number_dialing$NWE
Scheduled Callbacks: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Drop Call Seconds: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Use Safe Harbor Message: $NWB#vicidial_campaigns-safe_harbor_message$NWE
Safe Harbor Exten: $NWB#vicidial_campaigns-safe_harbor_exten$NWE
Wrapup Seconds: $NWB#vicidial_campaigns-wrapup_seconds$NWE
Wrapup Message: $NWB#vicidial_campaigns-wrapup_message$NWE
Use Internal DNC List: $NWB#vicidial_campaigns-use_internal_dnc$NWE
Allowed Inbound Groups:
"; - echo " $NWB#vicidial_campaigns-closer_campaigns$NWE
\n"; - echo "$groups_list"; - echo "
\n"; - -echo "
\n"; -echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\n"; - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - HIDE

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - SHOW

"; - } - - - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "This campaign has $hopper_leads leads in the dial hopper

\n"; -echo "Click here to see what leads are in the hopper right now

\n"; -echo "Click here to see all CallBack Holds in this campaign

\n"; -echo "
\n"; - - - - -echo "
\n"; -echo "
CUSTOM STATUSES WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_statuses$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
STATUSDESCRIPTIONSELECTABLEDELETE
$rowx[0]$rowx[1]$rowx[2]DELETE
\n"; - -echo "
ADD NEW CUSTOM CAMPAIGN STATUS
\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Description:   \n"; -echo "Selectable:   \n"; -echo "
\n"; - -echo "

\n"; - - - -echo "
CUSTOM HOTKEYS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_hotkeys$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_campaign_hotkeys where campaign_id='$campaign_id' order by hotkey"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
HOTKEYSTATUSDESCRIPTIONDELETE
$rowx[1]$rowx[0]$rowx[2]DELETE
\n"; - -echo "
ADD NEW CUSTOM CAMPAIGN HOTKEY
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Hotkey:   \n"; -echo "Status:   \n"; -echo "
\n"; -echo "

\n"; - - - -echo "

LEAD RECYCLING WITHIN THIS CAMPAIGN:   $NWB#vicidial_lead_recycle$NWE
\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT * from vicidial_lead_recycle where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $recycle_to_print = mysql_num_rows($rslt); - $o=0; - while ($recycle_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - -echo "
STATUSATTEMPT DELAYATTEMPT MAXIMUMACTIVE DELETE
$rowx[2]
\n"; - echo "\n"; - echo "\n"; - echo "
DELETE
\n"; - -echo "
ADD NEW CAMPAIGN LEAD RECYCLE
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Status:   \n"; -echo "Attempt Delay: \n"; -echo "Attempt Maximum: \n"; -echo "
\n"; - -echo "

\n"; - -echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; - -if ($LOGdelete_campaigns > 0) - { - echo "

DELETE THIS CAMPAIGN\n"; - } - -} - - -###################### -# ADD=34 modify campaign info in the system - Basic View -###################### - -if ($ADD==34) -{ - if ($stage=='show_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } - if ($stage=='hide_dialable') - { - $stmt="UPDATE vicidial_campaigns set display_dialable_count='N' where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - } -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns where campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dial_status_a = $row[3]; - $dial_status_b = $row[4]; - $dial_status_c = $row[5]; - $dial_status_d = $row[6]; - $dial_status_e = $row[7]; - $lead_order = $row[8]; - $hopper_level = $row[13]; - $auto_dial_level = $row[14]; - $next_agent_call = $row[15]; - $local_call_time = $row[16]; - $voicemail_ext = $row[17]; - $dial_timeout = $row[18]; - $dial_prefix = $row[19]; - $campaign_cid = $row[20]; - $campaign_vdad_exten = $row[21]; - $script_id = $row[25]; - $get_call_launch = $row[26]; - $lead_filter_id = $row[35]; - if ($lead_filter_id=='') {$lead_filter_id='NONE';} - $display_dialable_count = $row[39]; - -echo "
MODIFY A CAMPAIGN'S RECORD: $row[0] - Basic View | "; -echo "Detail View | "; -echo "Realtime Screen\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; -echo "
Campaign ID: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Web Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Dial status 1: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE
Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE
List Order: $NWB#vicidial_campaigns-lead_order$NWE
Lead Filter: $NWB#vicidial_campaigns-lead_filter_id$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Script: $script_id
Get Call Launch: $get_call_launch
\n"; - -echo "
\n"; -echo "
LISTS WITHIN THIS CAMPAIGN:   $NWB#vicidial_campaign_lists$NWE
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT list_id,active,list_name from vicidial_lists where campaign_id='$campaign_id'"; - $rslt=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rslt); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
LIST IDLIST NAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - -$filterSQL = $filtersql_list[$lead_filter_id]; -$filterSQL = eregi_replace("^and|and$|^or|or$","",$filterSQL); -if (strlen($filterSQL)>4) - {$fSQL = "and $filterSQL";} -else - {$fSQL = '';} - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This campaign has $active_lists active lists and $inactive_lists inactive lists

\n"; - - -if ($display_dialable_count == 'Y') - { - ### call function to calculate and print dialable leads - dialable_leads($DB,$link,$local_call_time,$dial_status_a,$dial_status_b,$dial_status_c,$dial_status_d,$dial_status_e,$camp_lists,$fSQL); - echo " - HIDE

"; - } -else - { - echo "Popup Dialable Leads Count"; - echo " - SHOW

"; - } - - - - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id='$campaign_id' and status IN('READY')"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $hopper_leads = "$rowx[0]"; - -echo "This campaign has $hopper_leads leads in the dial hopper

\n"; -echo "Click here to see what leads are in the hopper right now

\n"; -echo "Click here to see all CallBack Holds in this campaign

\n"; -echo "
\n"; - -echo "
\n"; - -echo "LOG ALL AGENTS OUT OF THIS CAMPAIGN

\n"; - - -if ($LOGdelete_campaigns > 0) - { - echo "

DELETE THIS CAMPAIGN\n"; - } - - -} - - -###################### -# ADD=311 modify list info in the system -###################### - -if ($ADD==311) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $Cstatuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($Cstatuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - # end grab status names - - -echo "
MODIFY A LISTS RECORD: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List ID: $row[0]$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
Reset Lead-Called-Status for this list: $NWB#vicidial_lists-reset_list$NWE
\n"; - -echo "
\n"; -echo "
STATUSES WITHIN THIS LIST:
\n"; -echo "\n"; -echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $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($rslt); - - $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]] = ($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; - if ($lead_list['count'] > 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 ($dispo == 'CBHOLD') - { - $CLB=""; - $CLE=""; - } - else - { - $CLB=''; - $CLE=''; - } - - echo "\n"; - $o++; - } - } - -echo "\n"; -echo "\n"; - -echo "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; -unset($lead_list); - - - - - -echo "
\n"; -echo "
TIME ZONES WITHIN THIS LIST:
\n"; -echo "\n"; -echo "\n"; - - $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"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - $plus='+'; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $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]] = ($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++; - } - - if ($lead_list['count'] > 0) - { - while (list($tzone,) = each($lead_list[$since_reset])) - { - $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - - if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} - else {$DISPtzone = "$tzone";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - } - } - -echo "\n"; -echo "\n"; - -echo "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; -unset($lead_list); - - - - - - - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; - $rslt=mysql_query($stmt, $link); - $status_called_to_print = mysql_num_rows($rslt); - - $o=0; - $sts=0; - $first_row=1; - $all_called_first=1000; - $all_called_last=0; - while ($status_called_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $leads_in_list = ($leads_in_list + $rowx[2]); - $count_statuses[$o] = "$rowx[0]"; - $count_called[$o] = "$rowx[1]"; - $count_count[$o] = "$rowx[2]"; - $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); - - if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) - { - if ($first_row) {$first_row=0;} - else {$sts++;} - $status[$sts] = "$rowx[0]"; - $status_called_first[$sts] = "$rowx[1]"; - if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} - } - $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); - $status_called_last[$sts] = "$rowx[1]"; - if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} - - $o++; - } - - - - -echo "
\n"; -echo "
CALLED COUNTS WITHIN THIS LIST:
\n"; -echo "\n"; -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - - $sts=0; - $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 ""; - - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $sts)) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - else - { - if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} - } - - $called_printed=0; - $o=0; - while ($status_called_to_print > $o) - { - if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) - { - $called_printed++; - echo ""; - } - - - $o++; - } - if (!$called_printed) - {echo "";} - $first++; - } - echo "\n\n"; - - $sts++; - } - -echo ""; -$first = $all_called_first; -while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } -echo "\n"; - -echo "
STATUSSTATUS NAME$firstSUBTOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; - - - - - -echo "
\n"; - -if ($LOGdelete_lists > 0) - { - echo "

DELETE THIS LIST\n"; - } - -} - - - -###################### -# ADD=3111 modify in-group info in the system -###################### - -if ($ADD==3111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups where group_id='$group_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $group_name = $row[1]; - $group_color = $row[2]; - $active = $row[3]; - $web_form_address = $row[4]; - $voicemail_ext = $row[5]; - $next_agent_call = $row[6]; - $fronter_display = $row[7]; - $script_id = $row[8]; - $get_call_launch = $row[9]; - $xferconf_a_dtmf = $row[10]; - $xferconf_a_number = $row[11]; - $xferconf_b_dtmf = $row[12]; - $xferconf_b_number = $row[13]; - $drop_call_seconds = $row[14]; - $drop_message = $row[15]; - $drop_exten = $row[16]; - -echo "
MODIFY A GROUPS RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; - - -echo "\n"; -echo "
Group ID: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Transfer-Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf DTMF 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfer-Conf Number 2: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Drop Call Seconds: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Use Drop Message: $NWB#vicidial_inbound_groups-drop_message$NWE
Drop Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
\n"; - -echo "

\n"; - -echo "
\n"; - -if ($LOGdelete_ingroups > 0) - { - echo "

DELETE THIS IN-GROUP\n"; - } - -} - - - -###################### -# ADD=31111 modify remote agents info in the system -###################### - -if ($ADD==31111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dialplan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; -echo "$groups_list"; -echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - - -if ($LOGdelete_remote_agents > 0) - { - echo "

DELETE THIS REMOTE AGENT\n"; - } - -} - - -###################### -# ADD=311111 modify user group info in the system -###################### - -if ($ADD==311111) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups where user_group='$user_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; -echo ""; - -echo "
MODIFY A USERS GROUP ENTRY\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - -if ($LOGdelete_user_groups > 0) - { - echo "

DELETE THIS USER GROUP\n"; - } - -} - - -###################### -# ADD=3111111 modify script info in the system -###################### - -if ($ADD==3111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts where script_id='$script_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $script_name = $row[1]; - $script_comments = $row[2]; - $script_text = $row[3]; - $active = $row[4]; -echo ""; - -echo "
MODIFY A SCRIPT\n"; -echo "\n"; -echo "\n"; -echo "
Script ID: $script_id$NWB#vicidial_scripts-script_name$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text:

Preview Script
$NWB#vicidial_scripts-script_text$NWE
\n"; - -if ($LOGdelete_scripts > 0) - { - echo "

DELETE THIS SCRIPT\n"; - } - -} - - -###################### -# ADD=31111111 modify filter info in the system -###################### - -if ($ADD==31111111) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lead_filters where lead_filter_id='$lead_filter_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $lead_filter_name = $row[1]; - $lead_filter_comments = $row[2]; - $lead_filter_sql = $row[3]; -echo ""; - -echo "
MODIFY A FILTER\n"; -echo "\n"; -echo "\n"; -echo "
Filter ID: $lead_filter_id$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - -echo "

"; -echo "
TEST ON CAMPAIGN:
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -if ($LOGdelete_filters > 0) - { - echo "

DELETE THIS FILTER\n"; - } - -} - - -###################### -# ADD=321111111 modify call time definition info in the system -###################### - -if ($ADD==321111111) -{ -if ($LOGmodify_call_times==1) -{ - -if ( ($stage=="ADD") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - if (eregi("\|$",$ct_state_call_times)) - {$ct_state_call_times = "$ct_state_call_times$state_rule\|";} - else - {$ct_state_call_times = "$ct_state_call_times\|$state_rule\|";} - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "State Rule Added: $state_rule
\n"; - } -if ( ($stage=="REMOVE") and (strlen($state_rule)>0) ) - { - $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $ct_state_call_times = $row[0]; - - $ct_state_call_times = eregi_replace("\|$state_rule\|",'|',$ct_state_call_times); - $stmt="UPDATE vicidial_call_times set ct_state_call_times='$ct_state_call_times' where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - echo "State Rule Removed: $state_rule
\n"; - } - -$ADD=311111111; -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# ADD=311111111 modify call time definition info in the system -###################### - -if ($ADD==311111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -$ct_srs=1; -$b=0; -$srs_SQL =''; -if (strlen($ct_state_call_times)>2) - { - $state_rules = explode('|',$ct_state_call_times); - $ct_srs = ((count($state_rules)) - 1); - } -echo "\n"; -echo "\n"; -while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>0) - { - $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - echo "\n"; - $srs_SQL .= "'$state_rules[$b]',"; - $srs_state_SQL .= "'$row[0]',"; - } - $b++; - } -if (strlen($srs_SQL)>2) - { - $srs_SQL = "$srs_SQL''"; - $srs_state_SQL = "$srs_state_SQL''"; - $srs_SQL = "where state_call_time_id NOT IN($srs_SQL) and state_call_time_state NOT IN($srs_state_SQL)"; - } -else - {$srs_SQL='';} -$stmt="SELECT state_call_time_id,state_call_time_name from vicidial_state_call_times $srs_SQL order by state_call_time_id;"; -$rslt=mysql_query($stmt, $link); -$sct_to_print = mysql_num_rows($rslt); -$sct_list=''; - -$o=0; -while ($sct_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $sct_list .= "\n"; - $o++; -} -echo "\n"; -echo "\n"; - -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_call_times where call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $call_time_name = $row[1]; - $call_time_comments = $row[2]; - $ct_default_start = $row[3]; - $ct_default_stop = $row[4]; - $ct_sunday_start = $row[5]; - $ct_sunday_stop = $row[6]; - $ct_monday_start = $row[7]; - $ct_monday_stop = $row[8]; - $ct_tuesday_start = $row[9]; - $ct_tuesday_stop = $row[10]; - $ct_wednesday_start = $row[11]; - $ct_wednesday_stop = $row[12]; - $ct_thursday_start = $row[13]; - $ct_thursday_stop = $row[14]; - $ct_friday_start = $row[15]; - $ct_friday_stop = $row[16]; - $ct_saturday_start = $row[17]; - $ct_saturday_stop = $row[18]; - $ct_state_call_times = $row[19]; - -echo ""; - -echo "
MODIFY A CALL TIME\n"; -echo "\n"; -echo "\n"; -echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Active State Call Time Definitions for this Record:  
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "Add state call time rule:


\n"; -echo "CAMPAIGNS USING THIS CALL TIME:
\n"; -echo "\n"; - - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - $CT_camp_id = $row[1]; - $CT_camp_name = $row[2]; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

DELETE THIS CALL TIME DEFINITION\n"; - } -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - -###################### -# ADD=3111111111 modify state call time definition info in the system -###################### - -if ($ADD==3111111111) -{ - -if ($LOGmodify_call_times==1) -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$call_time_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $state_call_time_state =$row[1]; - $call_time_name = $row[2]; - $call_time_comments = $row[3]; - $ct_default_start = $row[4]; - $ct_default_stop = $row[5]; - $ct_sunday_start = $row[6]; - $ct_sunday_stop = $row[7]; - $ct_monday_start = $row[8]; - $ct_monday_stop = $row[9]; - $ct_tuesday_start = $row[10]; - $ct_tuesday_stop = $row[11]; - $ct_wednesday_start = $row[12]; - $ct_wednesday_stop = $row[13]; - $ct_thursday_start = $row[14]; - $ct_thursday_stop = $row[15]; - $ct_friday_start = $row[16]; - $ct_friday_stop = $row[17]; - $ct_saturday_start = $row[18]; - $ct_saturday_stop = $row[19]; - -echo ""; - -echo "
MODIFY A STATE CALL TIME
\n"; -echo "\n"; -echo "\n"; -echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
Sunday Start: Sunday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Monday Start: Monday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Tuesday Start: Tuesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Wednesday Start: Wednesday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Thursday Start: Thursday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Friday Start: Friday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE
Saturday Start: Saturday Stop: $NWB#vicidial_call_times-ct_sunday_start$NWE


\n"; -echo "CALL TIMES USING THIS STATE CALL TIME:
\n"; -echo "\n"; - - $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_state_call_times LIKE \"%|$call_time_id|%\";"; - $rslt=mysql_query($stmt, $link); - $camps_to_print = mysql_num_rows($rslt); - $o=0; - while ($camps_to_print > $o) { - $row=mysql_fetch_row($rslt); - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]
\n"; -echo "

\n"; - -if ($LOGdelete_call_times > 0) - { - echo "

DELETE THIS STATE CALL TIME DEFINITION\n"; - } - -} -else -{ -echo "You are not authorized to view this page. Please go back."; -} - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo "
\n"; -echo ""; - -echo "
SEARCH FOR A USER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "\n"; -echo "
User Number:
Full Name:
User Level:
User Group:
\n"; - -} - -###################### -# ADD=66 user search results -###################### - -if ($ADD==66) -{ -echo "
\n"; - echo ""; - - $SQL = ''; - if ($user) {$SQL .= " user LIKE \"%$user%\" and";} - if ($full_name) {$SQL .= " full_name LIKE \"%$full_name%\" and";} - if ($user_level > 0) {$SQL .= " user_level LIKE \"%$user_level%\" and";} - if ($user_group) {$SQL .= " user_group = '$user_group' and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from vicidial_users $SQL order by full_name desc;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SEARCH RESULTS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS | STATUS | TIME
\n"; - -} - - -###################################################################################################### -###################################################################################################### -####### 8 series, Callback lists -###################################################################################################### -###################################################################################################### - -###################### -# ADD=8 find all callbacks on hold by a User -###################### -if ($ADD==8) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user='$user' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
USER CALLBACK HOLD LISTINGS: $user\n"; -$ADD='82'; -} - -###################### -# ADD=81 find all callbacks on hold within a Campaign -###################### -if ($ADD==81) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and campaign_id='$campaign_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN CALLBACK HOLD LISTINGS: $campaign_id\n"; -$ADD='82'; -} - -###################### -# ADD=811 find all callbacks on hold within a List -###################### -if ($ADD==811) -{ - echo ""; - - $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and list_id='$list_id' order by recipient,status desc,callback_time"; - $rslt=mysql_query($stmt, $link); - $cb_to_print = mysql_num_rows($rslt); - -echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; -$ADD='82'; -} - -###################### -# ADD=82 display all callbacks on hold -###################### -if ($ADD==82) -{ -echo "
\n"; -echo "
\n"; -echo "\n"; - - $o=0; - while ($cb_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
LEADLISTCAMPAIGNENTRY DATECALLBACK DATEUSERRECIPIENTSTATUS
$row[1]$row[2]$row[3]$row[5]$row[6]$row[8]$row[9]$row[4]
\n"; -} - - - -###################################################################################################### -###################################################################################################### -####### 0 series, displays and searches -###################################################################################################### -###################################################################################################### - -###################### -# ADD=0 display all active users -###################### -if ($ADD==0) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_users order by full_name"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1]$row[3]$row[4]$row[5]MODIFY | STATS | STATUS | TIME
\n"; -} - -###################### -# ADD=10 display all campaigns -###################### -if ($ADD==10) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
CAMPAIGN LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3]$row[4]$row[5] $row[6]$row[7]  MODIFY
\n"; -} - - -###################### -# ADD=100 display all lists -###################### -if ($ADD==100) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_lists order by list_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
LIST LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]$row[5] $row[3]$row[7]  MODIFY
\n"; -} - - - -###################### -# ADD=1000 display all inbound groups -###################### -if ($ADD==1000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
INBOUND GROUP LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[5]  MODIFY
\n"; -} - - -###################### -# ADD=10000 display all remote agents -###################### -if ($ADD==10000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_remote_agents order by server_ip,campaign_id,user_start"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
REMOTE AGENTS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6]MODIFY
\n"; -} - - -###################### -# ADD=100000 display all user groups -###################### -if ($ADD==100000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_user_groups order by user_group"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
USER GROUPS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=1000000 display all scripts -###################### -if ($ADD==1000000) -{ -echo "
\n"; - echo ""; - - $stmt="SELECT * from vicidial_scripts order by script_id"; - $rslt=mysql_query($stmt, $link); - $people_to_print = mysql_num_rows($rslt); - -echo "
SCRIPTS LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($people_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=10000000 display all filters -###################### -if ($ADD==10000000) -{ -echo "\r\n"; - } -} - diff --git a/VICIDIAL_web/listloader_super.pl b/VICIDIAL_web/listloader_super.pl deleted file mode 100644 index a36765d0..00000000 --- a/VICIDIAL_web/listloader_super.pl +++ /dev/null @@ -1,691 +0,0 @@ -#!/usr/bin/perl - -### listloader_super.pl -### -### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 -### -# -# -# CHANGES -# 60616-1548 - Added listID override feature to force all leads into same list -# - Added gmt_offset_now lookup for each lead -# - -### begin parsing run-time options ### -if (length($ARGV[0])>1) -{ - $i=0; - while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } - - if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - } - else - { - if ($args =~ /--forcelistid=/i) - { - @data_in = split(/--forcelistid=/,$args); - $forcelistid = $data_in[1]; - print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; - } - else - {$forcelistid = '';} - } -} -### end parsing run-time options ### - -use Spreadsheet::ParseExcel; -use Time::Local; -use Net::MySQL; - -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file - -if (!$DB_port) {$DB_port='3306';} - -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; - - -$vars=$ARGV[0]; -@xls_fields=split(/\,/, $vars); - -$|=0; -$secX = time(); - -($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); -$year = ($year + 1900); -$mon++; -if ($hour < 10) {$hour = "0$hour";} -if ($min < 10) {$min = "0$min";} -if ($sec < 10) {$sec = "0$sec";} -if ($mon < 10) {$mon = "0$mon";} -if ($mday < 10) {$mday = "0$mday";} -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$pulldate="$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - - ### Grab Server values from the database - $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $DBSERVER_GMT = "$record->[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} - } - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -if ($isdst) {$LOCAL_GMT_OFF++;} -if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - - -$total=0; $good=0; $bad=0; -open(STMT_FILE, "> listloader_stmts.txt"); - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); -my($iR, $iC, $oWkS, $oWkC); - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { - - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[0]]; - if ($oWkC) {$vendor_lead_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[1]]; - if ($oWkC) {$source_code=$oWkC->Value; } - $source_id=$source_code; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[2]]; - if ($oWkC) {$list_id=$oWkC->Value; } - $gmt_offset = '0'; - $called_since_last_reset='N'; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[3]]; - if ($oWkC) {$phone_code=$oWkC->Value; } - $phone_code=~s/[^0-9]//g; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[4]]; - if ($oWkC) {$phone_number=$oWkC->Value; } - $phone_number=~s/[^0-9]//g; - $USarea = substr($phone_number, 0, 3); - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[5]]; - if ($oWkC) {$title=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[6]]; - if ($oWkC) {$first_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[7]]; - if ($oWkC) {$middle_initial=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[8]]; - if ($oWkC) {$last_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[9]]; - if ($oWkC) {$address1=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[10]]; - if ($oWkC) {$address2=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[11]]; - if ($oWkC) {$address3=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[12]]; - if ($oWkC) {$city=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[13]]; - if ($oWkC) {$state=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[14]]; - if ($oWkC) {$province=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[15]]; - if ($oWkC) {$postal_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[16]]; - if ($oWkC) {$country_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[17]]; - if ($oWkC) {$gender=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[18]]; - if ($oWkC) {$date_of_birth=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[19]]; - if ($oWkC) {$alt_phone=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[20]]; - if ($oWkC) {$email=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[21]]; - if ($oWkC) {$security_phrase=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[22]]; - if ($oWkC) {$comments=$oWkC->Value; } - $comments=~s/^\s*(.*?)\s*$/$1/; - - if (length($phone_number)>8) { - if (length($forcelistid) > 0) - { - $list_id = $forcelistid; # set list_id to override value - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### MEXICO ### - if ($phone_code =~ /^52$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### AUSTRALIA ### - if ($phone_code =~ /^61$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); - $year = ($year + 1900); - $mon++; - if ($mon < 10) {$mon = "0$mon";} - if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$hour = "0$hour";} - if ($min < 10) {$min = "0$min";} - if ($sec < 10) {$sec = "0$sec";} - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - &USA_dstcalc; - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - &GBR_dstcalc; - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - &AUS_dstcalc; - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - &AUST_dstcalc; - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - &NZL_dstcalc; - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $dbhA->query("$stmtZ"); - print STMT_FILE $stmtZ."\r\n"; - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - sleep(1); -# flush(); - } - } -} - -if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; - $dbhA->query("$stmtZ"); - print STMT_FILE $stmtZ."\r\n"; -} - -print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total"; - -exit; - - - - - - -sub USA_dstcalc { -#********************************************************************** -# FSA-LSO -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in April and last Sunday in October at 2 am. -# INPUTS: -# mm INTEGER Month. -# dd INTEGER Day of the month. -# ns INTEGER Seconds into the day. -# dow INTEGER Day of week (0=Sunday, to 6=Saturday) -# OPTIONAL INPUT: -# timezone INTEGER hour difference UTC - local standard time -# (DEFAULT is blank) -# make calculations based on UTC time, -# which means shift at 10:00 UTC in April -# and 9:00 UTC in October -# OUTPUT: -# INTEGER 1 = DST, 0 = not DST -#********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; return 0; - } elsif ($mm >= 5 && $mm <= 9) { - $USA_DST=1; return 1; - } elsif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $USA_DST=0; return 0; - } else { - $USA_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 7200) { - $USA_DST=0; return 0; - } else { - $USA_DST=1; return 1; - } - } - } else { - $USA_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $USA_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; return 1; - } else { - $USA_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; return 1; - } else { - $USA_DST=0; return 0; - } - } - } else { - $USA_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub GBR_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in March and last Sunday in October at 1 am. -#********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; return 0; - } elsif ($mm >= 4 && $mm <= 9) { - $GBR_DST=1; return 1; - } elsif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $GBR_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } - } else { - $GBR_DST=1; return 1; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $GBR_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } - } else { - $GBR_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub AUS_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUS_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUS_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } - } else { - $AUS_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $AUS_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } - } else { - $AUS_DST=1; return 1; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub AUST_dstcalc { -#********************************************************************** -# TASMANIA ONLY -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUST_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUST_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } - } else { - $AUST_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } - } else { - $AUST_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub NZL_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and third Sunday in March at 1 am. -#********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $NZL_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; return 1; - } elsif ($dd < ($dow+14)) { - $NZL_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } - } else { - $NZL_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } - } else { - $NZL_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc diff --git a/VICIDIAL_web/log_test.php b/VICIDIAL_web/log_test.php deleted file mode 100644 index cd7a86b7..00000000 --- a/VICIDIAL_web/log_test.php +++ /dev/null @@ -1,37 +0,0 @@ - LICENSE: GPLv2 -# - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$fp = fopen ("./closer_SQL_updates.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - fwrite ($fp, "CLOSER SQL UPDATE|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - - -exit; - - - -?> - - -Hello - - diff --git a/VICIDIAL_web/new_listloader_superL.php b/VICIDIAL_web/new_listloader_superL.php deleted file mode 100644 index 6c0ac713..00000000 --- a/VICIDIAL_web/new_listloader_superL.php +++ /dev/null @@ -1,1364 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60113-1603 - Fixed a few bugs in Excel import -# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1240 - added listID override -# 60616-1604 - added gmt lookup for each lead -# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. - -$version = '1.1.12-1'; -$build = '60619-1651'; - - -require("dbconnect.php"); - -### links used for testing -#$link=mysql_connect("10.10.10.15", "cron", "1234"); -#mysql_select_db("asterisk"); -#$WeBServeRRooT = '/home/www/htdocs'; - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} - elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["leadfile_name"])) {$leadfile_name=$_GET["leadfile_name"];} - elseif (isset($_POST["leadfile_name"])) {$leadfile_name=$_POST["leadfile_name"];} -if (isset($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} - elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} -if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} - elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} -if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} - elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} -if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} - elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} -if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} - elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} -if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} - elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} -if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} - elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} -if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} - elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} -if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} - elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} -if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} - elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} -if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} - elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} -if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} - elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} -if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} - elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} -if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} - elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} -if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} - elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} -if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} - elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} -if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} - elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} -if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} - elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} -if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} - elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} -if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} - elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} -if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} - elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} -if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} - elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} -if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} - elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} -if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} - elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} -if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} - elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} -if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} - elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); - -# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HELP\""; - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -function macfontfix($fontsize) { - - $browser = getenv("HTTP_USER_AGENT"); - $pctype = explode("(", $browser); - if (ereg("Mac",$pctype[1])) { - /* Browser is a Mac. If not Netscape 6, raise fonts */ - - $blownbrowser = explode('/', $browser); - $ver = explode(' ', $blownbrowser[1]); - $ver = $ver[0]; - if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); - - } else return $fontsize; /* Browser is not a Mac - don't touch fonts */ -} - -echo "\n"; - -?> - - - -VICIDIAL ADMIN: Super Lead Loader - - -
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - - -
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_lead_filters order by lead_filter_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
LEAD FILTER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1]MODIFY
\n"; -} - - -###################### -# ADD=100000000 display all call times -###################### -if ($ADD==100000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_call_times order by call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
CALL TIME LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[3] $row[4] MODIFY
\n"; -} - -###################### -# ADD=1000000000 display all state call times -###################### -if ($ADD==1000000000) -{ -echo "
\n"; - - echo ""; - - $stmt="SELECT * from vicidial_state_call_times order by state_call_time_id"; - $rslt=mysql_query($stmt, $link); - $filters_to_print = mysql_num_rows($rslt); - -echo "
STATE CALL TIME LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($filters_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2] $row[3] $row[4] MODIFY
\n"; -} - - - - - -echo "
\n"; - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; -echo "             VERSION: $version"; -echo "             BUILD: $build
\n"; - - -?> - - -
- - - -1) - { - $g=0; - $p='13'; - $GMT_gmt[0] = ''; - $GMT_hour[0] = ''; - $GMT_day[0] = ''; - while ($p > -13) - { - $pzone=3600 * $p; - $pmin=(gmdate("i", time() + $pzone)); - $phour=( (gmdate("G", time() + $pzone)) * 100); - $pday=gmdate("w", time() + $pzone); - $tz = sprintf("%.2f", $p); - $GMT_gmt[$g] = "$tz"; - $GMT_day[$g] = "$pday"; - $GMT_hour[$g] = ($phour + $pmin); - $p = ($p - 0.25); - $g++; - } - - $stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $Gct_default_start = "$rowx[3]"; - $Gct_default_stop = "$rowx[4]"; - $Gct_sunday_start = "$rowx[5]"; - $Gct_sunday_stop = "$rowx[6]"; - $Gct_monday_start = "$rowx[7]"; - $Gct_monday_stop = "$rowx[8]"; - $Gct_tuesday_start = "$rowx[9]"; - $Gct_tuesday_stop = "$rowx[10]"; - $Gct_wednesday_start = "$rowx[11]"; - $Gct_wednesday_stop = "$rowx[12]"; - $Gct_thursday_start = "$rowx[13]"; - $Gct_thursday_stop = "$rowx[14]"; - $Gct_friday_start = "$rowx[15]"; - $Gct_friday_stop = "$rowx[16]"; - $Gct_saturday_start = "$rowx[17]"; - $Gct_saturday_stop = "$rowx[18]"; - $Gct_state_call_times = "$rowx[19]"; - - $ct_states = ''; - $ct_state_gmt_SQL = ''; - $ct_srs=0; - $b=0; - if (strlen($Gct_state_call_times)>2) - { - $state_rules = explode('|',$Gct_state_call_times); - $ct_srs = ((count($state_rules)) - 2); - } - while($ct_srs >= $b) - { - if (strlen($state_rules[$b])>1) - { - $stmt="SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $Gstate_call_time_id = "$row[0]"; - $Gstate_call_time_state = "$row[1]"; - $Gsct_default_start = "$row[4]"; - $Gsct_default_stop = "$row[5]"; - $Gsct_sunday_start = "$row[6]"; - $Gsct_sunday_stop = "$row[7]"; - $Gsct_monday_start = "$row[8]"; - $Gsct_monday_stop = "$row[9]"; - $Gsct_tuesday_start = "$row[10]"; - $Gsct_tuesday_stop = "$row[11]"; - $Gsct_wednesday_start = "$row[12]"; - $Gsct_wednesday_stop = "$row[13]"; - $Gsct_thursday_start = "$row[14]"; - $Gsct_thursday_stop = "$row[15]"; - $Gsct_friday_start = "$row[16]"; - $Gsct_friday_stop = "$row[17]"; - $Gsct_saturday_start = "$row[18]"; - $Gsct_saturday_stop = "$row[19]"; - - $ct_states .="'$Gstate_call_time_state',"; - - $r=0; - $state_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday local time - { - if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday local time - { - if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday local time - { - if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday local time - { - if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday local time - { - if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday local time - { - if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday local time - { - if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) - {$state_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - $state_gmt = "$state_gmt'99'"; - $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; - } - - $b++; - } - if (strlen($ct_states)>2) - { - $ct_states = eregi_replace(",$",'',$ct_states); - $ct_statesSQL = "and state NOT IN($ct_states)"; - } - else - { - $ct_statesSQL = ""; - } - - $r=0; - $default_gmt=''; - while($r < $g) - { - if ($GMT_day[$r]==0) #### Sunday local time - { - if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==1) #### Monday local time - { - if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==2) #### Tuesday local time - { - if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==3) #### Wednesday local time - { - if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==4) #### Thursday local time - { - if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==5) #### Friday local time - { - if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - if ($GMT_day[$r]==6) #### Saturday local time - { - if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) - { - if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - else - { - if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) - {$default_gmt.="'$GMT_gmt[$r]',";} - } - } - $r++; - } - - $default_gmt = "$default_gmt'99'"; - $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; - - $stmt="SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a','$dial_status_b','$dial_status_c','$dial_status_d','$dial_status_e') and list_id IN($camp_lists) and ($all_gmtSQL) $fSQL"; - #$DB=1; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $rslt_rows = mysql_num_rows($rslt); - if ($rslt_rows) - { - $rowx=mysql_fetch_row($rslt); - $active_leads = "$rowx[0]"; - } - else {$active_leads = '0';} - - echo "This campaign has $active_leads leads to be dialed in those lists\n"; - } - else - { - echo "no active lists selected for this campaign\n"; - } - } -else - { - echo "no active lists selected for this campaign\n"; - } -##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### -} -?> diff --git a/VICIDIAL_web/admin_modify_lead.php b/VICIDIAL_web/admin_modify_lead.php deleted file mode 100644 index 9dad4f62..00000000 --- a/VICIDIAL_web/admin_modify_lead.php +++ /dev/null @@ -1,476 +0,0 @@ - LICENSE: GPLv2 -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} - elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} -if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} - elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} -if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} - elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} - elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - -### AST GUI database administration modify lead in vicidial_list -### admin_modify_lead.php - -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead - -# CHANGES -# -# 60419-1705 - Added ability to change lead callback record from USERONLY to ANYONE or USERONLY-user -# 60421-1459 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60609-1112 - Added DNC list addition if status changed to DNC -# 60619-1539 - Added variable filtering to eliminate SQL injection attack threat -# - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Lead record modification - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "information modified

\n"; - echo "\n"; - - if ( ($dispo != $status) and ($dispo == 'CBHOLD') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - - if ( ($dispo != $status) and ($status == 'DNC') ) - { - ### add lead to the internal DNC list - $stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; - } - -} -else -{ - - if ($CBchangeUSERtoANY == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to ANYONE
\n"; - } - if ($CBchangeUSERtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record user changed to $CBuser
\n"; - } - if ($CBchangeANYtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; - } - - - - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Call information: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Lead ID: $lead_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select * from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

\n"; - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - else - { - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UserID: \n"; - echo "

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } - - - - - - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - -echo "

\n"; - -echo "
\n"; - -echo "CALLS TO THIS LEAD:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD
$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/VICIDIAL_web/admin_search_lead.php b/VICIDIAL_web/admin_search_lead.php deleted file mode 100644 index a727e3a1..00000000 --- a/VICIDIAL_web/admin_search_lead.php +++ /dev/null @@ -1,224 +0,0 @@ - LICENSE: GPLv2 -### -### AST GUI database administration search for lead info -### admin_modify_lead.php -# -# this is the administration lead information modifier screen, the administrator just needs to enter the leadID and then they can view and modify the information in the record for that lead -# -# changes: -# 60620-1055 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - Changed results to multi-record -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Lead Search - -Lead Lookup - - - -
\n"; - echo "
\n"; - echo "\n"; - echo "Please enter a:
Vendor ID(vendor lead code): or \n"; - echo "
a Home Phone Number: or\n"; - echo "
a lead ID:

\n"; - echo "
\n"; - echo "\n
\n"; - echo "\n"; - exit; - } - -else - { - - if ($vendor_id) - { - $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000"; - } - else - { - if ($phone) - { - $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000"; - } - else - { - if ($lead_id) - { - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000"; - } - else - { - print "ERROR: you must search for something! Go back and search for something"; - exit; - } - } - } - if ($DB) - { - echo "\n\n$stmt\n\n"; - } - - $rslt=mysql_query($stmt, $link); - $results_to_print = mysql_num_rows($rslt); - if ($results_to_print < 1) - { - echo date("l F j, Y G:i:s A"); - echo "\n

\n"; - echo "The search variables you entered are not active in the system

\n"; - echo "Please go back and double check the information you entered and submit again\n"; - echo "
\n"; - echo "\n"; - exit; - } - else - { - echo "RESULTS: $results_to_print

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $o=0; - while ($results_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $o++; - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "
#LEAD IDSTATUSVENDOR IDLAST AGENTLIST IDPHONENAMECITYSECURITYLAST CALL
$o$row[0]$row[3]$row[5]$row[4]$row[7]$row[11]$row[13] $row[15]$row[19]$row[28]$row[2]
\n"; - } - } - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\nNEW SEARCH"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; - - -?> - - - - - diff --git a/VICIDIAL_web/closer-fronter_popup.php b/VICIDIAL_web/closer-fronter_popup.php deleted file mode 100644 index 84d31c97..00000000 --- a/VICIDIAL_web/closer-fronter_popup.php +++ /dev/null @@ -1,515 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. -# CHANGES -# -# 60620-1020 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -#$DB = '1'; # DEBUG override -$US = '_'; -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$REC_TIME = date("Ymd-His"); -$FILE_datetime = $STARTtime; -$parked_time = $STARTtime; - -# $ext_context = 'default'; defined in dbconnect file - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - if ( (strlen($customer_zap_channel)>2) and (eregi('zap',$customer_zap_channel)) ) - { - echo "\n\n"; - echo "\n\n"; - - } - else - { - echo "Bad channel: $customer_zap_channel\n"; - echo "Make sure the Zap channel is live and try again\n"; - exit; - } - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL FRONTER-CLOSER: Popup\n"; -echo "\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - -# $stmt="DELETE from parked_channels where server_ip='$server_ip' and parked_time='$parked_time' and channel='$channel' LIMIT 1"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RZ$FILE_datetime$user"; - - ### insert a NEW record to the vicidial_manager table to be processed - - $channel = $customer_zap_channel; - $channel = eregi_replace('Zap/', "", $channel); - $SIPexten = eregi_replace('SIP/', "", $SIPexten); - $filename = "$REC_TIME$US$SIPexten"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - # Local/78600098@demo-6617,2 - - $stmt = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Originate','$DTqueryCID','Channel: $local_DEF$conf_silent_prefix" . mysql_real_escape_string($session_id) . "$local_AMP$ext_context','Context: $ext_context','Exten: $recording_exten','Priority: 1','Callerid: " . mysql_real_escape_string($filename) . "','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('Zap/" . mysql_real_escape_string($channel) . "','" . mysql_real_escape_string($server_ip) . "','SIP/" . mysql_real_escape_string($SIPexten) . "','$NOW_TIME','$STARTtime','" . mysql_real_escape_string($filename) . "')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='" . mysql_real_escape_string($filename) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - - echo "Recording command sent for channel $channel - $filename - $recording_id       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $user - $full_name\n

\n"; - - $url = "http://10.10.99.2/vicidial/closer_dispo.php?lead_id=$lead_id&channel=$channel&server_ip=$server_ip&extension=$SIPexten&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - -# $stmt="UPDATE park_log set grab_time='$NOW_TIME',status='TALKING',extension='$extension',user='$user' where parked_time='$parked_time' and server_ip='$server_ip' and channel='$channel'"; -# if ($DB) {echo "|$stmt|\n";} -# $fp = fopen ("./closer_SQL_updates.txt", "a"); -# fwrite ($fp, "$date|$user|$stmt|\n"); -# fclose($fp); -# $rslt=mysql_query($stmt, $link); - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### -if (eregi('CL_TEST',$channel_group)) - { - echo "GALLERIA TEST CLOSER GROUP: $channel_group\n"; - - $stmt="SELECT user,phone_number from vicidial_list where lead_id='" . mysql_real_escape_string($parked_by) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $fronter=$row[0]; - $search_phone=$row[1]; - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -- INTERNAL CALL GALLERIA FRONT --
\n"; - $group_color='#99FF99'; - } - if (eregi('CL_GALLER2',$channel_group)) - { - echo "
-- TouchAsia CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER3',$channel_group)) - { - echo "
-- DebitSupplies CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER4',$channel_group)) - { - echo "
-- Vishnu CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Record command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Please go back and try again\n

\n"; -# echo "
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/VICIDIAL_web/closer-fronter_popup2.php b/VICIDIAL_web/closer-fronter_popup2.php deleted file mode 100644 index 2ecd56d1..00000000 --- a/VICIDIAL_web/closer-fronter_popup2.php +++ /dev/null @@ -1,430 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. -# CHANGES -# -# 60620-1025 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -#$DB = '1'; # DEBUG override -$US = '_'; -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$REC_TIME = date("Ymd-His"); -$FILE_datetime = $STARTtime; -$parked_time = $STARTtime; - -# $ext_context = 'default'; defined in dbconnect file -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if (!$auth) - { - if ( (strlen($PHP_AUTH_USER)>1) and ( (eregi("tsr",$PHP_AUTH_PW)) or (eregi("sales",$PHP_AUTH_PW)) ) ) - { - $auth=1; - $user = $PHP_AUTH_USER; - $pass = $PHP_AUTH_PW; - } - } - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER - $user - $PHP_AUTH_USER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - if ( (strlen($customer_zap_channel)>2) and ( (eregi('zap',$customer_zap_channel)) or (eregi('iax',$customer_zap_channel)) ) ) - { - echo "\n\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - } - else - { - echo "Bad channel: $customer_zap_channel\n"; - echo "Make sure the Zap channel is live and try again\n"; - exit; - } - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL FRONTER-CLOSER: Popup\n"; -echo "\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - -# $stmt="DELETE from parked_channels where server_ip='$server_ip' and parked_time='$parked_time' and channel='$channel' LIMIT 1"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RZ$FILE_datetime$user"; - - ### insert a NEW record to the vicidial_manager table to be processed - - $channel = $customer_zap_channel; -# $channel = eregi_replace('Zap/', "", $channel); - $SIPexten = eregi_replace('SIP/', "", $SIPexten); - $filename = "$REC_TIME$US$SIPexten"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - - # Local/78600098@demo-6617,2 - - $stmt = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Originate','$DTqueryCID','Channel: $local_DEF$conf_silent_prefix" . mysql_real_escape_string($session_id) . "$local_AMP$ext_context','Context: $ext_context','Exten: $recording_exten','Priority: 1','Callerid: " . mysql_real_escape_string($filename) . "','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','" . mysql_real_escape_string($server_ip) . "','SIP/" . mysql_real_escape_string($SIPexten) . "','$NOW_TIME','$STARTtime','" . mysql_real_escape_string($filename) . "')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='" . mysql_real_escape_string($filename) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - - echo "Recording command sent for channel $channel - $filename - $recording_id       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($fronter) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $fronter - $full_name\n

\n"; - - $url = "http://10.10.10.196/vicidial/closer_dispo.php?lead_id=$lead_id&channel=$channel&server_ip=$server_ip&extension=$SIPexten&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - $stmt="SELECT group_name,group_color from vicidial_inbound_groups where group_id='" . mysql_real_escape_string($channel_group) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $group_name = $row[0]; - $group_color = $row[1]; - - echo "
\n"; - echo "
$channel_group - $group_name

\n\n"; - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### - -if (eregi('CL',$channel_group)) - { - if (strlen($phone) > 9) {$search_phone = $phone;} - if ( (strlen($search_phone) < 10) or (strlen($fronter) < 1) ) - { - echo "\n"; - $stmt="SELECT user,phone_number from vicidial_list where lead_id='$parked_by';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($fronter) < 1) {$fronter=$row[0];} - if (strlen($search_phone) < 10) {$search_phone=$row[1];} - } - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Record command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Please go back and try again\n

\n"; -# echo "
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/VICIDIAL_web/closer.php b/VICIDIAL_web/closer.php deleted file mode 100644 index 59599edb..00000000 --- a/VICIDIAL_web/closer.php +++ /dev/null @@ -1,353 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) -# CHANGES -# -# 60620-1032 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["group_selected"])) {$group_selected=$_GET["group_selected"];} - elseif (isset($_POST["group_selected"])) {$group_selected=$_POST["group_selected"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["groupselect"])) {$groupselect=$_GET["groupselect"];} - elseif (isset($_POST["groupselect"])) {$groupselect=$_POST["groupselect"];} -if (isset($_GET["PHONE_LOGIN"])) {$PHONE_LOGIN=$_GET["PHONE_LOGIN"];} - elseif (isset($_POST["PHONE_LOGIN"])) {$PHONE_LOGIN=$_POST["PHONE_LOGIN"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["debugvars"])) {$debugvars=$_GET["debugvars"];} - elseif (isset($_POST["debugvars"])) {$debugvars=$_POST["debugvars"];} -if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} - elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './closer_popup.php'; - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - -$color_class[0] = 'green'; -$color_class[1] = 'red'; -$color_class[2] = 'blue'; -$color_class[3] = 'purple'; -$color_class[4] = 'orange'; -$color_class[5] = 'green'; -$color_class[6] = 'red'; -$color_class[7] = 'blue'; -$color_class[8] = 'purple'; -$color_class[9] = 'orange'; -?> - - - - - -VICIDIAL CLOSER: Main - - -
- - 0) - { - $stmt="SELECT dialplan_number,server_ip from phones where extension='" . mysql_real_escape_string($extension) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dialplan_number=$row[0]; - $server_ip=$row[1]; - - if (!$group_selected) - { - $stmt="select distinct channel_group from park_log;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $groups_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - echo "
Please select the groups you want to pick calls up from:
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Inbound Call Groups:
\n"; - $o=0; - while ($groups_to_print > $o) - { - $group_form_print = sprintf("%-20s", $groups[$o]); - echo "$group_form_print
\n"; - $o++; - } - echo "
\n"; - echo "\n"; - echo "


\n"; - } - else - { - $o=0; - while($o < $group_selected) - { - $form_groups = "$form_groups&groupselect[$o]=$groupselect[$o]"; - $o++; - } - - $stmt="INSERT INTO vicidial_user_log values('','" . mysql_real_escape_string($user) . "','LOGIN','CLOSER','$NOW_TIME','$STARTtime');"; - $rslt=mysql_query($stmt, $link); - - echo "\n"; - echo"\n"; - - echo "extension found, forwarding you to closer page, please wait 3 seconds...
\n"; - } - - } - else - { - echo "The extension you entered does not exist, please try again
\n"; - echo "
Please enter your phone_ID: \n"; - echo "\n"; - echo "phone station ID:   \n"; - echo "\n"; - echo "


\n"; - } - - } - else - { - echo "
Please enter your phone_ID: \n"; - echo "\n"; - echo "phone station ID:   \n"; - echo "\n"; - echo "


\n"; - } - -exit; - -} - -$o=0; -while($o < $group_selected) -{ - $listen_groups = "$listen_groups     $groupselect[$o]"; - $form_groups = "$form_groups&groupselect[$o]=$groupselect[$o]"; - $o++; -} - - -echo "\n"; -echo"\n"; - -#CHANNEL SERVER CHANNEL_GROUP EXTENSION PARKED_BY PARKED_TIME -#---------------------------------------------------------------------------------------------- -#Zap/73-1 10.10.11.11 IN_800_TPP_CS TPPpark 7275338730 2004-04-22 12:41:00 - - - -echo "$NOW_TIME           $PHP_AUTH_USER - $fullname - CALLS SENT TO: $dialplan_number

\n"; - -echo "Click on the channel below that you would like to have directed to your phone
\n"; - -echo "
\n";
-echo "CHANNEL    SERVER        CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME         \n";
-echo "---------------------------------------------------------------------------------------------- \n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='" . mysql_real_escape_string($server_ip) . "'";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='" . mysql_real_escape_string($server_ip) . "' and channel_group LIKE \"CL_%\" order by channel_group,parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$park_extension =	sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		$G='';   $EG='';
-		$o=0;
-		$with_color=0;
-		while($o < $group_selected)
-			{
-				if (eregi("$groupselect[$o]",$channel_group))
-					{
-					$G=""; $EG='';
-					$with_color++;
-					}
-				$o++;
-			}
-		if ($with_color)
-			{
-			if (eregi('CL_GAL',$row[2]))
-				{
-				echo "$G$channel$server$channel_group$park_extension                     $parked_time $EG\n";
-				}
-			else
-				{
-				echo "$G$channel$server$channel_group$park_extension$parked_by$parked_time $EG\n";
-				}
-			}
-#	
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "********************************************************************************************** \n";
-	echo "********************************************************************************************** \n";
-	echo "*************************************** NO PARKED CALLS ************************************** \n";
-	echo "********************************************************************************************** \n";
-	echo "********************************************************************************************** \n";
-	}
-
-echo "  \n\n";
-echo "looking for calls on these groups:\n";
-$o=0;
-while($o < $group_selected)
-{
-	$group_print =		sprintf("%-20s", $groupselect[$o]);
-	echo "             - $group_print\n";
-	$o++;
-}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/VICIDIAL_web/closer_dispo.php b/VICIDIAL_web/closer_dispo.php deleted file mode 100644 index 54e61219..00000000 --- a/VICIDIAL_web/closer_dispo.php +++ /dev/null @@ -1,329 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer disposition screen of a call that has been grabbed. This allows the closer to modify customer information and disposition the call -# CHANGES -# -# 60619-1641 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -VICIDIAL CLOSER: Call Disposition -\n"; -?> - - -
- - 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="INSERT INTO vicidial_closer_log (lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed) values('" . mysql_real_escape_string($lead_id) . "','" . mysql_real_escape_string($list_id) . "','" . mysql_real_escape_string($campaign_id) . "','" . mysql_real_escape_string($parked_time) . "','" . mysql_real_escape_string($call_began) . "','$STARTtime','" . mysql_real_escape_string($call_length) . "','" . mysql_real_escape_string($status) . "','" . mysql_real_escape_string($phone_code) . "','" . mysql_real_escape_string($phone_number) . "','$PHP_AUTH_USER','" . mysql_real_escape_string($comments) . "','Y')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from live_channels where server_ip='$server_ip' and channel='" . mysql_real_escape_string($channel) . "' and extension like \"%" . mysql_real_escape_string($extension) . "%\""; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $parked_count = $row[0]; - - if ($parked_count > 0) - { - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Hangup','$DTqueryCID','Channel: " . mysql_real_escape_string($channel) . "','','','','','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Hangup command sent for channel $channel       $NOW_TIME\n

\n"; - - echo "\n"; - } - else - { - echo "Hangup command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "
\n"; - } -} -else -{ - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Call information: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Campaign ID: $campaign_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/VICIDIAL_web/closer_popup.php b/VICIDIAL_web/closer_popup.php deleted file mode 100644 index e12f02c3..00000000 --- a/VICIDIAL_web/closer_popup.php +++ /dev/null @@ -1,453 +0,0 @@ - LICENSE: GPLv2 -### -# this is the closer popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. -# CHANGES -# -# 60620-1029 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["group_selected"])) {$group_selected=$_GET["group_selected"];} - elseif (isset($_POST["group_selected"])) {$group_selected=$_POST["group_selected"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["groupselect"])) {$groupselect=$_GET["groupselect"];} - elseif (isset($_POST["groupselect"])) {$groupselect=$_POST["groupselect"];} -if (isset($_GET["PHONE_LOGIN"])) {$PHONE_LOGIN=$_GET["PHONE_LOGIN"];} - elseif (isset($_POST["PHONE_LOGIN"])) {$PHONE_LOGIN=$_POST["PHONE_LOGIN"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["debugvars"])) {$debugvars=$_GET["debugvars"];} - elseif (isset($_POST["debugvars"])) {$debugvars=$_POST["debugvars"];} -if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} - elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -#$DB=1; -$US = '_'; -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$REC_TIME = date("Ymd-His"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "VICIDIAL CLOSER: Popup\n"; -echo "\n"; - -if (eregi('CL_UNIV',$channel_group)) - { - ?> - - \n"; - echo "function WaitFirefix() {setTimeout(document.forms[0].search_phone.focus(), 1000)}\n"; - echo "\n"; - } -?> - - -
- - 0) -{ - $stmt="DELETE from parked_channels where server_ip='" . mysql_real_escape_string($server_ip) . "' and parked_time='" . mysql_real_escape_string($parked_time) . "' and channel='" . mysql_real_escape_string($channel) . "' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - - #$monitor_channel = eregi_replace('Zap/', "", $channel); - $monitor_channel = eregi_replace('-1', "", $channel); - $SIPexten = $extension; - $filename = "$REC_TIME$US$SIPexten"; - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - -# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: $monitor_channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - -# $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$monitor_channel','$server_ip','SIP/$SIPexten','$NOW_TIME','$STARTtime','$filename')"; -# if ($DB) {echo "|$stmt|\n";} -# $rslt=mysql_query($stmt, $link); - -# $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; -# $rslt=mysql_query($stmt, $link); -# if ($DB) {echo "$stmt\n";} -# $row=mysql_fetch_row($rslt); -# $recording_id = $row[0]; - -# echo "Recording command sent for channel $channel - $filename - $recording_id
\n"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: " . mysql_real_escape_string($channel) . "','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for channel $channel       $NOW_TIME\n

\n"; - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($parked_by) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - echo "Call Referred by: $parked_by - $full_name\n

\n"; - - $url = "http://10.10.10.196/vicidial/closer_dispo.php?lead_id=$parked_by&channel=$channel&server_ip=$server_ip&extension=$extension&call_began=$STARTtime&parked_time=$parked_time&DB=$DB"; - - echo "View Customer Info and Disposition Call\n

\n"; - - - - $stmt="UPDATE park_log set grab_time='$NOW_TIME',status='TALKING',extension='" . mysql_real_escape_string($extension) . "',user='$PHP_AUTH_USER' where parked_time='" . mysql_real_escape_string($parked_time) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and channel='" . mysql_real_escape_string($channel) . "'"; - if ($DB) {echo "|$stmt|\n";} - $fp = fopen ("./closer_SQL_updates.txt", "a"); - fwrite ($fp, "$date|$PHP_AUTH_USER|$stmt|\n"); - fclose($fp); - - - $rslt=mysql_query($stmt, $link); - -########################################################################################### -####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX -########################################################################################### -if (eregi('CL_TEST',$channel_group)) - { - echo "GALLERIA TEST CLOSER GROUP: $channel_group\n"; - - $stmt="SELECT user,phone_number from vicidial_list where lead_id='" . mysql_real_escape_string($parked_by) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $fronter=$row[0]; - $search_phone=$row[1]; - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- -- INTERNAL CALL GALLERIA FRONT --
\n"; - $group_color='#99FF99'; - } - if (eregi('CL_GALLER2',$channel_group)) - { - echo "
-- TouchAsia CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER3',$channel_group)) - { - echo "
-- DebitSupplies CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - if (eregi('CL_GALLER4',$channel_group)) - { - echo "
-- Vishnu CALL Simple Escapes FRONT --
\n"; - $group_color='#FF9999'; - } - - - ?> -
- - - - - - - - - - - - - - - -
COF MW Customer Search
Phone number
-
-

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
New Search
Reservation Number:
Confirmation #:
Phone #:


Back
- -
- - - Close this window\n

\n"; -} -else -{ - echo "Redirect command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/VICIDIAL_web/count.htm b/VICIDIAL_web/count.htm deleted file mode 100644 index 51f8a361..00000000 --- a/VICIDIAL_web/count.htm +++ /dev/null @@ -1 +0,0 @@ - diff --git a/VICIDIAL_web/dbconnect.php b/VICIDIAL_web/dbconnect.php deleted file mode 100644 index 88078fc7..00000000 --- a/VICIDIAL_web/dbconnect.php +++ /dev/null @@ -1,20 +0,0 @@ - LICENSE: GPLv2 -# - -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); - -$local_DEF = 'Local/'; -$conf_silent_prefix = '7'; -$local_AMP = '@'; -$ext_context = 'demo'; -$recording_exten = '8309'; - -#$WeBServeRRooT = '/home/www/htdocs'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -$WeBRooTWritablE = '1'; - -?> \ No newline at end of file diff --git a/VICIDIAL_web/group_hourly_stats.php b/VICIDIAL_web/group_hourly_stats.php deleted file mode 100644 index b7eb1b31..00000000 --- a/VICIDIAL_web/group_hourly_stats.php +++ /dev/null @@ -1,252 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1014 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];} - elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$date_with_hour_default = date("Y-m-d H"); -$date_no_hour_default = $TODAY; - -if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} - $date_no_hour = $date_with_hour; - $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - -# $stmt="SELECT full_name from vicidial_users where user='$user';"; -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: Group Hourly Stats -\n"; -?> - - -
- - - - - -= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDtotal[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDday[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDcount[$o] = "$row[0]"; - $o++; - } - -echo "
  VICIDIAL ADMIN: Group Hourly Stats  
\n"; - -echo "
\n"; - -echo "TSR HOUR COUNTS: $group | $status | $date_with_hour | $date_no_hour\n"; - -echo "
\n"; -echo "\n"; - - $day_calls=0; - $hour_calls=0; - $total_calls=0; - $o=0; - while($o < $tsrs_to_print) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $VDtotal[$o]); - $hour_calls = ($hour_calls + $VDcount[$o]); - $day_calls = ($day_calls + $VDday[$o]); - - $o++; - } - -echo "\n"; - - -} - -echo "
TSR ID   $status   TOTAL CALLS   $status DAY    
$VDuser[$o] $VDname[$o] $VDcount[$o] $VDtotal[$o] $VDday[$o]MODIFY | STATS
TOTAL $status $hour_calls $total_calls $day_calls
\n"; -echo "

\n"; - - - echo "
Please enter the group you want to get hourly stats for:
\n"; - echo "\n"; - echo "group:
\n"; - echo "status:   (example: XFER)
\n"; - echo "date with hour:   (example: 2004-06-25 14)
\n"; - echo "\n"; - echo "


\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/VICIDIAL_web/help.gif b/VICIDIAL_web/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/VICIDIAL_web/help.gif and /dev/null differ diff --git a/VICIDIAL_web/listloader.php b/VICIDIAL_web/listloader.php deleted file mode 100644 index 920505a8..00000000 --- a/VICIDIAL_web/listloader.php +++ /dev/null @@ -1,698 +0,0 @@ - LICENSE: GPLv2 -# -# AST Web GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1006 - added listID override and gmt_offset lookup while loading -# 60619-1652 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -# - -$version = '1.1.12'; -$build = '60619-1652'; - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];} -$list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - - -#$DB=1; -#$DBX=1; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$list_id_override = ereg_replace("[^0-9]","",$list_id_override); - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('listloader.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"HELP\""; - - -$secX = date("U"); -$hour = date("H"); -$min = date("i"); -$sec = date("s"); -$mon = date("m"); -$mday = date("d"); -$year = date("Y"); -$isdst = date("I"); -$Shour = date("H"); -$Smin = date("i"); -$Ssec = date("s"); -$Smon = date("m"); -$Smday = date("d"); -$Syear = date("Y"); -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - ### Grab Server GMT value from the database - $stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $rslt=mysql_query($stmt, $link); - $gmt_recs = mysql_num_rows($rslt); - if ($gmt_recs > 0) - { - $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; - if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} - if ($isdst) {$SERVER_GMT++;} - } - else - { - $SERVER_GMT = date("O"); - $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT); - $SERVER_GMT = ($SERVER_GMT + 0); - $SERVER_GMT = ($SERVER_GMT / 100); - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; - - -?> - - - - - - method=post enctype="multipart/form-data"> -
- - - - - - - - - - - - - -
Load leads from this file:
List ID Override: (numbers only or leave blank for values in the file)
CLICK HERE TO GO TO THE SUPER LEAD LOADER (BETA VERSION)     BACK TO ADMIN
- -document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - $pulldate=date("Y-m-d H:i:s"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("./vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city = $row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) - { - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $gmt_offset = '0'; - $called_since_last_reset='N'; - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =='1') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### MEXICO ### - if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### AUSTRALIA ### - if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - - if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - print ""; -} else if (filesize($leadfile)>8388608) { - print "
ERROR: File exceeds the 8MB limit.
"; -} -?> - - diff --git a/VICIDIAL_web/listloader.pl b/VICIDIAL_web/listloader.pl deleted file mode 100644 index 753c31f7..00000000 --- a/VICIDIAL_web/listloader.pl +++ /dev/null @@ -1,690 +0,0 @@ -#!/usr/bin/perl - -### listloader.pl -### -### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 -### -# -# -# CHANGES -# 60616-1548 - Added listID override feature to force all leads into same list -# - Added gmt_offset_now lookup for each lead -# - -### begin parsing run-time options ### -if (length($ARGV[0])>1) -{ - $i=0; - while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } - - if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - } - else - { - if ($args =~ /--forcelistid=/i) - { - @data_in = split(/--forcelistid=/,$args); - $forcelistid = $data_in[1]; - print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; - } - else - {$forcelistid = '';} - } -} -### end parsing run-time options ### - - -use Spreadsheet::ParseExcel; -use Time::Local; -use Net::MySQL; - -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file - -if (!$DB_port) {$DB_port='3306';} - -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; - - -$|=0; -$secX = time(); - -($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); -$year = ($year + 1900); -$mon++; -if ($hour < 10) {$hour = "0$hour";} -if ($min < 10) {$min = "0$min";} -if ($sec < 10) {$sec = "0$sec";} -if ($mon < 10) {$mon = "0$mon";} -if ($mday < 10) {$mday = "0$mday";} -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$pulldate="$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - - ### Grab Server values from the database - $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $dbhA->query("$stmtA"); - if ($dbhA->has_selected_record) - { - $iter=$dbhA->create_record_iterator; - while ( $record = $iter->each) - { - $DBSERVER_GMT = "$record->[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} - } - } - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -if ($isdst) {$LOCAL_GMT_OFF++;} -if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - - -$total=0; $good=0; $bad=0; -print "
Processing Excel file...\n"; -open(STMT_FILE, "> listloader_stmts.txt"); - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); -my($iR, $iC, $oWkS, $oWkC); - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { - - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $oWkC = $oWkS->{Cells}[$iR][0]; - if ($oWkC) {$vendor_lead_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][1]; - if ($oWkC) {$source_code=$oWkC->Value; } - $source_id=$source_code; - $oWkC = $oWkS->{Cells}[$iR][2]; - if ($oWkC) {$list_id=$oWkC->Value; } - $gmt_offset = '0'; - $called_since_last_reset='N'; - $oWkC = $oWkS->{Cells}[$iR][3]; - if ($oWkC) {$phone_code=$oWkC->Value; } - $phone_code=~s/[^0-9]//g; - $oWkC = $oWkS->{Cells}[$iR][4]; - if ($oWkC) {$phone_number=$oWkC->Value; } - $phone_number=~s/[^0-9]//g; - $USarea = substr($phone_number, 0, 3); - $oWkC = $oWkS->{Cells}[$iR][5]; - if ($oWkC) {$title=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][6]; - if ($oWkC) {$first_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][7]; - if ($oWkC) {$middle_initial=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][8]; - if ($oWkC) {$last_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][9]; - if ($oWkC) {$address1=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][10]; - if ($oWkC) {$address2=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][11]; - if ($oWkC) {$address3=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][12]; - if ($oWkC) {$city=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][13]; - if ($oWkC) {$state=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][14]; - if ($oWkC) {$province=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][15]; - if ($oWkC) {$postal_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][16]; - if ($oWkC) {$country=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][17]; - if ($oWkC) {$gender=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][18]; - if ($oWkC) {$date_of_birth=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][19]; - if ($oWkC) {$alt_phone=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][20]; - if ($oWkC) {$email=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][21]; - if ($oWkC) {$security_phrase=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][22]; - if ($oWkC) {$comments=$oWkC->Value; } - $comments=~s/^\s*(.*?)\s*$/$1/; - - if (length($phone_number)>8) { - if (length($forcelistid) > 0) - { - $list_id = $forcelistid; # set list_id to override value - } - - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### MEXICO ### - if ($phone_code =~ /^52$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### AUSTRALIA ### - if ($phone_code =~ /^61$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $dbhA->query($stmtA); - $rec_countW=0; - if ($dbhA->has_selected_record) - { - $iterA=$dbhA->create_record_iterator; - while ($recordA = $iterA->each) - { - $gmt_offset = $recordA->[4]; $gmt_offset =~ s/\+| //gi; - $dst = $recordA->[5]; - $dst_range = $recordA->[6]; - $PC_processed++; - } - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); - $year = ($year + 1900); - $mon++; - if ($mon < 10) {$mon = "0$mon";} - if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$hour = "0$hour";} - if ($min < 10) {$min = "0$min";} - if ($sec < 10) {$sec = "0$sec";} - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - &USA_dstcalc; - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - &GBR_dstcalc; - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - &AUS_dstcalc; - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - &AUST_dstcalc; - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - &NZL_dstcalc; - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $dbhA->query("$stmtZ"); - print STMT_FILE $stmtZ."\r\n"; - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - sleep(1); -# flush(); - } - } -} - -if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; - $dbhA->query("$stmtZ"); - print STMT_FILE $stmtZ."\r\n"; -} - -print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - -exit; - - - - - - -sub USA_dstcalc { -#********************************************************************** -# FSA-LSO -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in April and last Sunday in October at 2 am. -# INPUTS: -# mm INTEGER Month. -# dd INTEGER Day of the month. -# ns INTEGER Seconds into the day. -# dow INTEGER Day of week (0=Sunday, to 6=Saturday) -# OPTIONAL INPUT: -# timezone INTEGER hour difference UTC - local standard time -# (DEFAULT is blank) -# make calculations based on UTC time, -# which means shift at 10:00 UTC in April -# and 9:00 UTC in October -# OUTPUT: -# INTEGER 1 = DST, 0 = not DST -#********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; return 0; - } elsif ($mm >= 5 && $mm <= 9) { - $USA_DST=1; return 1; - } elsif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $USA_DST=0; return 0; - } else { - $USA_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 7200) { - $USA_DST=0; return 0; - } else { - $USA_DST=1; return 1; - } - } - } else { - $USA_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $USA_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; return 1; - } else { - $USA_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; return 1; - } else { - $USA_DST=0; return 0; - } - } - } else { - $USA_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub GBR_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in March and last Sunday in October at 1 am. -#********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; return 0; - } elsif ($mm >= 4 && $mm <= 9) { - $GBR_DST=1; return 1; - } elsif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $GBR_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } - } else { - $GBR_DST=1; return 1; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $GBR_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } - } else { - $GBR_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub AUS_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUS_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUS_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } - } else { - $AUS_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $AUS_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } - } else { - $AUS_DST=1; return 1; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub AUST_dstcalc { -#********************************************************************** -# TASMANIA ONLY -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUST_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUST_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } - } else { - $AUST_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } - } else { - $AUST_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub NZL_dstcalc { -#********************************************************************** -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and third Sunday in March at 1 am. -#********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $NZL_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; return 1; - } elsif ($dd < ($dow+14)) { - $NZL_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } - } else { - $NZL_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } - } else { - $NZL_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc diff --git a/VICIDIAL_web/listloaderMAIN.php b/VICIDIAL_web/listloaderMAIN.php deleted file mode 100644 index 67ee25bc..00000000 --- a/VICIDIAL_web/listloaderMAIN.php +++ /dev/null @@ -1,79 +0,0 @@ - LICENSE: GPLv2 -# -# this is the main frame page for the lead loading section. This is where you -# would upload a file and have it inserted into vicidial_list -# -# changes: -# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - -VICIDIAL: Lead Loader Module - - - - - \ No newline at end of file diff --git a/VICIDIAL_web/listloader_rowdisplay.pl b/VICIDIAL_web/listloader_rowdisplay.pl deleted file mode 100644 index fc2b4fc7..00000000 --- a/VICIDIAL_web/listloader_rowdisplay.pl +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/perl - -### listloader_rowdisplay.pl -### -### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 -### - -use Spreadsheet::ParseExcel; -use Time::Local; -use Net::MySQL; - -### Make sure this file is in a libs path or put the absolute path to it -require("/home/cron/AST_SERVER_conf.pl"); # local configuration file - -if (!$DB_port) {$DB_port='3306';} - -$dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") - or die "Couldn't connect to database: $DB_server - $DB_database\n"; - - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("./vicidial_temp_file.xls"); -my($iR, $iC, $oWkS, $oWkC); -$var_str=""; - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) { - $oWkC = $oWkS->{Cells}[0][$iC]; - if ($oWkC) { - $var_str.=$oWkC->Value."|"; - } else { - $var_str.="|"; - } - } -} - -@xls_row=split(/\|/, $var_str); - - -$dbhA->query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1"); - -if ($dbhA->has_selected_record) { - $rslt = $dbhA->create_record_iterator(); - my @row = $rslt->get_field_names(); - for ($i=0; $i\r\n"; - print "
".$field_name.": \r\n"; - print " \r\n"; - print "
- - - - - - - - - - - - - - - - - -
Load leads from this file:
List ID Override: (numbers only or leave blank for values in the file)
File layout to use:Standard VICIDIAL    Custom layout
        
CLICK HERE TO GO TO THE BASIC LEAD LOADER         BACK TO ADMIN
SUPER LIST LOADER-     VERSION:     BUILD:
- - -document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - $total=0; $good=0; $bad=0; - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Processing $delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - print "
Processing Excel file... \n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

\n"; - } - # print "$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field"; - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override"); - } else { - # copy($leadfile, "./vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = $row[$alt_phone_field]; - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - } - print ""; - } - -if ($leadfile && filesize($LF_path)<=8388608) { - $total=0; $good=0; $bad=0; - if ($file_layout=="standard") { - - print ""; - flush(); - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $total=0; $good=0; $bad=0; - print "
Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n"; - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.xls", "r"); - - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = $row[19]; - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($phone_number)>8) { - - if (strlen($list_id_override)>0) - { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]|\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - usleep(1000); - flush(); - } - } - if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list values".substr($multistmt, 0, -1).";"; - mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - } - - print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - - } - print ""; - - } else { - print "
"; - flush(); - print "\r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - flush(); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.txt", "r"); - print "
Processing $delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } else if (!eregi(".csv", $leadfile_name)) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl"); - } else { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $file=fopen("$WeBServeRRooT/vicidial/vicidial_temp_file.csv", "r"); - $stmt_file=fopen("listloader_stmts.txt", "w"); - - print "
Processing CSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - } - - $total=0; $good=0; $bad=0; - $row=fgetcsv($file, 1000, ","); - for ($i=0; $i\r\n"; - print "
\r\n"; - print " \r\n"; - print " \r\n"; - - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - #print " \r\n"; - } - } - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print "
VICIDIAL ColumnFile data
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$i]
        
\r\n"; - # } - print ""; - } -} else if (filesize($leadfile)>8388608) { - print "
ERROR: File exceeds the 8MB limit.
"; -} -?> - - - - - - - - - 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### MEXICO ### -if ($phone_code =='52') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### AUSTRALIA ### -if ($phone_code =='61') - { - $stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } -### ALL OTHER COUNTRY CODES ### -if (!$PC_processed) - { - $PC_processed++; - $stmt="select * from vicidial_phone_codes where country_code='$phone_code';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset); - $dst = $row[5]; - $dst_range = $row[6]; - $PC_processed++; - } - } - -### Find out if DST to raise the gmt offset ### -$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); -$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear); - $hour = date("H",$AC_localtime); - $min = date("i",$AC_localtime); - $sec = date("s",$AC_localtime); - $mon = date("m",$AC_localtime); - $mday = date("d",$AC_localtime); - $wday = date("w",$AC_localtime); - $year = date("Y",$AC_localtime); -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - -$AC_processed=0; -if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - #********************************************************************** - # FSA-LSO - # This is returns 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in April and last Sunday in October at 2 am. - # INPUTS: - # mm INTEGER Month. - # dd INTEGER Day of the month. - # ns INTEGER Seconds into the day. - # dow INTEGER Day of week (0=Sunday, to 6=Saturday) - # OPTIONAL INPUT: - # timezone INTEGER hour difference UTC - local standard time - # (DEFAULT is blank) - # make calculations based on UTC time, - # which means shift at 10:00 UTC in April - # and 9:00 UTC in October - # OUTPUT: - # INTEGER 1 = DST, 0 = not DST - #********************************************************************** - - $USA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $USA_DST=0; - } elseif ($mm >= 5 and $mm <= 9) { - $USA_DST=1; - } elseif ($mm == 4) { - if ($dd > 7) { - $USA_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } else { - if ($dow == 0 and $ns < 7200) { - $USA_DST=0; - } else { - $USA_DST=1; - } - } - } else { - $USA_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $USA_DST=1; - } elseif ($dd < ($dow+25)) { - $USA_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } else { # local time calculations - if ($ns < 7200) { - $USA_DST=1; - } else { - $USA_DST=0; - } - } - } else { - $USA_DST=0; - } - } # end of month checks - - if ($DBX) {print " DST: $USA_DST\n";} - if ($USA_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in March and last Sunday in October at 1 am. - #********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; - } elseif ($mm >= 4 and $mm <= 9) { - $GBR_DST=1; - } elseif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; - } elseif ($dd < ($dow+25)) { - $GBR_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; - } else { - $GBR_DST=1; - } - } - } else { - $GBR_DST=1; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; - } elseif ($dd < ($dow+25)) { - $GBR_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; - } else { - $GBR_DST=0; - } - } - } else { - $GBR_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on last Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUS_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; - } elseif ($dd < ($dow+25)) { - $AUS_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; - } else { - $AUS_DST=0; - } - } - } else { - $AUS_DST=0; - } - } elseif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; - } elseif ($dd < ($dow+25)) { - $AUS_DST=0; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; - } else { - $AUS_DST=1; - } - } - } else { - $AUS_DST=1; - } - } # end of month checks - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - -if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - #********************************************************************** - # TASMANIA ONLY - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and last Sunday in March at 1 am. - #********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $AUST_DST=0; - } elseif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; - } elseif ($dd < ($dow+25)) { - $AUST_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; - } else { - $AUST_DST=0; - } - } - } else { - $AUST_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $AUST_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $AUST_DST=0; - } else { - $AUST_DST=1; - } - } - } else { - $AUST_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } -if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - #********************************************************************** - # This is s 1 if Daylight Savings Time is in effect and 0 if - # Standard time is in effect. - # Based on first Sunday in October and third Sunday in March at 1 am. - #********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; - } elseif ($mm >= 4 and $mm <= 9) { - $NZL_DST=0; - } elseif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; - } elseif ($dd < ($dow+14)) { - $NZL_DST=1; - } elseif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; - } else { - $NZL_DST=0; - } - } - } else { - $NZL_DST=0; - } - } elseif ($mm == 10) { - if ($dd > 7) { - $NZL_DST=1; - } elseif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 and $ns < (7200+$timezone*3600)) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } else { - if ($dow == 0 and $ns < 3600) { - $NZL_DST=0; - } else { - $NZL_DST=1; - } - } - } else { - $NZL_DST=0; - } - } # end of month checks - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } -if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - -return $gmt_offset; -} \ No newline at end of file diff --git a/VICIDIAL_web/record_conf_1_hour.php b/VICIDIAL_web/record_conf_1_hour.php deleted file mode 100644 index 59ae1f09..00000000 --- a/VICIDIAL_web/record_conf_1_hour.php +++ /dev/null @@ -1,156 +0,0 @@ - LICENSE: GPLv2 -### -# grab: $server_ip $station $session_id -# -# CHANGES -# -# 60620-1011 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["station"])) {$station=$_GET["station"];} - elseif (isset($_POST["station"])) {$station=$_POST["station"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["NEW_RECORDING"])) {$NEW_RECORDING=$_GET["NEW_RECORDING"];} - elseif (isset($_POST["NEW_RECORDING"])) {$NEW_RECORDING=$_POST["NEW_RECORDING"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$MYSQL_datetime = date("Y-m-d H:i:s"); -$FILE_datetime = date("Ymd-His_"); -$secX = $STARTtime; - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL RECORD CONFERENCE: 1 hour -\n"; -?> - - -
- - 8) && (strlen($session_id) > 3) && (strlen($station) > 3) ) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $conf_silent_prefix = '7'; - $ext_context = 'demo'; - - $stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','" . mysql_real_escape_string($server_ip) . "','','Originate','RB$FILE_datetime" . mysql_real_escape_string($station) . "','Channel: $local_DEF$conf_silent_prefix" . mysql_real_escape_string($session_id) . "$local_AMP$ext_context','Context: $ext_context','Exten: 8309','Priority: 1','Callerid: $FILE_datetime" . mysql_real_escape_string($station) . "','','','','','')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('" . mysql_real_escape_string($session_id) . "','" . mysql_real_escape_string($server_ip) . "','" . mysql_real_escape_string($station) . "','$MYSQL_datetime','$secX','$FILE_datetime" . mysql_real_escape_string($station) . "')"; - echo "|$stmt|\n

\n"; - $rslt=mysql_query($stmt, $link); - - echo "Recording started\n

\n"; - echo "Back to main recording screen\n

\n"; - } - else - { - echo "ERROR!!!! Not all info entered properly\n

\n"; - echo "|$server_ip| |$session_id| |$station|\n

\n"; - echo "Back to main recording screen\n

\n"; - } -} -else -{ -echo "
Start recording a conference for 1 hour:
\n"; -echo "\n"; -echo "server_ip: | \n"; -echo "session_id: | \n"; -echo "station: | \n"; -echo "\n"; -echo "


\n"; - - - -} -?> - - \ No newline at end of file diff --git a/VICIDIAL_web/remote_dispo.php b/VICIDIAL_web/remote_dispo.php deleted file mode 100644 index da249fba..00000000 --- a/VICIDIAL_web/remote_dispo.php +++ /dev/null @@ -1,327 +0,0 @@ - LICENSE: GPLv2 -### -# this is the remote agent disposition screen for calls sent to remote agents. This allows the remote agent to modify customer information and disposition the call - -# CHANGES -# -# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat -# - - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} - elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} - elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $fullname = $row[0]; - fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - } - else - { - fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -VICIDIAL REMOTE: Call Disposition -\n"; -?> - - -
- -"; - -if ($end_call > 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Call has been dispositioned       $NOW_TIME\n

\n"; - - echo "\n"; - -} -else -{ - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $campaign_id = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; # - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; # - $address1 = "$row[16]"; # - $address2 = "$row[17]"; # - $address3 = "$row[18]"; # - $city = "$row[19]"; # - $state = "$row[20]"; # - $province = "$row[21]"; # - $postal_code = "$row[22]"; # - $country_code = "$row[23]"; # - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; # - $email = "$row[27]"; # - $security = "$row[28]"; # - $comments = "$row[29]"; # - - echo "
Call information: $first_name $last_name - $phone_number

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
Vendor ID: $vendor_id     Campaign ID: $campaign_id
Fronter: $tsr     List ID: $list_id
First Name:   \n"; - echo " Last Name:
Address 1 :
Address 2 :
Address 3 :
City :
State:   \n"; - echo " Postal Code:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition:
\n"; - echo "


\n"; - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

\n"; -# echo "Close this window\n

\n"; - } - - - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/VICIDIAL_web/server_stats.php b/VICIDIAL_web/server_stats.php deleted file mode 100644 index a427f5c0..00000000 --- a/VICIDIAL_web/server_stats.php +++ /dev/null @@ -1,96 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1037 - Added Link back to Admin section -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - -$stmt="select * from servers;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$servers_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $servers_to_print) - { - $row=mysql_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $i++; - } -?> - - - - - -VICIDIAL: Server Stats and Reports -VICIDIAL: Server Stats and Reports                           -BACK TO ADMIN

- - -

-
- $o)
-	{
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	echo "\n";
-	$o++;
-	}
-
-?>
-
SERVERDESCRIPTIONIP ADDRESSACTIVEVDAD timeVDcall timePARK timeCLOSER/INBOUND time
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]LINKLINKLINKLINK
- - \ No newline at end of file diff --git a/VICIDIAL_web/test.txt b/VICIDIAL_web/test.txt deleted file mode 100644 index 70c379b6..00000000 --- a/VICIDIAL_web/test.txt +++ /dev/null @@ -1 +0,0 @@ -Hello world \ No newline at end of file diff --git a/VICIDIAL_web/user_stats.php b/VICIDIAL_web/user_stats.php deleted file mode 100644 index bdada227..00000000 --- a/VICIDIAL_web/user_stats.php +++ /dev/null @@ -1,316 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1743 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='$user';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: User Stats -\n"; -?> - - -
- - - - - -\n"; -echo "
  VICIDIAL ADMIN: User Stats for  
  \n"; - -echo "
\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - -echo "
\n"; - -echo "TALK TIME AND STATUS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - -echo "\n"; -echo "
STATUSCOUNTHOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LOGIN/LOGOUT TIME:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) - { - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours = ($event_seconds / 3600); - $event_hours = round($event_hours, 2); - $event_hours_int = intval("$event_hours"); - $event_minutes = ($event_hours - $event_hours_int); - $event_minutes = ($event_minutes * 60); - $event_minutes_int = round($event_minutes, 0); - if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - $event_start_seconds=''; - $event_stop_seconds=''; - } - else - { - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - } - } - - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - -$total_login_hours = ($total_login_time / 3600); -$total_login_hours = round($total_login_hours, 2); -$total_login_hours_int = intval("$total_login_hours"); -$total_login_minutes = ($total_login_hours - $total_login_hours_int); -$total_login_minutes = ($total_login_minutes * 60); -$total_login_minutes_int = round($total_login_minutes, 0); -if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";} - -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "
EVENT DATE CAMPAIGNHOURS:MINUTES
$row[0] $row[2] $row[3]
$row[0] $row[2] $row[3] $event_hours_int:$event_minutes_int
$row[0] $row[2] $row[3]
TOTAL $total_login_hours_int:$total_login_minutes_int
\n"; - - -echo "

\n"; - -echo "
\n"; - -echo "LAST 50 CALLS:\n"; -echo "\n"; -echo "\n"; - - $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' order by uniqueid desc limit 50;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - while ($logs_to_print > $u) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $u++; - } - - -echo "
DATE/TIME LENGTH STATUS PHONE CAMPAIGN LIST LEAD
$row[4] $row[7] $row[8] $row[10] $row[3] $row[2] $row[1]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/VICIDIAL_web/user_status.php b/VICIDIAL_web/user_status.php deleted file mode 100644 index 8efe670f..00000000 --- a/VICIDIAL_web/user_status.php +++ /dev/null @@ -1,238 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1738 - Added variable filtering to eliminate SQL injection attack threat -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,change_agent_campaign from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $change_agent_campaign=$row[1]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $full_name = $row[0]; - - $stmt="SELECT * from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $agents_to_print = mysql_num_rows($rslt); - $i=0; - while ($i < $agents_to_print) - { - $row=mysql_fetch_row($rslt); - $Aserver_ip = $row[2]; - $Asession_id = $row[3]; - $Aextension = $row[4]; - $Astatus = $row[5]; - $Acampaign = $row[7]; - $Alast_call = $row[14]; - $Acl_campaigns = $row[15]; - $i++; - } - - } - -$stmt="select * from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - - - -?> - - -VICIDIAL ADMIN: User Status -\n"; -?> - - -
-
- - - - -\n"; -echo "
  VICIDIAL ADMIN: User Status for  
  \n"; - -if ($stage == "live_campaign_change") -{ - $stmt="UPDATE vicidial_live_agents set campaign_id='" . mysql_real_escape_string($group) . "' where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name changed to $group campaign
\n"; - - exit; -} - -if ($stage == "log_agent_out") -{ - $stmt="DELETE from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; - $rslt=mysql_query($stmt, $link); - - echo "Agent $user - $full_name has been emergency logged out, make sure they close their web browser
\n"; - - exit; -} - -if ($agents_to_print > 0) -{ - echo "
";
-	echo "Agent Logged in at server:  $Aserver_ip\n";
-	echo "               in session:  $Asession_id\n";
-	echo "               from phone:  $Aextension\n";
-	echo "Agent is in campaign:       $Acampaign\n";
-	echo "              status:       $Astatus\n";
-	echo " hungup last call at:       $Alast_call\n";
-	echo "       Closer groups:       $Acl_campaigns\n\n";
-
-	echo "
"; - - - if ($change_agent_campaign > 0) - { - echo "\n"; - echo "\n"; - echo "\n"; - echo "Current Campaign: \n"; - echo "
\n"; - - - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - } -} - -else -{ - echo "Agent is not logged in\n
"; - -} - - -echo "           $user - $full_name - \n"; - -echo "VICIDIAL Time Sheet\n"; - -echo "
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - -echo "|$stage|$group|"; - -?> - - -
- - - - - - - - - diff --git a/VICIDIAL_web/vdremote.php b/VICIDIAL_web/vdremote.php deleted file mode 100644 index dfe11fa3..00000000 --- a/VICIDIAL_web/vdremote.php +++ /dev/null @@ -1,602 +0,0 @@ - LICENSE: GPLv2 -# -# Changes -# 50307-1721 - First version -# 51123-1502 - removed requirement of PHP Globals=on -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat -# -# make sure you have added a user to the vicidial_users MySQL table with at least user_level 4 to access this page the first time - -$version = '1.1.12'; -$build = '60619-1603'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($force_logout)) {$force_logout = 0;} - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$popup_page = './closer_popup.php'; -$STARTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - $stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $authx=$row[0]; - - if($authx>0) - { - $stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id=$row[0]; - $server_ip=$row[1]; - if (!$number_of_lines) {$number_of_lines=$row[2];} - - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; - exit; - } - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -if ($ADD==61111) - { - echo"\n"; - } -echo "\n"; -?> - -VICIDIAL REMOTE AGENTS: $LOGfullname - $PHP_AUTH_USER "; - -if (!$ADD) {$ADD="31111";} -if ($ADD==31111) {echo "Modify Remote Agents";} -if ($ADD==41111) {echo "Modify Remote Agents";} -if ($ADD==61111) {echo "Remote Agent Status";} -if ($ADD==71111) {echo "Remote Agent Closer Stats";} - - -if (strlen($ADD)>4) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "2) {$groups_value .= " -";} - } - -?> - - - -
-
- - - -
  VICIDIAL REMOTE AGENTS:   Logout  
  MODIFY | ">STATUS | ">INBOUND STATS
-"; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]
\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: $user_start
Number of Lines: (numbers only)
Server IP: $row[3]
External Extension: (number dialed to reach agents [i.e. 913125551212])
Status:
Campaign: $campaign_id
Inbound Groups: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) - {echo "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - $stmt="UPDATE vicidial_remote_agents set number_of_lines='" . mysql_real_escape_string($number_of_lines) . "', conf_exten='" . mysql_real_escape_string($conf_exten) . "', status='" . mysql_real_escape_string($status) . "', closer_campaigns='" . mysql_real_escape_string($groups_value) . "' where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - -# echo "$stmt\n"; - echo "
REMOTE AGENTS MODIFIED\n"; - - ### LOG CHANGES TO LOG FILE ### - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|MODIFY REMOTE AGENTS ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n"); - fclose($fp); - - } - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
MODIFY A REMOTE AGENTS ENTRY: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
User ID Start: $user_start
Number of Lines: (numbers only)
Server IP: $row[3]
External Extension: (number dialed to reach agents [i.e. 913125551212])
Status:
Campaign: $campaign_id
Inbound Groups: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - - - -###################### -# ADD=61111 status of remote agent in the system and active calls and queue -###################### - -if ($ADD==61111) -{ - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'" . mysql_real_escape_string($nextuser) . "',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - echo "VICIDIAL: Remote Agent Time On Calls $NOW_TIME\n\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $leadlink=0; - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[3]=''; - $row[5]=' - WAITING - '; - $row[6]=$row[7]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $leadid = sprintf("%-12s", $row[2]); - if ($row[2] > 0) - { - $leadidLINK=$row[2]; - $leadlink++; - if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;} - $leadid = "$leadid"; - } - $channel = sprintf("%-10s", $row[3]); - $cc=0; - while ( (strlen($channel) > 10) and ($cc < 100) ) - { - $channel = eregi_replace(".$","",$channel); - $cc++; - if (strlen($channel) <= 10) {$cc=101;} - } - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = ($STARTtime - $row[6]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} - if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo " $i agents logged in on server $server_ip\n\n"; - - echo " - 5 minutes or more on call\n"; - echo " - Over 10 minutes on call\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "********************************* NO AGENTS ON CALLS *********************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - -###################### -# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log) -###################### - -if ($ADD==71111) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'$nextuser',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $in_calls = $row[0]; - $in_time = $row[1]; - $in_time_M = ($in_time / 60); - $in_time_M = round($in_time_M, 2); - $in_time_M_int = intval("$in_time_M"); - $in_time_SEC = ($in_time_M - $in_time_M_int); - $in_time_SEC = ($in_time_SEC * 60); - $in_time_SEC = round($in_time_SEC, 0); - if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";} - $in_time_MS = "$in_time_M_int:$in_time_SEC"; - $in_time_MS = sprintf("%7s", $in_time_MS); - - echo "VICIDIAL: Remote Agent inbound stats $NOW_TIME\n\n"; - echo "\n"; - echo "Total calls taken $query_date: $in_calls\n"; - echo "Total talk time on $query_date: $in_time_MS (minutes:seconds)\n"; - echo "\n"; - echo "\n"; - echo "Call list for $query_date:\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - $user = sprintf("%-8s", $row[0]); - $leadid = sprintf("%-10s", $row[1]); - $group = sprintf("%-14s", $row[2]); - $phone = sprintf("%-10s", $row[3]); - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = $row[6]; - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - # if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - # echo " $i agents logged in on server $server_ip\n\n"; - - # echo " - 5 minutes or more on call\n"; - # echo " - Over 10 minutes on call\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "********************************* NO CALLS ON THIS DAY *******************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/agc/active_list_refresh.php b/agc/active_list_refresh.php deleted file mode 100644 index 7ea0bff0..00000000 --- a/agc/active_list_refresh.php +++ /dev/null @@ -1,482 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to serve updates of the live data to the display scripts -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ADD - ('1','2','3','4','5') -### - $order - ('asc','desc') -### - $format - ('text','table','menu','selectlist','textarea') -### - $bgcolor - ('#123456','white','black','etc...') -### - $txtcolor - ('#654321','black','white','etc...') -### - $txtsize - ('1','2','3','etc...') -### - $selectsize - ('2','3','4','etc...') -### - $selectfontsize - ('8','10','12','etc...') -### - $selectedext - ('cc100') -### - $selectedtrunk - ('Zap/25-1') -### - $selectedlocal - ('SIP/cc100') -### - $textareaheight - ('8','10','12','etc...') -### - $textareawidth - ('8','10','12','etc...') -### - $field_name - ('extension','busyext','extension_xfer','etc...') -### - -# changes -# 50323-1147 - First build of script -# 50401-1132 - small formatting changes -# 50502-1402 - added field_name as modifiable variable -# 50503-1213 - added session_name checking for extra security -# 50503-1311 - added conferences list -# 50610-1155 - Added NULL check on MySQL results to reduced errors -# 50711-1209 - removed HTTP authentication in favor of user/pass vars -# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1118 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["order"])) {$order=$_GET["order"];} - elseif (isset($_POST["order"])) {$order=$_POST["order"];} -if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} - elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} -if (isset($_GET["txtcolor"])) {$txtcolor=$_GET["txtcolor"];} - elseif (isset($_POST["txtcolor"])) {$txtcolor=$_POST["txtcolor"];} -if (isset($_GET["txtsize"])) {$txtsize=$_GET["txtsize"];} - elseif (isset($_POST["txtsize"])) {$txtsize=$_POST["txtsize"];} -if (isset($_GET["selectsize"])) {$selectsize=$_GET["selectsize"];} - elseif (isset($_POST["selectsize"])) {$selectsize=$_POST["selectsize"];} -if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"];} - elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} -if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} - elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} -if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} - elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} -if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} - elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} -if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} - elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} -if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} - elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} -if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} - elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} - -### security strip all non-alphanumeric characters out of the variables ### - $user=ereg_replace("[^0-9a-zA-Z]","",$user); - $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - $ADD=ereg_replace("[^0-9]","",$ADD); - $order=ereg_replace("[^0-9a-zA-Z]","",$order); - $format=ereg_replace("[^0-9a-zA-Z]","",$format); - $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor); - $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor); - $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize); - $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize); - $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize); - $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext); - $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk); - $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal); - $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight); - $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth); - $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name); - -# default optional vars if not set -if (!isset($ADD)) {$ADD="1";} -if (!isset($order)) {$order='desc';} -if (!isset($format)) {$format="text";} -if (!isset($bgcolor)) {$bgcolor='white';} -if (!isset($txtcolor)) {$txtcolor='black';} -if (!isset($txtsize)) {$txtsize='2';} -if (!isset($selectsize)) {$selectsize='4';} -if (!isset($selectfontsize)) {$selectfontsize='10';} -if (!isset($textareaheight)) {$textareaheight='10';} -if (!isset($textareawidth)) {$textareawidth='20';} - -$version = '0.0.8'; -$build = '60619-1118'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "List Display: "; -if ($ADD==1) {echo "Live Extensions";} -if ($ADD==2) {echo "Busy Extensions";} -if ($ADD==3) {echo "Outside Lines";} -if ($ADD==4) {echo "Local Extensions";} -if ($ADD==5) {echo "Conferences";} -if ($ADD==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc/astguiclient.php b/agc/astguiclient.php deleted file mode 100644 index 614ce146..00000000 --- a/agc/astguiclient.php +++ /dev/null @@ -1,2899 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass -# -# Other scripts that this application depends on: -# - active_list_refresh.php: displays active/live channels and phones -# - manager_send.php: sends Actions to be executed on Asterisk servers -# - live_exten_check.php: checks to see if user's phone is on a live call -# - call_log_display.php: retrieves log of inbound and outbound calls -# - voicemail_check.php: retrieves counts of new and old messages -# - inbound_popup.php: opens upon live_inbound call coming in -# - conf_exten_check.php: checks to see if and calls are in a specific conf -# - park_calls_display.php: retrieves list of parked calls -# - vdc_db_query.php: Changes values in the DB for non-calling records -# -# CHANGES -# 50215-1356 - Proof-of-concept test of XMLHttpRequest for astGUIclient web -# 50323-1411 - First build version display-only -# 50331-1040 - Second-build, added phone login and hangup/hijack display -# 50401-1006 - Trunk/Local Hangup functions enabled -# 50404-1056 - Trunk/Local Hijack functions enabled -# 50404-1459 - Simple live calls display and grabs updated time from server -# 50405-1221 - Reorganized the display and layers, added some images -# 50406-1005 - Added In/Out call log display to MAIN panel -# 50407-1254 - Start/Stop Recording on live calls enabled -# 50422-1101 - Activated Check Voicemail button and new/old messages count -# 50428-1449 - Added dial from log and basic live_inbound call popup -# 50429-1455 - Modified inbound popup code for IE and to add more functions -# 50502-1442 - Added basic method to transfer live calls somewhere else -# 50503-1205 - Added web_client_sessions entry for more security of subscripts -# 50503-1537 - Added basic conferences display -# 50509-1132 - Added conference connected list and hangup/xfer for them -# 50511-1129 - Added registration of conference rooms and added manual dial -# 50523-1342 - Added Conference recording and send DTMF -# 50523-1622 - Added Local Dial window frame for calling local extensions -# 50524-1456 - Added ability to park call and display number of parked calls -# 50524-1600 - Added ability to display and pickup/hangup/xfer parked calls -# 50525-1224 - Added ability to place outbound call from within conferene -# 50531-1225 - Added ability to do dual transfers to meetme rooms from Main -# 50711-1229 - removed HTTP authentication in favor of user/pass vars -# 50711-1610 - Added Zap monitoring to Trunk/Local Action screens -# 50804-1604 - Minor bug fix in inbound_popup functions -# 50818-1715 - Added pretty login section -# 50913-1137 - Added custom outbound_cid from phones table -# 51110-1430 - Fixed non-standard http port issue -# 60103-1421 - Added code for favorite extensions chooser -# 60104-1347 - Added basic layout for favorites editing frame -# 60105-1124 - Finished Favorites frame and added DB submission -# 60112-1622 - Several formatting changes -# 60421-1357 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1103 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.12'; -$build = '60619-1103'; - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $user=ereg_replace("[^0-9a-zA-Z]","",$user); - $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Login\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
User Login:
User Password:
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Phone Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Phone Login
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
Main PanelActive Lines PanelConferences PanelCheck VoicemailLive Call
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Hangup Trunk   |   - Hijack Trunk   |   - Listen Trunk   |   - Refresh   |   - Back to Main Window -
-
- - -
LOCAL HANGUP

- Active Local Menu
- Hangup Local   |   - Hijack Local   |   - Listen Local   |   - Refresh   |   - Back to Main Window -
-
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- Refresh


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - - -
LOCAL Extensions Dial
Phone calling from: Channel
Extensions:
Extensions Menu
-
- Call selected extension

- Call selected vmail box

- Refresh


- Back to Main Window

-
-
- - -
PARKED CALLS:
- Back to Main Window

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NEW:     OLD:             MANUAL DIAL       DIAL
PARKED CALLS: 0                LOCAL DIAL EXTENSIONS
OUTBOUND CALLS:
INBOUND CALLS:
astGUIclient web-client VERSION: BUILD:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITES       edit
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITES

 
SUBMIT FAVORITES CHANGES - requires logout
BACK TO MAIN WINDOW - ignore changes made
-
- -
- - - - - - - - - - - - - -
-PAUSE | START     Refresh rate: 1000 ms Faster | Slower

-
Initializing..
-
Active Extensions
-REFRESH | -ORDER | -
Outside Lines
-REFRESH | -ORDER | -
Local Extensions
-REFRESH | -ORDER | -
- Data Goes Here

-
- Data Goes Here

Trunk Action -
- Data Goes Here

Local Action -
-
- - - - -
- - -Conferences List - - - -
-Click on a conference room number on the left for info on that conference -
- - - -
- - - - - - - - - - - - - - diff --git a/agc/call_log_display.php b/agc/call_log_display.php deleted file mode 100644 index 28d3ea87..00000000 --- a/agc/call_log_display.php +++ /dev/null @@ -1,196 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the inbound and outbound calls for a specific phone -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - $in_limit - ('10','20','50','100',...) -### - $out_limit - ('10','20','50','100',...) -### - -# changes -# 50406-1013 - First build of script -# 50407-1452 - Added definable limits -# 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 -# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1202 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($in_limit)) {$in_limit="100";} -if (!isset($out_limit)) {$out_limit="100";} -$number_dialed = 'number_dialed'; -#$number_dialed = 'extension'; - -$version = '0.0.8'; -$build = '60619-1202'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Call Log Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - 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;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - 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"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc/conf_exten_check.php b/agc/conf_exten_check.php deleted file mode 100644 index 8915d813..00000000 --- a/agc/conf_exten_check.php +++ /dev/null @@ -1,262 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('refresh','register') -# - $client - ('agc','vdc') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $campagentstdisp - ('YES',...) -# - -# changes -# 50509-1054 - First build of script -# 50511-1112 - Added ability to register a conference room -# 50610-1159 - Added NULL check on MySQL results to reduced errors -# 50706-1429 - script changed to not use HTTP login vars, user/pass instead -# 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 -# 60421-1405 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1201 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["client"])) {$client=$_GET["client"];} - elseif (isset($_POST["client"])) {$client=$_POST["client"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} - elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($client)) {$client="agc";} - -$version = '0.0.9'; -$build = '60619-1201'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $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 . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ChannelA[$counter] ~"; - # echo "$ChannelA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid or Exten $exten is not valid\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conference $conf_exten has been registered to $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc/dbconnect.php b/agc/dbconnect.php deleted file mode 100644 index 16c021d5..00000000 --- a/agc/dbconnect.php +++ /dev/null @@ -1,18 +0,0 @@ - LICENSE: GPLv2 -# -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); - -$local_DEF = 'Local/'; -$conf_silent_prefix = '7'; -$local_AMP = '@'; -$ext_context = 'demo'; -$recording_exten = '8309'; - -#$WeBServeRRooT = '/home/www/htdocs'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -$WeBRooTWritablE = '1'; - -?> diff --git a/agc/images/agc_check_voicemail_BLINK.gif b/agc/images/agc_check_voicemail_BLINK.gif deleted file mode 100644 index 30703a78..00000000 Binary files a/agc/images/agc_check_voicemail_BLINK.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_BLINK_e.gif b/agc/images/agc_check_voicemail_BLINK_e.gif deleted file mode 100644 index 600cef89..00000000 Binary files a/agc/images/agc_check_voicemail_BLINK_e.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_BLINK_es.gif b/agc/images/agc_check_voicemail_BLINK_es.gif deleted file mode 100644 index 600cef89..00000000 Binary files a/agc/images/agc_check_voicemail_BLINK_es.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_BLINK_ptbr.gif b/agc/images/agc_check_voicemail_BLINK_ptbr.gif deleted file mode 100644 index 3670af28..00000000 Binary files a/agc/images/agc_check_voicemail_BLINK_ptbr.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_OFF.gif b/agc/images/agc_check_voicemail_OFF.gif deleted file mode 100644 index 5b7e4c75..00000000 Binary files a/agc/images/agc_check_voicemail_OFF.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_OFF_es.gif b/agc/images/agc_check_voicemail_OFF_es.gif deleted file mode 100644 index ec9c1d55..00000000 Binary files a/agc/images/agc_check_voicemail_OFF_es.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_OFF_ptbr.gif b/agc/images/agc_check_voicemail_OFF_ptbr.gif deleted file mode 100644 index 3b1c4644..00000000 Binary files a/agc/images/agc_check_voicemail_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_ON.gif b/agc/images/agc_check_voicemail_ON.gif deleted file mode 100644 index ad55916d..00000000 Binary files a/agc/images/agc_check_voicemail_ON.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_ON_es.gif b/agc/images/agc_check_voicemail_ON_es.gif deleted file mode 100644 index 442a8084..00000000 Binary files a/agc/images/agc_check_voicemail_ON_es.gif and /dev/null differ diff --git a/agc/images/agc_check_voicemail_ON_ptbr.gif b/agc/images/agc_check_voicemail_ON_ptbr.gif deleted file mode 100644 index ae53a393..00000000 Binary files a/agc/images/agc_check_voicemail_ON_ptbr.gif and /dev/null differ diff --git a/agc/images/agc_live_call_OFF.gif b/agc/images/agc_live_call_OFF.gif deleted file mode 100644 index 3752fb5e..00000000 Binary files a/agc/images/agc_live_call_OFF.gif and /dev/null differ diff --git a/agc/images/agc_live_call_OFF_es.gif b/agc/images/agc_live_call_OFF_es.gif deleted file mode 100644 index 1ff376d8..00000000 Binary files a/agc/images/agc_live_call_OFF_es.gif and /dev/null differ diff --git a/agc/images/agc_live_call_OFF_ptbr.gif b/agc/images/agc_live_call_OFF_ptbr.gif deleted file mode 100644 index 86a71723..00000000 Binary files a/agc/images/agc_live_call_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/agc_live_call_ON.gif b/agc/images/agc_live_call_ON.gif deleted file mode 100644 index ed8ba2dd..00000000 Binary files a/agc/images/agc_live_call_ON.gif and /dev/null differ diff --git a/agc/images/agc_live_call_ON_es.gif b/agc/images/agc_live_call_ON_es.gif deleted file mode 100644 index 041d398f..00000000 Binary files a/agc/images/agc_live_call_ON_es.gif and /dev/null differ diff --git a/agc/images/agc_live_call_ON_ptbr.gif b/agc/images/agc_live_call_ON_ptbr.gif deleted file mode 100644 index c0601666..00000000 Binary files a/agc/images/agc_live_call_ON_ptbr.gif and /dev/null differ diff --git a/agc/images/agc_tab_active_lines.gif b/agc/images/agc_tab_active_lines.gif deleted file mode 100644 index 9f8eaf67..00000000 Binary files a/agc/images/agc_tab_active_lines.gif and /dev/null differ diff --git a/agc/images/agc_tab_active_lines_el.gif b/agc/images/agc_tab_active_lines_el.gif deleted file mode 100644 index 1bea40dc..00000000 Binary files a/agc/images/agc_tab_active_lines_el.gif and /dev/null differ diff --git a/agc/images/agc_tab_active_lines_es.gif b/agc/images/agc_tab_active_lines_es.gif deleted file mode 100644 index bdefd015..00000000 Binary files a/agc/images/agc_tab_active_lines_es.gif and /dev/null differ diff --git a/agc/images/agc_tab_active_lines_ptbr.gif b/agc/images/agc_tab_active_lines_ptbr.gif deleted file mode 100644 index 1465ea6e..00000000 Binary files a/agc/images/agc_tab_active_lines_ptbr.gif and /dev/null differ diff --git a/agc/images/agc_tab_astguiclient.gif b/agc/images/agc_tab_astguiclient.gif deleted file mode 100644 index 30373576..00000000 Binary files a/agc/images/agc_tab_astguiclient.gif and /dev/null differ diff --git a/agc/images/agc_tab_astguiclient_ptbr.gif b/agc/images/agc_tab_astguiclient_ptbr.gif deleted file mode 100644 index 30373576..00000000 Binary files a/agc/images/agc_tab_astguiclient_ptbr.gif and /dev/null differ diff --git a/agc/images/agc_tab_conferences.gif b/agc/images/agc_tab_conferences.gif deleted file mode 100644 index e3c80662..00000000 Binary files a/agc/images/agc_tab_conferences.gif and /dev/null differ diff --git a/agc/images/agc_tab_conferences_el.gif b/agc/images/agc_tab_conferences_el.gif deleted file mode 100644 index 91282b42..00000000 Binary files a/agc/images/agc_tab_conferences_el.gif and /dev/null differ diff --git a/agc/images/agc_tab_conferences_es.gif b/agc/images/agc_tab_conferences_es.gif deleted file mode 100644 index 14ab7171..00000000 Binary files a/agc/images/agc_tab_conferences_es.gif and /dev/null differ diff --git a/agc/images/agc_tab_conferences_ptbr.gif b/agc/images/agc_tab_conferences_ptbr.gif deleted file mode 100644 index 14ab7171..00000000 Binary files a/agc/images/agc_tab_conferences_ptbr.gif and /dev/null differ diff --git a/agc/images/agc_tab_main.gif b/agc/images/agc_tab_main.gif deleted file mode 100644 index 6e687e44..00000000 Binary files a/agc/images/agc_tab_main.gif and /dev/null differ diff --git a/agc/images/agc_tab_main_el.gif b/agc/images/agc_tab_main_el.gif deleted file mode 100644 index 4eaf0aa3..00000000 Binary files a/agc/images/agc_tab_main_el.gif and /dev/null differ diff --git a/agc/images/agc_tab_main_es.gif b/agc/images/agc_tab_main_es.gif deleted file mode 100644 index b5fc2a5e..00000000 Binary files a/agc/images/agc_tab_main_es.gif and /dev/null differ diff --git a/agc/images/agc_tab_main_ptbr.gif b/agc/images/agc_tab_main_ptbr.gif deleted file mode 100644 index b5fc2a5e..00000000 Binary files a/agc/images/agc_tab_main_ptbr.gif and /dev/null differ diff --git a/agc/images/blank.gif b/agc/images/blank.gif deleted file mode 100644 index 3a469695..00000000 Binary files a/agc/images/blank.gif and /dev/null differ diff --git a/agc/images/br.gif b/agc/images/br.gif deleted file mode 100644 index 423b8a0c..00000000 Binary files a/agc/images/br.gif and /dev/null differ diff --git a/agc/images/de.gif b/agc/images/de.gif deleted file mode 100644 index 4dd34f6a..00000000 Binary files a/agc/images/de.gif and /dev/null differ diff --git a/agc/images/down.gif b/agc/images/down.gif deleted file mode 100644 index 32d0a007..00000000 Binary files a/agc/images/down.gif and /dev/null differ diff --git a/agc/images/el.gif b/agc/images/el.gif deleted file mode 100644 index 9e79d8bf..00000000 Binary files a/agc/images/el.gif and /dev/null differ diff --git a/agc/images/en.gif b/agc/images/en.gif deleted file mode 100644 index cb45f5f4..00000000 Binary files a/agc/images/en.gif and /dev/null differ diff --git a/agc/images/es.gif b/agc/images/es.gif deleted file mode 100644 index 308ea3cb..00000000 Binary files a/agc/images/es.gif and /dev/null differ diff --git a/agc/images/fr.gif b/agc/images/fr.gif deleted file mode 100644 index 21fb3d19..00000000 Binary files a/agc/images/fr.gif and /dev/null differ diff --git a/agc/images/it.gif b/agc/images/it.gif deleted file mode 100644 index 6c7b1792..00000000 Binary files a/agc/images/it.gif and /dev/null differ diff --git a/agc/images/pt.gif b/agc/images/pt.gif deleted file mode 100644 index 646b76ac..00000000 Binary files a/agc/images/pt.gif and /dev/null differ diff --git a/agc/images/remove.gif b/agc/images/remove.gif deleted file mode 100644 index 89b0521c..00000000 Binary files a/agc/images/remove.gif and /dev/null differ diff --git a/agc/images/up.gif b/agc/images/up.gif deleted file mode 100644 index 0d55544f..00000000 Binary files a/agc/images/up.gif and /dev/null differ diff --git a/agc/images/vdc_LB_dialnextnumber.gif b/agc/images/vdc_LB_dialnextnumber.gif deleted file mode 100644 index a5a080d6..00000000 Binary files a/agc/images/vdc_LB_dialnextnumber.gif and /dev/null differ diff --git a/agc/images/vdc_LB_dialnextnumber_OFF.gif b/agc/images/vdc_LB_dialnextnumber_OFF.gif deleted file mode 100644 index 75bc0e8f..00000000 Binary files a/agc/images/vdc_LB_dialnextnumber_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_dialnextnumber_OFF_es.gif b/agc/images/vdc_LB_dialnextnumber_OFF_es.gif deleted file mode 100644 index 405ff336..00000000 Binary files a/agc/images/vdc_LB_dialnextnumber_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif b/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif deleted file mode 100644 index 0d297820..00000000 Binary files a/agc/images/vdc_LB_dialnextnumber_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_dialnextnumber_es.gif b/agc/images/vdc_LB_dialnextnumber_es.gif deleted file mode 100644 index ca92716e..00000000 Binary files a/agc/images/vdc_LB_dialnextnumber_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_dialnextnumber_ptbr.gif b/agc/images/vdc_LB_dialnextnumber_ptbr.gif deleted file mode 100644 index 8625b1c9..00000000 Binary files a/agc/images/vdc_LB_dialnextnumber_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_grabparkedcall.gif b/agc/images/vdc_LB_grabparkedcall.gif deleted file mode 100644 index a6779255..00000000 Binary files a/agc/images/vdc_LB_grabparkedcall.gif and /dev/null differ diff --git a/agc/images/vdc_LB_grabparkedcall_OFF.gif b/agc/images/vdc_LB_grabparkedcall_OFF.gif deleted file mode 100644 index 74b1f5a1..00000000 Binary files a/agc/images/vdc_LB_grabparkedcall_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_grabparkedcall_OFF_es.gif b/agc/images/vdc_LB_grabparkedcall_OFF_es.gif deleted file mode 100644 index 21991dd5..00000000 Binary files a/agc/images/vdc_LB_grabparkedcall_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif b/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif deleted file mode 100644 index 19932ad2..00000000 Binary files a/agc/images/vdc_LB_grabparkedcall_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_grabparkedcall_es.gif b/agc/images/vdc_LB_grabparkedcall_es.gif deleted file mode 100644 index 9acc363a..00000000 Binary files a/agc/images/vdc_LB_grabparkedcall_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_grabparkedcall_ptbr.gif b/agc/images/vdc_LB_grabparkedcall_ptbr.gif deleted file mode 100644 index e37d0fb4..00000000 Binary files a/agc/images/vdc_LB_grabparkedcall_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_hangupcustomer.gif b/agc/images/vdc_LB_hangupcustomer.gif deleted file mode 100644 index b4fdfae8..00000000 Binary files a/agc/images/vdc_LB_hangupcustomer.gif and /dev/null differ diff --git a/agc/images/vdc_LB_hangupcustomer_OFF.gif b/agc/images/vdc_LB_hangupcustomer_OFF.gif deleted file mode 100644 index e5736ae0..00000000 Binary files a/agc/images/vdc_LB_hangupcustomer_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_hangupcustomer_OFF_es.gif b/agc/images/vdc_LB_hangupcustomer_OFF_es.gif deleted file mode 100644 index 570a6e5a..00000000 Binary files a/agc/images/vdc_LB_hangupcustomer_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif b/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif deleted file mode 100644 index 57918268..00000000 Binary files a/agc/images/vdc_LB_hangupcustomer_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_hangupcustomer_es.gif b/agc/images/vdc_LB_hangupcustomer_es.gif deleted file mode 100644 index 94d3e225..00000000 Binary files a/agc/images/vdc_LB_hangupcustomer_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_hangupcustomer_ptbr.gif b/agc/images/vdc_LB_hangupcustomer_ptbr.gif deleted file mode 100644 index 5841050c..00000000 Binary files a/agc/images/vdc_LB_hangupcustomer_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_parkcall.gif b/agc/images/vdc_LB_parkcall.gif deleted file mode 100644 index 88fee283..00000000 Binary files a/agc/images/vdc_LB_parkcall.gif and /dev/null differ diff --git a/agc/images/vdc_LB_parkcall_OFF.gif b/agc/images/vdc_LB_parkcall_OFF.gif deleted file mode 100644 index 8ad55010..00000000 Binary files a/agc/images/vdc_LB_parkcall_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_parkcall_OFF_es.gif b/agc/images/vdc_LB_parkcall_OFF_es.gif deleted file mode 100644 index 110ce6b0..00000000 Binary files a/agc/images/vdc_LB_parkcall_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_parkcall_OFF_ptbr.gif b/agc/images/vdc_LB_parkcall_OFF_ptbr.gif deleted file mode 100644 index 25a6a2f2..00000000 Binary files a/agc/images/vdc_LB_parkcall_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_parkcall_es.gif b/agc/images/vdc_LB_parkcall_es.gif deleted file mode 100644 index 2274a27c..00000000 Binary files a/agc/images/vdc_LB_parkcall_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_parkcall_ptbr.gif b/agc/images/vdc_LB_parkcall_ptbr.gif deleted file mode 100644 index b37d8358..00000000 Binary files a/agc/images/vdc_LB_parkcall_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_pause.gif b/agc/images/vdc_LB_pause.gif deleted file mode 100644 index 3486a1c1..00000000 Binary files a/agc/images/vdc_LB_pause.gif and /dev/null differ diff --git a/agc/images/vdc_LB_pause_OFF.gif b/agc/images/vdc_LB_pause_OFF.gif deleted file mode 100644 index fce03041..00000000 Binary files a/agc/images/vdc_LB_pause_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_pause_OFF_es.gif b/agc/images/vdc_LB_pause_OFF_es.gif deleted file mode 100644 index 494d68a5..00000000 Binary files a/agc/images/vdc_LB_pause_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_pause_OFF_ptbr.gif b/agc/images/vdc_LB_pause_OFF_ptbr.gif deleted file mode 100644 index 3d8c8759..00000000 Binary files a/agc/images/vdc_LB_pause_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_pause_es.gif b/agc/images/vdc_LB_pause_es.gif deleted file mode 100644 index 544a3797..00000000 Binary files a/agc/images/vdc_LB_pause_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_pause_ptbr.gif b/agc/images/vdc_LB_pause_ptbr.gif deleted file mode 100644 index bea56d65..00000000 Binary files a/agc/images/vdc_LB_pause_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_resume.gif b/agc/images/vdc_LB_resume.gif deleted file mode 100644 index a7d75dd8..00000000 Binary files a/agc/images/vdc_LB_resume.gif and /dev/null differ diff --git a/agc/images/vdc_LB_resume_OFF.gif b/agc/images/vdc_LB_resume_OFF.gif deleted file mode 100644 index 0ae4cb9a..00000000 Binary files a/agc/images/vdc_LB_resume_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_resume_OFF_es.gif b/agc/images/vdc_LB_resume_OFF_es.gif deleted file mode 100644 index 921d5d5e..00000000 Binary files a/agc/images/vdc_LB_resume_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_resume_OFF_ptbr.gif b/agc/images/vdc_LB_resume_OFF_ptbr.gif deleted file mode 100644 index 43bb9235..00000000 Binary files a/agc/images/vdc_LB_resume_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_resume_es.gif b/agc/images/vdc_LB_resume_es.gif deleted file mode 100644 index 1b096144..00000000 Binary files a/agc/images/vdc_LB_resume_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_resume_ptbr.gif b/agc/images/vdc_LB_resume_ptbr.gif deleted file mode 100644 index 415b22d1..00000000 Binary files a/agc/images/vdc_LB_resume_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_senddtmf.gif b/agc/images/vdc_LB_senddtmf.gif deleted file mode 100644 index d19888ad..00000000 Binary files a/agc/images/vdc_LB_senddtmf.gif and /dev/null differ diff --git a/agc/images/vdc_LB_senddtmf_OFF.gif b/agc/images/vdc_LB_senddtmf_OFF.gif deleted file mode 100644 index 08a4b392..00000000 Binary files a/agc/images/vdc_LB_senddtmf_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_senddtmf_OFF_es.gif b/agc/images/vdc_LB_senddtmf_OFF_es.gif deleted file mode 100644 index 2d32c5e9..00000000 Binary files a/agc/images/vdc_LB_senddtmf_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif b/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif deleted file mode 100644 index 2d32c5e9..00000000 Binary files a/agc/images/vdc_LB_senddtmf_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_senddtmf_es.gif b/agc/images/vdc_LB_senddtmf_es.gif deleted file mode 100644 index 43964df4..00000000 Binary files a/agc/images/vdc_LB_senddtmf_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_senddtmf_ptbr.gif b/agc/images/vdc_LB_senddtmf_ptbr.gif deleted file mode 100644 index 43964df4..00000000 Binary files a/agc/images/vdc_LB_senddtmf_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_spacer.gif b/agc/images/vdc_LB_spacer.gif deleted file mode 100644 index d0a4f6ed..00000000 Binary files a/agc/images/vdc_LB_spacer.gif and /dev/null differ diff --git a/agc/images/vdc_LB_startrecording.gif b/agc/images/vdc_LB_startrecording.gif deleted file mode 100644 index 022103d2..00000000 Binary files a/agc/images/vdc_LB_startrecording.gif and /dev/null differ diff --git a/agc/images/vdc_LB_startrecording_OFF.gif b/agc/images/vdc_LB_startrecording_OFF.gif deleted file mode 100644 index 3ee4ca62..00000000 Binary files a/agc/images/vdc_LB_startrecording_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_startrecording_OFF_es.gif b/agc/images/vdc_LB_startrecording_OFF_es.gif deleted file mode 100644 index ff9a3447..00000000 Binary files a/agc/images/vdc_LB_startrecording_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_startrecording_OFF_ptbr.gif b/agc/images/vdc_LB_startrecording_OFF_ptbr.gif deleted file mode 100644 index 22105778..00000000 Binary files a/agc/images/vdc_LB_startrecording_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_startrecording_es.gif b/agc/images/vdc_LB_startrecording_es.gif deleted file mode 100644 index 26420f78..00000000 Binary files a/agc/images/vdc_LB_startrecording_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_startrecording_ptbr.gif b/agc/images/vdc_LB_startrecording_ptbr.gif deleted file mode 100644 index 15b25990..00000000 Binary files a/agc/images/vdc_LB_startrecording_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_stoprecording.gif b/agc/images/vdc_LB_stoprecording.gif deleted file mode 100644 index 6f3bfede..00000000 Binary files a/agc/images/vdc_LB_stoprecording.gif and /dev/null differ diff --git a/agc/images/vdc_LB_stoprecording_OFF.gif b/agc/images/vdc_LB_stoprecording_OFF.gif deleted file mode 100644 index 2e1efe4a..00000000 Binary files a/agc/images/vdc_LB_stoprecording_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_stoprecording_OFF_es.gif b/agc/images/vdc_LB_stoprecording_OFF_es.gif deleted file mode 100644 index 2806311f..00000000 Binary files a/agc/images/vdc_LB_stoprecording_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif b/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif deleted file mode 100644 index c0259410..00000000 Binary files a/agc/images/vdc_LB_stoprecording_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_stoprecording_es.gif b/agc/images/vdc_LB_stoprecording_es.gif deleted file mode 100644 index 94f9de9d..00000000 Binary files a/agc/images/vdc_LB_stoprecording_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_stoprecording_ptbr.gif b/agc/images/vdc_LB_stoprecording_ptbr.gif deleted file mode 100644 index 8a76e860..00000000 Binary files a/agc/images/vdc_LB_stoprecording_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_transferconf.gif b/agc/images/vdc_LB_transferconf.gif deleted file mode 100644 index c5738519..00000000 Binary files a/agc/images/vdc_LB_transferconf.gif and /dev/null differ diff --git a/agc/images/vdc_LB_transferconf_OFF.gif b/agc/images/vdc_LB_transferconf_OFF.gif deleted file mode 100644 index dd0a579a..00000000 Binary files a/agc/images/vdc_LB_transferconf_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_transferconf_OFF_es.gif b/agc/images/vdc_LB_transferconf_OFF_es.gif deleted file mode 100644 index d0a54bf6..00000000 Binary files a/agc/images/vdc_LB_transferconf_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_transferconf_OFF_ptbr.gif b/agc/images/vdc_LB_transferconf_OFF_ptbr.gif deleted file mode 100644 index ebb69344..00000000 Binary files a/agc/images/vdc_LB_transferconf_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_transferconf_es.gif b/agc/images/vdc_LB_transferconf_es.gif deleted file mode 100644 index 10cfa495..00000000 Binary files a/agc/images/vdc_LB_transferconf_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_transferconf_ptbr.gif b/agc/images/vdc_LB_transferconf_ptbr.gif deleted file mode 100644 index f008e92c..00000000 Binary files a/agc/images/vdc_LB_transferconf_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_webform.gif b/agc/images/vdc_LB_webform.gif deleted file mode 100644 index 4d5228f3..00000000 Binary files a/agc/images/vdc_LB_webform.gif and /dev/null differ diff --git a/agc/images/vdc_LB_webform_OFF.gif b/agc/images/vdc_LB_webform_OFF.gif deleted file mode 100644 index 64316ced..00000000 Binary files a/agc/images/vdc_LB_webform_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_LB_webform_OFF_es.gif b/agc/images/vdc_LB_webform_OFF_es.gif deleted file mode 100644 index 75a56196..00000000 Binary files a/agc/images/vdc_LB_webform_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_webform_OFF_ptbr.gif b/agc/images/vdc_LB_webform_OFF_ptbr.gif deleted file mode 100644 index 75a56196..00000000 Binary files a/agc/images/vdc_LB_webform_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_LB_webform_es.gif b/agc/images/vdc_LB_webform_es.gif deleted file mode 100644 index d7590d66..00000000 Binary files a/agc/images/vdc_LB_webform_es.gif and /dev/null differ diff --git a/agc/images/vdc_LB_webform_ptbr.gif b/agc/images/vdc_LB_webform_ptbr.gif deleted file mode 100644 index d7590d66..00000000 Binary files a/agc/images/vdc_LB_webform_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_ammessage.gif b/agc/images/vdc_XB_ammessage.gif deleted file mode 100644 index 484d01eb..00000000 Binary files a/agc/images/vdc_XB_ammessage.gif and /dev/null differ diff --git a/agc/images/vdc_XB_ammessage_OFF.gif b/agc/images/vdc_XB_ammessage_OFF.gif deleted file mode 100644 index 3aa94800..00000000 Binary files a/agc/images/vdc_XB_ammessage_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_blindtransfer.gif b/agc/images/vdc_XB_blindtransfer.gif deleted file mode 100644 index 77c03e0b..00000000 Binary files a/agc/images/vdc_XB_blindtransfer.gif and /dev/null differ diff --git a/agc/images/vdc_XB_blindtransfer_OFF.gif b/agc/images/vdc_XB_blindtransfer_OFF.gif deleted file mode 100644 index 7fb481ee..00000000 Binary files a/agc/images/vdc_XB_blindtransfer_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_blindtransfer_OFF_es.gif b/agc/images/vdc_XB_blindtransfer_OFF_es.gif deleted file mode 100644 index 05adaac5..00000000 Binary files a/agc/images/vdc_XB_blindtransfer_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif b/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif deleted file mode 100644 index 3a069c2b..00000000 Binary files a/agc/images/vdc_XB_blindtransfer_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_blindtransfer_es.gif b/agc/images/vdc_XB_blindtransfer_es.gif deleted file mode 100644 index fdad633a..00000000 Binary files a/agc/images/vdc_XB_blindtransfer_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_blindtransfer_ptbr.gif b/agc/images/vdc_XB_blindtransfer_ptbr.gif deleted file mode 100644 index c31c87fc..00000000 Binary files a/agc/images/vdc_XB_blindtransfer_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_channel.gif b/agc/images/vdc_XB_channel.gif deleted file mode 100644 index 9a9ce7ba..00000000 Binary files a/agc/images/vdc_XB_channel.gif and /dev/null differ diff --git a/agc/images/vdc_XB_channel_es.gif b/agc/images/vdc_XB_channel_es.gif deleted file mode 100644 index a4fbf1f5..00000000 Binary files a/agc/images/vdc_XB_channel_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_channel_ptbr.gif b/agc/images/vdc_XB_channel_ptbr.gif deleted file mode 100644 index a4fbf1f5..00000000 Binary files a/agc/images/vdc_XB_channel_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_code.gif b/agc/images/vdc_XB_code.gif deleted file mode 100644 index 8fb2b8c5..00000000 Binary files a/agc/images/vdc_XB_code.gif and /dev/null differ diff --git a/agc/images/vdc_XB_dialwithcustomer.gif b/agc/images/vdc_XB_dialwithcustomer.gif deleted file mode 100644 index 68697edc..00000000 Binary files a/agc/images/vdc_XB_dialwithcustomer.gif and /dev/null differ diff --git a/agc/images/vdc_XB_dialwithcustomer_OFF.gif b/agc/images/vdc_XB_dialwithcustomer_OFF.gif deleted file mode 100644 index 8bf2e44b..00000000 Binary files a/agc/images/vdc_XB_dialwithcustomer_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif b/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif deleted file mode 100644 index 7ef98a94..00000000 Binary files a/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif b/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif deleted file mode 100644 index 1ac7dbbb..00000000 Binary files a/agc/images/vdc_XB_dialwithcustomer_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_dialwithcustomer_es.gif b/agc/images/vdc_XB_dialwithcustomer_es.gif deleted file mode 100644 index d71bca15..00000000 Binary files a/agc/images/vdc_XB_dialwithcustomer_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_dialwithcustomer_ptbr.gif b/agc/images/vdc_XB_dialwithcustomer_ptbr.gif deleted file mode 100644 index 90ec03f8..00000000 Binary files a/agc/images/vdc_XB_dialwithcustomer_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupbothlines.gif b/agc/images/vdc_XB_hangupbothlines.gif deleted file mode 100644 index 4e6db07e..00000000 Binary files a/agc/images/vdc_XB_hangupbothlines.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupbothlines_OFF.gif b/agc/images/vdc_XB_hangupbothlines_OFF.gif deleted file mode 100644 index f1ffdc12..00000000 Binary files a/agc/images/vdc_XB_hangupbothlines_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupbothlines_OFF_es.gif b/agc/images/vdc_XB_hangupbothlines_OFF_es.gif deleted file mode 100644 index 8f12accd..00000000 Binary files a/agc/images/vdc_XB_hangupbothlines_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif b/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif deleted file mode 100644 index 47b87225..00000000 Binary files a/agc/images/vdc_XB_hangupbothlines_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupbothlines_es.gif b/agc/images/vdc_XB_hangupbothlines_es.gif deleted file mode 100644 index 646c8769..00000000 Binary files a/agc/images/vdc_XB_hangupbothlines_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupbothlines_ptbr.gif b/agc/images/vdc_XB_hangupbothlines_ptbr.gif deleted file mode 100644 index fa0cf2fb..00000000 Binary files a/agc/images/vdc_XB_hangupbothlines_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupxferline.gif b/agc/images/vdc_XB_hangupxferline.gif deleted file mode 100644 index d25a105a..00000000 Binary files a/agc/images/vdc_XB_hangupxferline.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupxferline_OFF.gif b/agc/images/vdc_XB_hangupxferline_OFF.gif deleted file mode 100644 index a8fb4a3d..00000000 Binary files a/agc/images/vdc_XB_hangupxferline_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupxferline_OFF_es.gif b/agc/images/vdc_XB_hangupxferline_OFF_es.gif deleted file mode 100644 index 3c717d09..00000000 Binary files a/agc/images/vdc_XB_hangupxferline_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif b/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif deleted file mode 100644 index f6d9080b..00000000 Binary files a/agc/images/vdc_XB_hangupxferline_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupxferline_es.gif b/agc/images/vdc_XB_hangupxferline_es.gif deleted file mode 100644 index 0d92a89c..00000000 Binary files a/agc/images/vdc_XB_hangupxferline_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hangupxferline_ptbr.gif b/agc/images/vdc_XB_hangupxferline_ptbr.gif deleted file mode 100644 index c7d26417..00000000 Binary files a/agc/images/vdc_XB_hangupxferline_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_header.gif b/agc/images/vdc_XB_header.gif deleted file mode 100644 index c813b9a3..00000000 Binary files a/agc/images/vdc_XB_header.gif and /dev/null differ diff --git a/agc/images/vdc_XB_header_es.gif b/agc/images/vdc_XB_header_es.gif deleted file mode 100644 index a92c2df0..00000000 Binary files a/agc/images/vdc_XB_header_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_header_ptbr.gif b/agc/images/vdc_XB_header_ptbr.gif deleted file mode 100644 index a92c2df0..00000000 Binary files a/agc/images/vdc_XB_header_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hotkeysactive.gif b/agc/images/vdc_XB_hotkeysactive.gif deleted file mode 100644 index 8382205e..00000000 Binary files a/agc/images/vdc_XB_hotkeysactive.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hotkeysactive_OFF.gif b/agc/images/vdc_XB_hotkeysactive_OFF.gif deleted file mode 100644 index 3357ed2b..00000000 Binary files a/agc/images/vdc_XB_hotkeysactive_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif b/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif deleted file mode 100644 index 638ef859..00000000 Binary files a/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hotkeysactive_OFF_es.gif b/agc/images/vdc_XB_hotkeysactive_OFF_es.gif deleted file mode 100644 index 5c9a3122..00000000 Binary files a/agc/images/vdc_XB_hotkeysactive_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif b/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif deleted file mode 100644 index 335e6356..00000000 Binary files a/agc/images/vdc_XB_hotkeysactive_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hotkeysactive_es.gif b/agc/images/vdc_XB_hotkeysactive_es.gif deleted file mode 100644 index b064725c..00000000 Binary files a/agc/images/vdc_XB_hotkeysactive_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hotkeysactive_ptbr.gif b/agc/images/vdc_XB_hotkeysactive_ptbr.gif deleted file mode 100644 index a34409c2..00000000 Binary files a/agc/images/vdc_XB_hotkeysactive_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_hotkeysinactive_es.gif b/agc/images/vdc_XB_hotkeysinactive_es.gif deleted file mode 100644 index d0bf982c..00000000 Binary files a/agc/images/vdc_XB_hotkeysinactive_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_internalcloser.gif b/agc/images/vdc_XB_internalcloser.gif deleted file mode 100644 index a1adca76..00000000 Binary files a/agc/images/vdc_XB_internalcloser.gif and /dev/null differ diff --git a/agc/images/vdc_XB_internalcloser_OFF.gif b/agc/images/vdc_XB_internalcloser_OFF.gif deleted file mode 100644 index 9d3489fa..00000000 Binary files a/agc/images/vdc_XB_internalcloser_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_internalcloser_OFF_es.gif b/agc/images/vdc_XB_internalcloser_OFF_es.gif deleted file mode 100644 index 45bc4290..00000000 Binary files a/agc/images/vdc_XB_internalcloser_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif b/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif deleted file mode 100644 index 45bc4290..00000000 Binary files a/agc/images/vdc_XB_internalcloser_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_internalcloser_es.gif b/agc/images/vdc_XB_internalcloser_es.gif deleted file mode 100644 index d5c05657..00000000 Binary files a/agc/images/vdc_XB_internalcloser_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_internalcloser_ptbr.gif b/agc/images/vdc_XB_internalcloser_ptbr.gif deleted file mode 100644 index d5c05657..00000000 Binary files a/agc/images/vdc_XB_internalcloser_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_leave3waycall.gif b/agc/images/vdc_XB_leave3waycall.gif deleted file mode 100644 index 7bca06f9..00000000 Binary files a/agc/images/vdc_XB_leave3waycall.gif and /dev/null differ diff --git a/agc/images/vdc_XB_leave3waycall_OFF.gif b/agc/images/vdc_XB_leave3waycall_OFF.gif deleted file mode 100644 index 63594d65..00000000 Binary files a/agc/images/vdc_XB_leave3waycall_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_leave3waycall_OFF_es.gif b/agc/images/vdc_XB_leave3waycall_OFF_es.gif deleted file mode 100644 index 9c41a291..00000000 Binary files a/agc/images/vdc_XB_leave3waycall_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif b/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif deleted file mode 100644 index 63594d65..00000000 Binary files a/agc/images/vdc_XB_leave3waycall_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_leave3waycall_es.gif b/agc/images/vdc_XB_leave3waycall_es.gif deleted file mode 100644 index 9aa29708..00000000 Binary files a/agc/images/vdc_XB_leave3waycall_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_leave3waycall_ptbr.gif b/agc/images/vdc_XB_leave3waycall_ptbr.gif deleted file mode 100644 index 7bca06f9..00000000 Binary files a/agc/images/vdc_XB_leave3waycall_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_localcloser.gif b/agc/images/vdc_XB_localcloser.gif deleted file mode 100644 index 0e10a2ad..00000000 Binary files a/agc/images/vdc_XB_localcloser.gif and /dev/null differ diff --git a/agc/images/vdc_XB_localcloser_OFF.gif b/agc/images/vdc_XB_localcloser_OFF.gif deleted file mode 100644 index ed11b7ac..00000000 Binary files a/agc/images/vdc_XB_localcloser_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_localcloser_OFF_es.gif b/agc/images/vdc_XB_localcloser_OFF_es.gif deleted file mode 100644 index fbad052d..00000000 Binary files a/agc/images/vdc_XB_localcloser_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_localcloser_OFF_ptbr.gif b/agc/images/vdc_XB_localcloser_OFF_ptbr.gif deleted file mode 100644 index fbad052d..00000000 Binary files a/agc/images/vdc_XB_localcloser_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_localcloser_es.gif b/agc/images/vdc_XB_localcloser_es.gif deleted file mode 100644 index d36e1944..00000000 Binary files a/agc/images/vdc_XB_localcloser_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_localcloser_ptbr.gif b/agc/images/vdc_XB_localcloser_ptbr.gif deleted file mode 100644 index d36e1944..00000000 Binary files a/agc/images/vdc_XB_localcloser_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_number.gif b/agc/images/vdc_XB_number.gif deleted file mode 100644 index 33f30330..00000000 Binary files a/agc/images/vdc_XB_number.gif and /dev/null differ diff --git a/agc/images/vdc_XB_number_es.gif b/agc/images/vdc_XB_number_es.gif deleted file mode 100644 index 6d672acc..00000000 Binary files a/agc/images/vdc_XB_number_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_number_ptbr.gif b/agc/images/vdc_XB_number_ptbr.gif deleted file mode 100644 index 22e82a58..00000000 Binary files a/agc/images/vdc_XB_number_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_parkcustomerdial.gif b/agc/images/vdc_XB_parkcustomerdial.gif deleted file mode 100644 index 195b1a90..00000000 Binary files a/agc/images/vdc_XB_parkcustomerdial.gif and /dev/null differ diff --git a/agc/images/vdc_XB_parkcustomerdial_OFF.gif b/agc/images/vdc_XB_parkcustomerdial_OFF.gif deleted file mode 100644 index 7c275732..00000000 Binary files a/agc/images/vdc_XB_parkcustomerdial_OFF.gif and /dev/null differ diff --git a/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif b/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif deleted file mode 100644 index ef710c9c..00000000 Binary files a/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif b/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif deleted file mode 100644 index 72dee5c0..00000000 Binary files a/agc/images/vdc_XB_parkcustomerdial_OFF_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_parkcustomerdial_es.gif b/agc/images/vdc_XB_parkcustomerdial_es.gif deleted file mode 100644 index accda01c..00000000 Binary files a/agc/images/vdc_XB_parkcustomerdial_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_parkcustomerdial_ptbr.gif b/agc/images/vdc_XB_parkcustomerdial_ptbr.gif deleted file mode 100644 index 0101ea9e..00000000 Binary files a/agc/images/vdc_XB_parkcustomerdial_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_XB_seconds.gif b/agc/images/vdc_XB_seconds.gif deleted file mode 100644 index 92fc7f2b..00000000 Binary files a/agc/images/vdc_XB_seconds.gif and /dev/null differ diff --git a/agc/images/vdc_XB_seconds_es.gif b/agc/images/vdc_XB_seconds_es.gif deleted file mode 100644 index f4fe2b27..00000000 Binary files a/agc/images/vdc_XB_seconds_es.gif and /dev/null differ diff --git a/agc/images/vdc_XB_seconds_ptbr.gif b/agc/images/vdc_XB_seconds_ptbr.gif deleted file mode 100644 index f4fe2b27..00000000 Binary files a/agc/images/vdc_XB_seconds_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_tab_script.gif b/agc/images/vdc_tab_script.gif deleted file mode 100644 index 69e43b79..00000000 Binary files a/agc/images/vdc_tab_script.gif and /dev/null differ diff --git a/agc/images/vdc_tab_script_es.gif b/agc/images/vdc_tab_script_es.gif deleted file mode 100644 index ba4320d4..00000000 Binary files a/agc/images/vdc_tab_script_es.gif and /dev/null differ diff --git a/agc/images/vdc_tab_script_ptbr.gif b/agc/images/vdc_tab_script_ptbr.gif deleted file mode 100644 index 69e43b79..00000000 Binary files a/agc/images/vdc_tab_script_ptbr.gif and /dev/null differ diff --git a/agc/images/vdc_tab_vicidial.gif b/agc/images/vdc_tab_vicidial.gif deleted file mode 100644 index 1e862589..00000000 Binary files a/agc/images/vdc_tab_vicidial.gif and /dev/null differ diff --git a/agc/images/vdc_tab_vicidial_ptbr.gif b/agc/images/vdc_tab_vicidial_ptbr.gif deleted file mode 100644 index 1e862589..00000000 Binary files a/agc/images/vdc_tab_vicidial_ptbr.gif and /dev/null differ diff --git a/agc/inbound_popup.php b/agc/inbound_popup.php deleted file mode 100644 index c92583de..00000000 --- a/agc/inbound_popup.php +++ /dev/null @@ -1,351 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed to open up when a live_inbound call comes in giving the user -### options of what to do with the call or options to lookup the callerID on various web sites -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $uniqueid - ('1234567890.123456',...) -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $voicemail_dump_exten - ('85026666666666') -### - $local_web_callerID_URL_enc - ( rawurlencoded custom callerid lookup URL) -### - -# changes -# 50428-1500 - First build of script display only -# 50429-1241 - some formatting, hangup and Vmail redirect, 30s timeout on actions, and CID web lookup links -# 50503-1244 - added session_name checking for extra security -# 50711-1203 - removed HTTP authentication in favor of user/pass vars -# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1205 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} - elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} -if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} - else {$local_web_callerID_URL = '';} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.6'; -$build = '60619-1205'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$DO = '-1'; -if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -LIVE INBOUND CALL"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

LIVE INBOUND CALL

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid is not valid\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Channel: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Channel=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "CUSTOM - \n"; - - echo "
Number Dialed: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "SEND TO MY VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc/live_exten_check.php b/agc/live_exten_check.php deleted file mode 100644 index 0c54ec4b..00000000 --- a/agc/live_exten_check.php +++ /dev/null @@ -1,277 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the client channel is live and to what channel it is connected -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50404-1249 - First build of script -# 50406-1402 - added connected trunk lookup -# 50428-1452 - added live_inbound check for exten on 2nd line of output -# 50503-1233 - added session_name checking for extra security -# 50524-1429 - added parked calls count -# 50610-1204 - Added NULL check on MySQL results to reduced errors -# 50711-1204 - removed HTTP authentication in favor of user/pass vars -# 60103-1541 - added favorite extens status display -# 60421-1359 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1203 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} - elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '1.1.12'; -$build = '60619-1203'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Live Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ChannelA[$loop_count] = "$row[0]"; - $ChannelB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $ChannelA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc/manager_send.php b/agc/manager_send.php deleted file mode 100644 index 296094a4..00000000 --- a/agc/manager_send.php +++ /dev/null @@ -1,908 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -# - $queryCID - ('CN012345678901234567',...) -# - $format - ('text','debug') -# - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $exten - ('1234','913125551212',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $filename - ('20050406-125623_44444',...) -# - $extenName - ('phone100',...) -# - $parkedby - ('phone100',...) -# - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -# - $auto_dial_level - ('0','1','1.1',...) -# - $campaign - ('CLOSER','TESTCAMP',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('1234',...) -# - $seconds - ('32',...) -# - $outbound_cid - ('3125551212','0000000000',...) -# - $agent_log_id - ('123456',...) -# - $call_server_ip - ('10.10.10.15',...) -# - $CalLCID - ('VD01234567890123456',...) -# - -# changes -# 50401-1002 - First build of script, Hangup function only -# 50404-1045 - Redirect basic function enabled -# 50406-1522 - Monitor basic function enabled -# 50407-1647 - Monitor and StopMonitor full functions enabled -# 50422-1120 - basic Originate function enabled -# 50428-1451 - basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 - basic RedirectName and RedirectNameVmail added -# 50503-1227 - added session_name checking for extra security -# 50523-1341 - added Conference call start/stop recording -# 50523-1421 - added OriginateName and OriginateNameVmail for local calls -# 50524-1602 - added RedirectToPark and RedirectFromPark -# 50531-1203 - added RedirecXtra for dual channel redirection -# 50630-1100 - script changed to not use HTTP login vars, user/pass instead -# 50804-1148 - Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 - Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 - Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 - Added outbound_cid set if present to originate call -# 51020-1556 - Added agent_log_id framework for detailed agent activity logging -# 51118-1204 - Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 - Added ability to accept calls from other VICIDIAL servers -# 51129-1253 - Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1158 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -### These are variable assignments for PHP globals off -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} - elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["filename"])) {$filename=$_GET["filename"];} - elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} -if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} - elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} -if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} - elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} -if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} - elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} - elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} - elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} -if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} - elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$secondS = ereg_replace("[^0-9]","",$secondS); - -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$version = '0.0.24'; -$build = '60619-1158'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Manager Send: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten is not valid or ext_context $ext_context or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel is not live on $call_server_ip, Checking Live Channel...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup command sent for Channel $channel on $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "auto_dial_level $auto_dial_level must be set\n"; - echo "campaign $campaign must be set\n"; - echo "uniqueid $uniqueid must be set\n"; - echo "lead_id $lead_id must be set\n"; - echo "\nRedirectVD Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "parkedby $parkedby must be set\n"; - echo "\nRedirectToPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectFromPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Cannot find empty conference on $server_ip, Redirect command not inserted\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for Channel $channel on $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, $ACTION command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or exten $exten is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going on in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n RECORDING WILL LAST UP TO 60 MINUTES\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc/park_calls_display.php b/agc/park_calls_display.php deleted file mode 100644 index 872f5780..00000000 --- a/agc/park_calls_display.php +++ /dev/null @@ -1,146 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send the details on the parked calls on the server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $exten - ('cc101','testphone','49-1','1234','913125551212',...) -### - $protocol - ('SIP','Zap','IAX2',...) -### - -# changes -# 50524-1515 - First build of script -# 50711-1208 - removed HTTP authentication in favor of user/pass vars -# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1205 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} -if (!isset($park_limit)) {$park_limit="1000";} - -$version = '0.0.4'; -$build = '60619-1205'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) ) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Parked Calls Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc/vdc_db_query.php b/agc/vdc_db_query.php deleted file mode 100644 index ef287987..00000000 --- a/agc/vdc_db_query.php +++ /dev/null @@ -1,1512 +0,0 @@ - LICENSE: GPLv2 -# -# This script is designed purely to send whether the meetme conference has live channels connected and which they are -# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -# -# required variables: -# - $server_ip -# - $session_name -# - $user -# - $pass -# optional variables: -# - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') -# - $stage - ('start','finish','lookup','new') -# - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -# - $conf_exten - ('8600011',...) -# - $exten - ('123test',...) -# - $ext_context - ('default','demo',...) -# - $ext_priority - ('1','2',...) -# - $campaign - ('testcamp',...) -# - $dial_timeout - ('60','26',...) -# - $dial_prefix - ('9','8',...) -# - $campaign_cid - ('3125551212','0000000000',...) -# - $MDnextCID - ('M06301413000000002',...) -# - $uniqueid - ('1120232758.2406800',...) -# - $lead_id - ('36524',...) -# - $list_id - ('101','123456',...) -# - $length_in_sec - ('12',...) -# - $phone_code - ('1',...) -# - $phone_number - ('3125551212',...) -# - $channel - ('Zap/12-1',...) -# - $start_epoch - ('1120236911',...) -# - $vendor_lead_code - ('1234test',...) -# - $title - ('Mr.',...) -# - $first_name - ('Bob',...) -# - $middle_initial - ('L',...) -# - $last_name - ('Wilson',...) -# - $address1 - ('1324 Main St.',...) -# - $address2 - ('Apt. 12',...) -# - $address3 - ('co Robert Wilson',...) -# - $city - ('Chicago',...) -# - $state - ('IL',...) -# - $province - ('NA',...) -# - $postal_code - ('60054',...) -# - $country_code - ('USA',...) -# - $gender - ('M',...) -# - $date_of_birth - ('1970-01-01',...) -# - $alt_phone - ('3125551213',...) -# - $email - ('bob@bob.com',...) -# - $security_phrase - ('Hello',...) -# - $comments - ('Good Customer',...) -# - $auto_dial_level - ('0','1','1.2',...) -# - $VDstop_rec_after_each_call - ('0','1') -# - $conf_silent_prefix - ('7','8','',...) -# - $extension - ('123','user123','25-1',...) -# - $protocol - ('Zap','SIP','IAX2',...) -# - $user_abb - ('1234','6666',...) -# - $preview - ('YES','NO',...) -# - $called_count - ('0','1','2',...) -# - $agent_log_id - ('123456',...) -# - $agent_log - ('NO',...) -# - $favorites_list - (",'cc160','cc100'",...) -# - $CallBackDatETimE - ('2006-04-21 14:30:00',...) -# - $recipient - ('ANYONE,'USERONLY') -# - $callback_id - ('12345','12346',...) -# - $use_internal_dnc - ('Y','N') - -# changes -# 50629-1044 - First build of script -# 50630-1422 - Added manual dial action and MD channel lookup -# 50701-1451 - Added dial log for start and end of vicidial calls -# 50705-1239 - Added call disposition update -# 50804-1627 - Fixed updateDispo to update vicidial_log entry -# 50816-1605 - Added VDADpause/ready for auto dialing -# 50816-1811 - Added basic autodial call pickup functions -# 50817-1005 - Altered logging functions to accomodate auto_dialing -# 50818-1305 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 - Added hangup of agent phone after Logout -# 50901-1315 - Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 - Fixed CLOSER log length_in_sec bug -# 50902-1730 - Added functions for manual preview dialing and revert -# 50913-1214 - Added agent random update to leadupdate -# 51020-1421 - Added agent_log_id framework for detailed agent activity logging -# 51021-1717 - Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 - Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 - Altered echo statements for several small PHP speed optimizations -# 51122-1328 - Fixed UserLogout issue not removing conference reservation -# 51129-1012 - Added ability to accept calls from other VICIDIAL servers -# 51129-1729 - Changed manual dial to use the '/n' flag for calls -# 51221-1154 - Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 - Added Updating of astguiclient favorites in the DB -# 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 -# 60419-1517 - After CALLBK is sent to agent, update callback record to INACTIVE -# 60421-1419 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1236 - Fixed closer_choice error for CLOSER campaigns -# 60609-1148 - Added ability to check for manual dial numbers in DNC -# 60619-1117 - Added variable filters to close security holes for login form -# 60623-1414 - Fixed variable filter for phone_code and fixed manual dial logic -# - -$version = '0.0.34'; -$build = '60623-1414'; - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} - elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} -if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} - elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["exten"])) {$exten=$_GET["exten"];} - elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} - elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} -if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} - elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} -if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} - elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} -if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} - elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} -if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} - elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} -if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} - elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} -if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} - elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} - elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} - elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} -if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} - elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} -if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} - elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} -if (isset($_GET["title"])) {$title=$_GET["title"];} - elseif (isset($_POST["title"])) {$title=$_POST["title"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} - elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["gender"])) {$gender=$_GET["gender"];} - elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} -if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} - elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} - elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} - elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} - elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} - elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} -if (isset($_GET["preview"])) {$preview=$_GET["preview"];} - elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} -if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} - elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} -if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} - elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} -if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} - elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} -if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} - elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} -if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} - elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} - elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} - elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} - - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); -$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); -$phone_code = ereg_replace("[^0-9]","",$phone_code); -$phone_number = ereg_replace("[^0-9]","",$phone_number); - - -# default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} - -$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 (!isset($query_date)) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Invalid Username/Password: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Database Query Script"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Group Choice $closer_choice is not valid\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK-") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Group Choice $closer_choice has been registered to user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "HOPPER EMPTY\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### 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) - { - if ($use_internal_dnc=='Y') - { - $stmt="SELECT count(*) FROM vicidial_dnc where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - echo "DNC NUMBER\n"; - exit; - } - } - if ($stage=='lookup') - { - $stmt="SELECT lead_id FROM vicidial_list where phone_number='$phone_number' order by modify_date desc LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $man_leadID_ct = mysql_num_rows($rslt); - if ($man_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $affected_rows=1; - $lead_id =$row[0]; - $CBleadIDset=1; - } - else - { - ### insert a new lead in the system with this phone number - $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 - { - ### insert a new lead in the system with this phone number - $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); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $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;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' 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";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "HOPPER EMPTY\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CALL NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID is not valid\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign is not valid\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserted: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "LOG NOT ENTERED\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CALL_LOG Inserted: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "LOG NOT ENTERED\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id is not valid\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "LOG NOT ENTERED\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaign $campaign is not valid\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCALL - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### If CALLBK, change vicidial_callback record to INACTIVE - if ($dispo == 'CALLBK') - { - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' order by callback_id desc LIMIT 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user on $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten is not valid\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation on the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') ) - { - $stmt = "select phone_number from vicidial_list where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - } - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CALLBACK ENTRY - if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' has been changed to ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='" . mysql_real_escape_string($vendor_lead_code) . "', title='" . mysql_real_escape_string($title) . "', first_name='" . mysql_real_escape_string($first_name) . "', middle_initial='" . mysql_real_escape_string($middle_initial) . "', last_name='" . mysql_real_escape_string($last_name) . "', address1='" . mysql_real_escape_string($address1) . "', address2='" . mysql_real_escape_string($address2) . "', address3='" . mysql_real_escape_string($address3) . "', city='" . mysql_real_escape_string($city) . "', state='" . mysql_real_escape_string($state) . "', province='" . mysql_real_escape_string($province) . "', postal_code='" . mysql_real_escape_string($postal_code) . "', country_code='" . mysql_real_escape_string($country_code) . "', gender='" . mysql_real_escape_string($gender) . "', date_of_birth='" . mysql_real_escape_string($date_of_birth) . "', alt_phone='" . mysql_real_escape_string($alt_phone) . "', email='" . mysql_real_escape_string($email) . "', security_phrase='" . mysql_real_escape_string($security_phrase) . "', comments='" . mysql_real_escape_string($comments) . "' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $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); - - } - echo "Lead $lead_id information has been updated\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage is not valid\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' is now in status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list is not valid\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - -################################################################################ -### 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') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc/vicidial.php b/agc/vicidial.php deleted file mode 100644 index 9d3763bb..00000000 --- a/agc/vicidial.php +++ /dev/null @@ -1,5435 +0,0 @@ - LICENSE: GPLv2 -# -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# -# CHANGES -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 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 -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } - if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); - } - -### security strip all non-alphanumeric characters out of the variables ### - $DB=ereg_replace("[^0-9a-z]","",$DB); - $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login); - $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); - $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); - $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); - $VD_campaign=ereg_replace("[^0-9a-zA-Z]","",$VD_campaign); - - -$forever_stop=0; - -$version = '1.1.85'; -$build = '60619-1047'; - -if ($force_logout) -{ - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$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 -$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 -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # 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 - -# options now set in DB: -#$alt_phone_dialing = '1'; # allow agents to call alt phone numbers -#$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 - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIDIAL web client: Re-Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

User Login

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIDIAL web client: Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIDIAL web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - $VU_scheduled_callbacks=$row[4]; - $agentonly_callbacks=$row[5]; - $agentcall_manual=$row[6]; - $VU_vicidial_recording=$row[7]; - $VU_vicidial_transfers=$row[8]; - $VU_closer_default_blended=$row[9]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - $alt_number_dialing=$row[24]; - $VC_scheduled_callbacks=$row[25]; - $wrapup_seconds=$row[26]; - $wrapup_message=$row[27]; - $closer_campaigns=$row[28]; - $use_internal_dnc=$row[29]; - - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($alt_number_dialing=='Y') - {$alt_phone_dialing='1';} - else - {$alt_phone_dialing='0';} - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Campaign not active, please try again
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Login incorrect, please try again
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIDIAL web client: Phone Login Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login Error
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIDIAL web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed on this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, there are no leads in the hopper for this campaign\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICIDIALSCRIPT   LIVE     session ID: Live Call
-
- - - - -

VICIDIAL
-
- - -MANUAL DIAL
-
- - -X ACTIVE CALLBACKS
-
- - -
CALLBACKS FOR AGENT :
Click on a callback below to call the customer back now. If you click on a record below to call it, it will be removed from the list. -
-
-
  - Refresh -                 - Go Back -
-
- - -
NEW MANUAL DIAL LEAD FOR :

Enter information below for the new lead you wish to call. -
- \n"; - } - ?> - Note: all new manual dial leads will go into list 999

- - - - - - - - - - - - - - - -
Dial Code:   (This is usually a 1 in the USA-Canada)
Phone Number:   (10 digits max - digits only)
Search Existing Leads:   (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)


If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Dial Override field below. To hangup this call you will have to open the CALLS IN THIS SESSION link at the bottom of the screen and hang it up by clicking on its channel link there.
 
Dial Override:   (digits only please)
-
- Dial Now -                 - Go Back -
-
- - - - -Your Status:
Calls Dialing: -
- - - - - -
- - Transfer - Conference
- INTERNAL CLOSER - LOCAL CLOSER - CODE - Hangup Xfer Line - Hangup Both Lines - -
- - Number to call   - seconds   - channel - - OVERRIDE   - D1 - D2 -
- - Dial With Customer - Park Customer Dial - LEAVE 3-WAY CALL - Dial Blind Transfer - Blind Transfer VMail Message -
-
-
- - - - -
Lead Dispositioned As:

- -
-
-
- - - - - - - -
Disposition Hot Keys: - When active, simply press the keyboard key for the desired disposition for this call. The call will then be hungup and dispositioned automatically:
- - - - - -
-
- - -
Noone is in your session:
- Go Back -

- Call Agent Again -
-
- - -
Customer has hung up:
- Go Back -

- Finish and Disposition Call - -
-
- - -
Call Wrapup: seconds remaining in wrapup

- -

- Finish Wrapup and Move On - -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Any changes made to the customer information below at this time will not be comitted, You must change customer information before you Hangup the call.
-
- - -
DISPOSITION CALL :       Hangup Again       minimize
- End-of-call Disposition Selection -
- PAUSE AGENT DIALING
- CLEAR FORM | - SUBMIT -

- WEB FORM SUBMIT -

  -
-
- - - -
Select a CallBack Date :
- - - Select a Date Below   -     - Hour: -   - Minutes: -   - -  
- MY CALLBACK ONLY
";} - ?> - CB Comments:

- - SUBMIT

- -

  -
-
- - -
CLOSER INBOUND GROUP SELECTION
- Closer Inbound Group Selection -
- BLENDED CALLING(outbound activated)
- RESET | - SUBMIT -



  -
-
- - - - Channel - Channel - MY CALLBACK ONLY
";} - ?> -
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- REFRESH


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - -
VICIDIAL SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Dial Next Number
- LEAD PREVIEW
- ALT PHONE DIAL
- - -RECORDING FILE:
-
-
-RECORD ID:
-
- -Start Recording
-
-Web Form
-
-Park Call
-Transfer - Conference
-
-Hangup Customer
-
-Send DTMF
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
seconds:   Channel:   Cust Time:
Customer Information:
Title:   First:   MI:   Last:
Address1:
Address2:   Address3:
City:   State:   PostCode:
Province:   Vendor ID:
Phone:   DialCode:   Alt. Phone:
Show:   Email:
Comments:
- -
-


  - -
- - - - -
VICIDIAL web-client version:     BUILD:               Server:              
-Show conference call channel information
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HOT KEYS INACTIVE - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc/voicemail_check.php b/agc/voicemail_check.php deleted file mode 100644 index 0aa152d7..00000000 --- a/agc/voicemail_check.php +++ /dev/null @@ -1,140 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to check whether the voicemail box on the server defined has new and old messages -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $vmail_box - ('101','1234',...) -### - -# changes -# 50422-1147 - First build of script -# 50503-1241 - added session_name checking for extra security -# 50711-1201 - removed HTTP authentication in favor of user/pass vars -# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1204 - Added variable filters to close security holes for login form -# - -require("dbconnect.php"); - -### If you have globals turned off uncomment these lines -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} - elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} -if (isset($_GET["format"])) {$format=$_GET["format"];} - elseif (isset($_POST["format"])) {$format=$_POST["format"];} -if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} - elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} - -$user=ereg_replace("[^0-9a-zA-Z]","",$user); -$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); - -# default optional vars if not set -if (!isset($format)) {$format="text";} - -$version = '0.0.5'; -$build = '60619-1204'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Voicemail Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "voicemail box $vmail_box is not valid\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/app_conference/0.gsm b/app_conference/0.gsm deleted file mode 100644 index 8c57c411..00000000 Binary files a/app_conference/0.gsm and /dev/null differ diff --git a/app_conference/0.wav b/app_conference/0.wav deleted file mode 100644 index fe3fc124..00000000 Binary files a/app_conference/0.wav and /dev/null differ diff --git a/app_conference/1.gsm b/app_conference/1.gsm deleted file mode 100644 index 7f6c842f..00000000 --- a/app_conference/1.gsm +++ /dev/null @@ -1 +0,0 @@ -8z*PScOȪP,r)" +E<7j2h#8誙B,65Cb (Ra.4WFR2) 8z.hK]%Mq]ͷM] %ty\ ,Yc:Sd<,iUK:B.eZ%Vn*䡝QE!t+DC5сWETbok]bcCzՔ.46_M]]Dbv])`]kʜ_uY]UU2Fr.]MtZld]C]6]Y[.jR=_a 뭺_ܭ1Z]r2բ)6A]](,Q]\gS4a&Q2c>v\udI$P`u \ No newline at end of file diff --git a/app_conference/1.wav b/app_conference/1.wav deleted file mode 100644 index e5f5359a..00000000 Binary files a/app_conference/1.wav and /dev/null differ diff --git a/app_conference/2.gsm b/app_conference/2.gsm deleted file mode 100644 index 82d6e751..00000000 --- a/app_conference/2.gsm +++ /dev/null @@ -1,3 +0,0 @@ -xZP4e5cU\ #n7#HVc ͌xC=A`a肹 B+3+x;4QӇx7 T_ xJB<]%]и -]t1]"0s wb2"hϣ& 0_C%,#dAxZ=a#^TIXVաs6IsBtIrx%~—b!a8sa8cF )8xZvEX]#yM02":#8txZv"%|_,äϢ)YxJA}me+6j_-gF|xK>a- -wCY 藡J,FsͮZx<>_"q- ) *Ƭs Psv_cgβrG$R 埗Y \ No newline at end of file diff --git a/app_conference/2.wav b/app_conference/2.wav deleted file mode 100644 index c3e9edd9..00000000 Binary files a/app_conference/2.wav and /dev/null differ diff --git a/app_conference/3.gsm b/app_conference/3.gsm deleted file mode 100644 index a41d6679..00000000 --- a/app_conference/3.gsm +++ /dev/null @@ -1,2 +0,0 @@ -;=PW1W#X [r)d[K%7 -$c#2+)UBV4F¬SC{4[Hnpޥꕷbªσ`gC?=W n(*En,{Q6qR=!Ʈ\b#V) h~R=ѓ \%.kn\R=pzr>ܙ=$u R=ρfGϠȵj&ayC<·+61㍂aϣpK;WClRLJ$=Rf%>##xwb LM}bj&V:3k+[? kS%vAbÝ97qݑ \ No newline at end of file diff --git a/app_conference/3.wav b/app_conference/3.wav deleted file mode 100644 index bc37ff5d..00000000 Binary files a/app_conference/3.wav and /dev/null differ diff --git a/app_conference/4.gsm b/app_conference/4.gsm deleted file mode 100644 index d2bae3f8..00000000 --- a/app_conference/4.gsm +++ /dev/null @@ -1,2 +0,0 @@ -8PRW\-elG'XVb,b*V rK"bTJ5~aȋf9ZTȁ`IZ^8nYZ2!Qhzk*"xS8nƸ*"fsSzCdփHΡQTmqZsb=iB -Vbc #meTQJeS;4UQ\H'k JX+ 82U" #9k:'Q "I.Sc"7оRr%ڜD~V΢e Vqr!EKi}9EiUELyXz9#3ȭrQ Ysq[HܘaM2 \ No newline at end of file diff --git a/app_conference/4.wav b/app_conference/4.wav deleted file mode 100644 index 05f1adf8..00000000 Binary files a/app_conference/4.wav and /dev/null differ diff --git a/app_conference/5.gsm b/app_conference/5.gsm deleted file mode 100644 index 239c7aca..00000000 --- a/app_conference/5.gsm +++ /dev/null @@ -1 +0,0 @@ -xj=P3cWcT qFܚ$DVD%CHxS&TxD?4A9E'ڸU2r [SyqxbWXWlK%a.Ռ̩ح4+Mv_dȗ˱.#IZAY \ No newline at end of file diff --git a/app_conference/6.wav b/app_conference/6.wav deleted file mode 100644 index 7c32ca36..00000000 Binary files a/app_conference/6.wav and /dev/null differ diff --git a/app_conference/64_Makefile b/app_conference/64_Makefile deleted file mode 100644 index 531caf54..00000000 --- a/app_conference/64_Makefile +++ /dev/null @@ -1,115 +0,0 @@ -# $Id: Makefile,v 1.9 2005/10/27 17:53:35 stevek Exp $ - -# -# Makefile, based on the Asterisk Makefile, Coypright (C) 1999, Mark Spencer -# -# Copyright (C) 2002,2003 Junghanns.NET GmbH -# -# Klaus-Peter Junghanns -# -# This program is free software and may be modified and -# distributed under the terms of the GNU Public License. -# - -.EXPORT_ALL_VARIABLES: - -# -# app_conference defines which can be passed on the command-line -# - -DESTDIR := -INSTALL_MODULES_DIR := /usr/lib/asterisk/modules -INSTALL_CONFIG_DIR := /etc/asterisk - -ASTERISK_INCLUDE_DIR := /usr/include/asterisk - -# turn app_conference debugging on or off ( 0 == OFF, 1 == ON ) -APP_CONFERENCE_DEBUG := 1 - -# 0 = OFF 1 = astdsp 2 = speex -SILDET := 2 - -# -# app_conference objects to build -# - -OBJS = app_conference.o conference.o member.o frame.o cli.o -SHAREDOS = app_conference.so - -# -# standard compile settings -# - -PROC = $(shell uname -m) -INSTALL = install -CC = gcc - -# skip asterisk includes if they are in /usr/include/asterisk -ifneq ($(shell dirname $(ASTERISK_INCLUDE_DIR)), /usr/include) -INCLUDE = -I$(ASTERISK_INCLUDE_DIR) -endif - -LIBS = -ldl -lpthread -lm -DEBUG := -g - -CFLAGS += -pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE - -CFLAGS += $(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi) -CFLAGS += -DCRYPTO - -ifeq ($(APP_CONFERENCE_DEBUG), 1) -CFLAGS += -DAPP_CONFERENCE_DEBUG -endif - -# -# additional flag values for silence detection -# - -ifeq ($(SILDET), 2) -OBJS += libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o -CFLAGS += -Ilibspeex -DSILDET=2 -endif - -ifeq ($(SILDET), 1) -CFLAGS += -DSILDET=1 -endif - -OSARCH=$(shell uname -s) -ifeq (${OSARCH},Darwin) -SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace -else -SOLINK=-shared -Xlinker -x -endif - -# -# targets -# - -all: $(SHAREDOS) - -clean: - rm -f *.so *.o $(OBJS) - -app_conference.so : $(OBJS) - $(CC) -shared -Xlinker -x -o $@ $(OBJS) - -vad_test: vad_test.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o - $(CC) $(PROFILE) -o $@ $^ -lm - -install: all - if [ ! -d ${DESTDIR}${INSTALL_MODULES_DIR} ]; then \ - $(INSTALL) -m 755 -d ${DESTDIR}${INSTALL_MODULES_DIR} ; \ - fi - for x in $(SHAREDOS); do \ - $(INSTALL) -m 755 $$x ${DESTDIR}$(INSTALL_MODULES_DIR) ; \ - done - cp -f *.gsm /var/lib/asterisk/sounds - cp -f *.wav /var/lib/asterisk/sounds - - -#config: all -# if [ ! -d ${DESTDIR}${INSTALL_CONFIG_DIR} ]; then \ -# $(INSTALL) -m 755 -d ${DESTDIR}${INSTALL_CONFIG_DIR} ; \ -# fi -# $(INSTALL) -m 640 conf.conf ${DESTDIR}${INSTALL_CONFIG_DIR} - diff --git a/app_conference/7.gsm b/app_conference/7.gsm deleted file mode 100644 index 0260531d..00000000 --- a/app_conference/7.gsm +++ /dev/null @@ -1,2 +0,0 @@ -8PR=:^ -r(۞fM[E88vG(QE!f݅ Q[O*֩r<HWSwt8Dx"IGDL4:RīUXj]H䋨L~rA fa֮2_(9FܗL]ëRQh_7#uGB.Vi]McjE2[vADyac]loHtRFz􇁗Hy!Aq8!QȤc=6 B)SdޭU9"<55c=ۉmbSc_ܩHUD{7=_!1֥!S왩n:5P!ku \ No newline at end of file diff --git a/app_conference/7.wav b/app_conference/7.wav deleted file mode 100644 index 6cdce5c1..00000000 Binary files a/app_conference/7.wav and /dev/null differ diff --git a/app_conference/8.gsm b/app_conference/8.gsm deleted file mode 100644 index e931896a..00000000 Binary files a/app_conference/8.gsm and /dev/null differ diff --git a/app_conference/8.wav b/app_conference/8.wav deleted file mode 100644 index 3ed04b3b..00000000 Binary files a/app_conference/8.wav and /dev/null differ diff --git a/app_conference/9.gsm b/app_conference/9.gsm deleted file mode 100644 index 4a994705..00000000 Binary files a/app_conference/9.gsm and /dev/null differ diff --git a/app_conference/9.wav b/app_conference/9.wav deleted file mode 100644 index 1439a595..00000000 Binary files a/app_conference/9.wav and /dev/null differ diff --git a/app_conference/LICENSE b/app_conference/LICENSE deleted file mode 100644 index a52b16e4..00000000 --- a/app_conference/LICENSE +++ /dev/null @@ -1,341 +0,0 @@ - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/app_conference/Makefile b/app_conference/Makefile deleted file mode 100644 index d8b54a44..00000000 --- a/app_conference/Makefile +++ /dev/null @@ -1,121 +0,0 @@ -# $Id: Makefile,v 1.9 2005/10/27 17:53:35 stevek Exp $ - -# -# Makefile, based on the Asterisk Makefile, Coypright (C) 1999, Mark Spencer -# -# Copyright (C) 2002,2003 Junghanns.NET GmbH -# -# Klaus-Peter Junghanns -# -# This program is free software and may be modified and -# distributed under the terms of the GNU Public License. -# - -.EXPORT_ALL_VARIABLES: - -# -# app_conference defines which can be passed on the command-line -# - -INSTALL_PREFIX := /usr -INSTALL_MODULES_DIR := $(INSTALL_PREFIX)/lib/asterisk/modules - -ASTERISK_INCLUDE_DIR := $(HOME)/local/asterisk/asterisk/include - -# turn app_conference debugging on or off ( 0 == OFF, 1 == ON ) -APP_CONFERENCE_DEBUG := 1 - -# 0 = OFF 1 = astdsp 2 = speex -SILDET := 2 - -# -# app_conference objects to build -# - -OBJS = app_conference.o conference.o member.o frame.o cli.o -SHAREDOS = app_conference.so - -# -# standard compile settings -# - -PROC = $(shell uname -m) -INSTALL = install -CC = gcc - -INCLUDE = -I$(ASTERISK_INCLUDE_DIR) -LIBS = -ldl -lpthread -lm -DEBUG := -g - -CFLAGS = -pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE -#CFLAGS += -O2 -#CFLAGS += -O3 -march=pentium3 -msse -mfpmath=sse,387 -ffast-math -# PERF: below is 10% faster than -O2 or -O3 alone. -#CFLAGS += -O3 -ffast-math -funroll-loops -# below is another 5% faster or so. -CFLAGS += -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant - -# this is fun for PPC -#CFLAGS += -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic - -# this is fun for x86 -CFLAGS += -march=pentium3 -msse -mfpmath=sse,387 - - -# adding -msse -mfpmath=sse has little effect. -#CFLAGS += -O3 -msse -mfpmath=sse -#CFLAGS += $(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi) -CFLAGS += $(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi) -CFLAGS += -DCRYPTO - -ifeq ($(APP_CONFERENCE_DEBUG), 1) -CFLAGS += -DAPP_CONFERENCE_DEBUG -endif - -# -# additional flag values for silence detection -# - -ifeq ($(SILDET), 2) -OBJS += libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o -CFLAGS += -Ilibspeex -DSILDET=2 -endif - -ifeq ($(SILDET), 1) -CFLAGS += -DSILDET=1 -endif - -OSARCH=$(shell uname -s) -ifeq (${OSARCH},Darwin) -SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace -else -SOLINK=-shared -Xlinker -x -endif - -# -# targets -# - -all: $(SHAREDOS) - -clean: - rm -f *.so *.o $(OBJS) - -app_conference.so : $(OBJS) - $(CC) -pg -shared -Xlinker -x -o $@ $(OBJS) - -vad_test: vad_test.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o - $(CC) $(PROFILE) -o $@ $^ -lm - -install: all - for x in $(SHAREDOS); do $(INSTALL) -m 755 $$x $(INSTALL_MODULES_DIR) ; done - cp -f *.gsm /var/lib/asterisk/sounds - cp -f *.wav /var/lib/asterisk/sounds - -# /var/horizon/mojo/lib/horizoncmd restart asterisk -# make sure you restart asterisk after make install - -# config: all -# cp conf.conf /etc/asterisk/ - - diff --git a/app_conference/README b/app_conference/README deleted file mode 100644 index 2a1c5141..00000000 --- a/app_conference/README +++ /dev/null @@ -1,170 +0,0 @@ -app_conference is a channel-independent conference application. - -Design goals -It has several design goals which are different than meetme: - - * It does not require a zap channel for timing. - * It is very efficient when used with channels which support DTX (silence - detection/discontinuous transmission). - - * It can do VAD on channels which do not support DTX (although this - is more expensive than just mixing them, but less expensive then - encoding; therefore it might still be a win). - * It presents messages on the Monitor interface for determine which - speakers are active. - - -I believe that people other than myself are using this, but my environment is -pretty rigid, and cases outside of this aren't tested: - - * Some callers come from the PSTN via IAX2 from a box with Zaptel cards, - via uLaw. - * Other callers come from iaxclient based softphones using speex - (was GSM) via IAX2 (with DTX). - * Some conferences have a single SIP channel which listens in GSM. - - -Mixing design - - * Minimize encoding/decoding, minimize mixing. - * Minimize generational loss from trancoding. - * Usual cases are handled very efficiently: - o One speaker: That speaker's frame is sent directly to each - participant which uses the same codec. It is trancoded - _once_ for each additional codec type used by participants. - o Two speakers: Each speaker gets the other speaker's frames. - The two speaker's frames are decoded and mixed, and then - encoded _once_ for each codec type used by participants. - - -License -Naturally, app_conference is GPL. The CVS also includes parts of libspeex, -which is distributed under it's a BSD-style license. - -Getting app_conference -app_conference is available from the 'iaxclient' project on sourceforge: - - * CVS browse: http://iaxclient.cvs.sourceforge.net/iaxclient/app_conference/ - * Project page: http://sourceforge.net/projects/iaxclient/ - - -Compiling app_conference - - * just like any other asterisk application. - * Some makefile fiddling may be necessary - - -Using app_conference -There is no configuration file. Conferences are created on-the-fly. - -Dialplan syntax: Conference(ConferenceName|Flags|Priority[|VADSTART|VADCONTINUE]) - - * ConferenceName: Whatever you want to name the conference - * Flags one of more of the following: - o M: Moderator (presently same as speaker) - o S: Speaker - o L: Listener - o T: "Telephone caller" (just for stats?). - o V: Do VAD on this caller - o D: Use Denoise filter on this caller. - o d: Send manager events when DTMF is received. - o q: Do not play enter or exit sounds. - o i: use inband dtmf broadcast. - o t: use rfc dtmf signal broadcast. - * Priority: Currently ignored; was to be a "speaking priority" so a - higher priority caller could "override" others. - * VADSTART: Optional: "probability" to use to detect start of speech. - * VADCONTINUE: Optional: "probability" to use to detect continuation - of speech. - - -Features / CLI/Manager Commands - - * conference debug [ on | off ] - enable debugging for a conference - - * conference show stats show conference stats - - * conference play sound [mute] - play a sound to a conference member, optionally muting them. - -Manager Events -app_conference generates several detailed manager events so that applications -interfacing with the manager API can monitor conferences: - - * ConferenceState: sent as members begin/end speaking. - Channel: The channel - State: "speaking" or "silent" - - * ConferenceDTMF: sent when conference members send DTMF to the conference - Channel: The channel - Key: The DTMF key send [0-9*#] - - * ConferenceSoundComplete: send when the conference has finished playing - a sound to a user - Channel: The channel - Sound: The first 255 bytes of the file requested in conference play - sound CLI/Mgr command. - - -Benchmarking -It would be nice to have solid benchmarks to present, but a good size -machine should be able to handle many callers when either (a) they are -using DTX, or (b) they are listen-only. It's used often with hundreds of -simultaneous callers. - -Discussion -The iaxclient-devel mailing list is probably as good a place as any to discuss. - - ---- - -app_conference is brought to you by the letter q, and the number e - - -Matt Florell Changes for VD_app_conference tarball version. In order to use this -as seemlessly as possible for VICIDIAL it was necessary to modify the code. This -module can now be used in place of using meetme for VICIDIAL. This is -experimental, please test thoroughly before putting it in production. - -CHANGES MADE FOR VICIDIAL: - -- Default to member type of S instead of L -- Commented out many repetative NOTICEs and ERRORs -- Added entry and exit sounds except for Local/786 and Local/8500998 (VDsilent and DTMFapp) -- Added conf-onlyperson mesage to first conference participant -- Included enter.gsm and leave.gsm files as well as DTMF wav and gsm sounds -- Removed restart from "make install" and added audio file copying -- If no 'd' option is set and DTMF frames are detected, the DTMF audio will be played to the member -- Added 'q' flag to prevent playing of entry/exit sounds -- Added 'i' flag to enable playing of DTMF sounds inband to all members -- Added 't' flag to enable sending of RFC DTMF signals to all members -- Changed delimiter to pipe | from slash / to be more compliant with meetme standards - - -NOTE TO 64-BIT LINUX USERS: -If you have problems with 64-bit Linux please use the included 64_Makefile instead of the default one. - -COMPILE NOTES: - -Some Makefile alterations may be necessary for your system: - -From Alek Barkley: -I am running FC4 with latest updates ( 2.6.16 kernel ) -My CPU is AMD K6 and GCC 4.0.2. - -I edited Makefile in app_conference distribution. -To enter CPU architecture in my case -march=k6 -======================================================== -PROC = k6 -# this is fun for x86 -#CFLAGS += -march=pentium3 -msse -mfpmath=sse,387 -CFLAGS += -march=k6 -=========================================================== - - -VD_app_conference CHANGELOG -- Release 0.4 - First VICIDIAL-centric release -- Release 0.5 - Fixed the dtmf broadcast logic and a star/hash bug - - Added 64-bit makefile thanks to Jon Hood -- Release 0.6 - Added Makefile notes and changed some Makefile flags diff --git a/app_conference/VICIDIAL.txt b/app_conference/VICIDIAL.txt deleted file mode 100644 index 92011ec2..00000000 --- a/app_conference/VICIDIAL.txt +++ /dev/null @@ -1,86 +0,0 @@ -VICIDIAL and app_conference -(1.2 tree) EXPERIMENTAL!!! - -app_conference offers the plusses of being able to do conferencing -without any zaptel hardware or timers as well as doing native codec -streaming, meaning no manditory downsampling to slin like meetme. -These two features alone mean a rather significant performance boost -to companies who only use VOIP for agents and trunks as well as not -requiring the cost of zaptel hardware or the nightmare of getting -ztdummy to work on some systems. - -As of right now, I have a test system fully up and running using -app_conference with VICIDIAL on Asterisk 1.2.8. I have made several -modifications to the app_conference code to make it more of a drop-in -replacement for meetme so that it does not require any changes to the -VICIDIAL codebase. I have added entry and exit sounds(slightly -different from meetme's) as well as "only one in this conference" -message in addition to changing the default member type to speaker(S). -So far I have tested with IAX and SIP channels only and everything -works just like on meetme but I have not done any capacity testing or -tested it in production yet. - -If you want to use app_conference instead of meetme for VICIDIAL then follow these instructions: - -cd /usr/src/asterisk -wget http://www.eflo.net/files/VD_app_conference_0.6.zip -unzip VD_app_conference_0.6.zip -cd app_conference -make clean -make -make install - - -In your extensions.conf file you would replace these lines: -exten => 8600051,1,Meetme,8600051 -exten => 8600052,1,Meetme,8600052 -...continue through 8600100... -exten => 78600051,1,Meetme,8600051|q -exten => 78600052,1,Meetme,8600052|q -...continue through 78600100... -exten => 68600051,1,Meetme,8600051|mq -exten => 68600052,1,Meetme,8600052|mq -...continue through 68600100... - - -with these lines: -exten => 8600051,1,Conference(8600051) -exten => 8600052,1,Conference(8600052) -...continue through 8600100... -exten => 78600051,1,Conference(8600051|q) -exten => 78600052,1,Conference(8600052|q) -...continue through 78600100... -exten => 68600051,1,Conference(8600051|Lq) -exten => 68600052,1,Conference(8600052|Lq) -...continue through 68600100... - -NOTES: -Here are the possible feature flags for this version of app_conference: - o M: Moderator (presently same as speaker) [default] - o S: Speaker - o L: Listener - o T: "Telephone caller" (just for stats?). - o V: Do VAD on this caller - o D: Use Denoise filter on this caller. - o d: Send manager events when DTMF is received. - o q: Do not play enter or exit sounds. - o i: use inband dtmf broadcast. - o t: use rfc dtmf signal broadcast. - -COMPILE NOTES: - -Some Makefile alterations may be necessary for your system: - -From Alek Barkley: -I am running FC4 with latest updates ( 2.6.16 kernel ) -My CPU is AMD K6 and GCC 4.0.2. - -I edited Makefile in app_conference distribution. -To enter CPU architecture in my case -march=k6 -======================================================== -PROC = k6 -# this is fun for x86 -#CFLAGS += -march=pentium3 -msse -mfpmath=sse,387 -CFLAGS += -march=k6 -=========================================================== - diff --git a/app_conference/app_conference.c b/app_conference/app_conference.c deleted file mode 100644 index 9be6c3a3..00000000 --- a/app_conference/app_conference.c +++ /dev/null @@ -1,146 +0,0 @@ - -// $Id: app_conference.c,v 1.22 2005/10/26 21:02:07 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#include "app_conference.h" -#include "common.h" - -/* - -a conference has n + 1 threads, where n is the number of -members and 1 is a conference thread which sends audio -back to the members. - -each member thread reads frames from the channel and -add's them to the member's frame queue. - -the conference thread reads frames from each speaking members -queue, mixes them, and then re-queues them for the member thread -to send back to the user. - -*/ - -// -// app_conference text descriptions -// - -static char *tdesc = "Channel Independent Conference Application" ; -static char *app = "Conference" ; -static char *synopsis = "Channel Independent Conference" ; -static char *descrip = " Conference(): returns 0\n" -"if the user exits with the '#' key, or -1 if the user hangs up.\n" ; - -// -// functions defined in asterisk/module.h -// - -STANDARD_LOCAL_USER ; -LOCAL_USER_DECL; - -int unload_module( void ) -{ - ast_log( LOG_NOTICE, "unloading app_conference module\n" ) ; - - STANDARD_HANGUP_LOCALUSERS ; // defined in asterisk/module.h - - // register conference cli functions - unregister_conference_cli() ; - - return ast_unregister_application( app ) ; -} - -int load_module( void ) -{ - ast_log( LOG_NOTICE, "loading app_conference module [ $Revision: 1.22 $ ]\n" ) ; - - // intialize conference - init_conference() ; - - // register conference cli functions - register_conference_cli() ; - - return ast_register_application( app, app_conference_main, synopsis, descrip ) ; -} - -char *description( void ) -{ - return tdesc ; -} - -int usecount( void ) -{ - int res; - STANDARD_USECOUNT( res ) ; // defined in asterisk/module.h - return res; -} - -char *key() -{ - return ASTERISK_GPL_KEY ; -} - -// -// main app_conference function -// - -int app_conference_main( struct ast_channel* chan, void* data ) -{ - int res = 0 ; - struct localuser *u ; - - // defined in asterisk/module.h - LOCAL_USER_ADD( u ) ; - - // call member thread function - res = member_exec( chan, data ) ; - - // defined in asterisk/module.h - LOCAL_USER_REMOVE( u ) ; - - return res ; -} - -// -// utility functions -// - -// now returns milliseconds -long usecdiff( struct timeval* timeA, struct timeval* timeB ) -{ - long a_secs = timeA->tv_sec - timeB->tv_sec ; - long b_secs = (long)( timeA->tv_usec / 1000 ) - (long)( timeB->tv_usec / 1000 ) ; - long u_secs = ( a_secs * 1000 ) + b_secs ; - return u_secs ; -} - -// increment a timeval by ms milliseconds -void add_milliseconds( struct timeval* tv, long ms ) -{ - // add the microseconds to the microseconds field - tv->tv_usec += ( ms * 1000 ) ; - - // calculate the number of seconds to increment - long s = ( tv->tv_usec / 1000000 ) ; - - // adjust the microsends field - if ( s > 0 ) tv->tv_usec -= ( s * 1000000 ) ; - - // increment the seconds field - tv->tv_sec += s ; - - return ; -} diff --git a/app_conference/app_conference.h b/app_conference/app_conference.h deleted file mode 100644 index 695a65a9..00000000 --- a/app_conference/app_conference.h +++ /dev/null @@ -1,200 +0,0 @@ - -// $Id: app_conference.h,v 1.11 2005/12/16 22:31:58 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#ifndef _ASTERISK_CONF_H -#define _ASTERISK_CONF_H - -#include - -/* asterisk includes */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* standard includes */ -#include -#include -#include -#include - -#include - -#if (SILDET == 2) -#include "libspeex/speex_preprocess.h" -#endif - -// -// app_conference defines -// - -// debug logging level - -// LOG_NOTICE for debugging, LOG_DEBUG for production -#ifdef APP_CONFERENCE_DEBUG -#define AST_CONF_DEBUG LOG_NOTICE -#else -#define AST_CONF_DEBUG LOG_DEBUG -#endif - -// -// feature defines -// - -// number of times the last non-silent frame should be -// repeated after silence starts -//#define AST_CONF_CACHE_LAST_FRAME 1 - -// -// debug defines -// - -#define DEBUG_USE_TIMELOG - -#define DEBUG_FRAME_TIMESTAMPS - -// #define DEBUG_OUTPUT_PCM - -// -// !!! THESE CONSTANTS SHOULD BE CLEANED UP AND CLARIFIED !!! -// - -// -// sample information for AST_FORMAT_SLINEAR format -// - -#define AST_CONF_SAMPLE_RATE 8000 -#define AST_CONF_SAMPLE_SIZE 16 -#define AST_CONF_FRAME_INTERVAL 20 - -// -// so, since we cycle approximately every 20ms, -// we can compute the following values: -// -// 160 samples per 20 ms frame -or- -// ( 8000 samples-per-second * ( 20 ms / 1000 ms-per-second ) ) = 160 samples -// -// 320 bytes ( 2560 bits ) of data 20 ms frame -or- -// ( 160 samples * 16 bits-per-sample / 8 bits-per-byte ) = 320 bytes -// - -// 160 samples 16-bit signed linear -#define AST_CONF_BLOCK_SAMPLES 160 - -// 2 bytes per sample ( i.e. 16-bit ) -#define AST_CONF_BYTES_PER_SAMPLE 2 - -// 320 bytes for each 160 sample frame of 16-bit audio -#define AST_CONF_FRAME_DATA_SIZE 320 - -// 1000 ms-per-second / 20 ms-per-frame = 50 frames-per-second -#define AST_CONF_FRAMES_PER_SECOND ( 1000 / AST_CONF_FRAME_INTERVAL ) - - -// -// buffer and queue values -// - -// account for friendly offset when allocating buffer for frame -#define AST_CONF_BUFFER_SIZE ( AST_CONF_FRAME_DATA_SIZE + AST_FRIENDLY_OFFSET ) - -// maximum number of frames queued per member -#define AST_CONF_MAX_QUEUE 100 - -// minimum number of frames queued per member -#define AST_CONF_MIN_QUEUE 0 - -// number of queued frames before we start dropping -#define AST_CONF_QUEUE_DROP_THRESHOLD 4 - -// number of milliseconds between frame drops -#define AST_CONF_QUEUE_DROP_TIME_LIMIT 750 - -// -// timer and sleep values -// - -// milliseconds we're willing to wait for a channel -// event before we check for outgoing frames -#define AST_CONF_WAITFOR_LATENCY 40 - -// milliseconds to sleep before trying to process frames -#define AST_CONF_CONFERENCE_SLEEP 40 - -// milliseconds to wait between state notification updates -#define AST_CONF_NOTIFICATION_SLEEP 500 - -// -// warning threshold values -// - -// number of frames behind before warning -#define AST_CONF_OUTGOING_FRAMES_WARN 50 - -// number of milliseconds off AST_CONF_FRAME_INTERVAL before warning -#define AST_CONF_INTERVAL_WARNING 1000 - -// -// silence detection values -// - -// toggle silence detection -#define ENABLE_SILENCE_DETECTION 1 - -// silence threshold -#define AST_CONF_SILENCE_THRESHOLD 128 - -// speech tail (delay before dropping silent frames, in ms. -// #define AST_CONF_SPEECH_TAIL 180 - -// number of frames to ignore speex_preprocess() after speech detected -#define AST_CONF_SKIP_SPEEX_PREPROCESS 20 - -// our speex probability values -#define AST_CONF_PROB_START 0.05 -#define AST_CONF_PROB_CONTINUE 0.02 - -// -// format translation values -// - -// AST_FORMAT_MAX_AUDIO is 1 << 15, so we support 0..15 -#define AC_SUPPORTED_FORMATS 16 -#define AC_SLINEAR_INDEX 6 - -// -// app_conference functions -// - -// main module function -int app_conference_main( struct ast_channel* chan, void* data ) ; - -// utility functions -long usecdiff( struct timeval* timeA, struct timeval* timeB ) ; -void add_milliseconds( struct timeval* tv, long ms ) ; - -#endif - - diff --git a/app_conference/cli.c b/app_conference/cli.c deleted file mode 100644 index d5797034..00000000 --- a/app_conference/cli.c +++ /dev/null @@ -1,332 +0,0 @@ - -// $Id: cli.c,v 1.6 2005/12/21 21:34:50 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#include "cli.h" - -// -// debug functions -// - -static char conference_debug_usage[] = - "usage: conference debug [ on | off ]\n" - " enable debugging for a conference\n" -; - -static struct ast_cli_entry cli_debug = { - { "conference", "debug", NULL }, - conference_debug, - "enable debugging for a conference", - conference_debug_usage -} ; - - -int conference_debug( int fd, int argc, char *argv[] ) -{ - if ( argc < 3 ) - return RESULT_SHOWUSAGE ; - - // get the conference name - const char* name = argv[2] ; - - // get the new state - int state = 0 ; - - if ( argc == 3 ) - { - // no state specified, so toggle it - state = -1 ; - } - else - { - if ( strncasecmp( name, "YES", 4 ) == 0 ) - state = 1 ; - else if ( strncasecmp( name, "NO", 3 ) == 0 ) - state = 0 ; - else - return RESULT_SHOWUSAGE ; - } - - int new_state = set_conference_debugging( name, state ) ; - - if ( new_state == 1 ) - { - ast_cli( fd, "enabled conference debugging, name => %s, new_state => %d\n", - name, new_state ) ; - } - else if ( new_state == 0 ) - { - ast_cli( fd, "disabled conference debugging, name => %s, new_state => %d\n", - name, new_state ) ; - } - else - { - // error setting state - ast_cli( fd, "\nunable to set debugging state, name => %s\n\n", name ) ; - } - - return RESULT_SUCCESS ; -} - -// -// stats functions -// - -static char conference_show_stats_usage[] = - "usage: conference show stats\n" - " display stats for active conferences.\n" -; - -static struct ast_cli_entry cli_show_stats = { - { "conference", "show", "stats", NULL }, - conference_show_stats, - "show conference stats", - conference_show_stats_usage -} ; - -int conference_show_stats( int fd, int argc, char *argv[] ) -{ - if ( argc < 3 ) - return RESULT_SHOWUSAGE ; - - // get count of active conferences - int count = get_conference_count() ; - - ast_cli( fd, "\n\nCONFERENCE STATS, ACTIVE( %d )\n\n", count ) ; - - // if zero, go no further - if ( count <= 0 ) - return RESULT_SUCCESS ; - - // - // get the conference stats - // - - // array of stats structs - ast_conference_stats stats[ count ] ; - - // get stats structs - count = get_conference_stats( stats, count ) ; - - // make sure we were able to fetch some - if ( count <= 0 ) - { - ast_cli( fd, "!!! error fetching conference stats, available => %d !!!\n", count ) ; - return RESULT_SUCCESS ; - } - - // - // output the conference stats - // - - // output header - ast_cli( fd, "%-20.20s %-40.40s %-40.40s\n", "Name", "Connection Type", "Member Type" ) ; - ast_cli( fd, "%-20.20s %-40.40s %-40.40s\n", "----", "---------------", "-----------" ) ; - - ast_conference_stats* s = NULL ; - - char ct[64] ; - char mt[64] ; - - int i; - for ( i = 0 ; i < count ; ++i ) - { - s = &(stats[i]) ; - - // format connection type - snprintf( ct, 40, "phone( %d ), iax( %d ), sip( %d )", - s->phone, s->iaxclient, s->sip ) ; - - // format memeber type - snprintf( mt, 40, "moderators( %d ), listeners( %d )", - s->moderators, s->listeners ) ; - - // output this conferences stats - ast_cli( fd, "%-20.20s %-40.40s %-40.40s\n", (char*)( &(s->name) ), ct, mt ) ; - } - - ast_cli( fd, "\n" ) ; - - // - // drill down to specific stats - // - - if ( argc == 4 ) - { - // show stats for a particular conference - conference_show_stats_name( fd, argv[3] ) ; - } - - return RESULT_SUCCESS ; -} - -int conference_show_stats_name( int fd, const char* name ) -{ - // not implemented yet - return RESULT_SUCCESS ; -} - -// -// play sound -// - -static char conference_play_sound_usage[] = - "usage: conference play sound [mute]\n" - " play sound to conference member .\n" - " mute the channel if 'mute' is present.\n" -; - -static struct ast_cli_entry cli_play_sound = { - { "conference", "play", "sound", NULL }, - conference_play_sound, - "play a sound to a conference member", - conference_play_sound_usage -} ; - -int conference_play_sound( int fd, int argc, char *argv[] ) -{ - char *channel, *file; - int mute = 0; - struct ast_conf_member *member; - struct ast_conf_soundq *newsound; - struct ast_conf_soundq **q; - - if ( argc < 5 ) - return RESULT_SHOWUSAGE ; - - channel = argv[3]; - file = argv[4]; - - if(argc > 5 && !strcmp(argv[5], "mute")) - mute = 1; - - - member = find_member(channel, 1); - if(!member) { - ast_cli(fd, "Member %s not found\n", channel); - return RESULT_FAILURE; - } - - newsound = calloc(1,sizeof(struct ast_conf_soundq)); - newsound->stream = ast_openstream(member->chan, file, NULL); - if(!newsound->stream) { - ast_cli(fd, "Sound %s not found\n", file); - free(newsound); - ast_mutex_unlock(&member->lock); - return RESULT_FAILURE; - } - member->chan->stream = NULL; - - newsound->muted = mute; - ast_copy_string(newsound->name, file, sizeof(newsound->name)); - - // append sound to the end of the list. - for(q=&member->soundq; *q; q = &((*q)->next)) ;; - - *q = newsound; - - ast_mutex_unlock(&member->lock); - - ast_cli( fd, "Playing sound %s to member %s %s\n", - file, channel, mute ? "with mute" : ""); - - - return RESULT_SUCCESS ; -} - -// -// stop sounds -// - -static char conference_stop_sounds_usage[] = - "usage: conference stop sounds \n" - " stop sounds for conference member .\n" -; - -static struct ast_cli_entry cli_stop_sounds = { - { "conference", "stop", "sounds", NULL }, - conference_stop_sounds, - "stop sounds for a conference member", - conference_stop_sounds_usage -} ; - -int conference_stop_sounds( int fd, int argc, char *argv[] ) -{ - char *channel; - struct ast_conf_member *member; - struct ast_conf_soundq *sound; - struct ast_conf_soundq *next; - - if ( argc < 4 ) - return RESULT_SHOWUSAGE ; - - channel = argv[3]; - - member = find_member(channel, 1); - if(!member) { - ast_cli(fd, "Member %s not found\n", channel); - return RESULT_FAILURE; - } - - - - // clear all sounds - sound = member->soundq; - member->soundq = NULL; - - while(sound) { - next = sound->next; - ast_closestream(sound->stream); - free(sound); - sound = next; - } - - // reset write format, since we're done playing the sound - if ( ast_set_write_format( member->chan, member->write_format ) < 0 ) - { - ast_log( LOG_ERROR, "unable to set write format to %d\n", - member->write_format ) ; - } - - ast_mutex_unlock(&member->lock); - - ast_cli( fd, "Stopped sounds to member %s\n", channel); - - - return RESULT_SUCCESS ; -} - - -// -// cli initialization function -// - -void register_conference_cli( void ) -{ - ast_cli_register( &cli_debug ) ; - ast_cli_register( &cli_show_stats ) ; - ast_cli_register( &cli_play_sound ) ; - ast_cli_register( &cli_stop_sounds ) ; -} - -void unregister_conference_cli( void ) -{ - ast_cli_unregister( &cli_debug ) ; - ast_cli_unregister( &cli_show_stats ) ; - ast_cli_unregister( &cli_play_sound ) ; - ast_cli_unregister( &cli_stop_sounds ) ; -} diff --git a/app_conference/cli.h b/app_conference/cli.h deleted file mode 100644 index 735b284d..00000000 --- a/app_conference/cli.h +++ /dev/null @@ -1,47 +0,0 @@ - -// $Id: cli.h,v 1.3 2005/10/26 21:02:07 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#ifndef _APP_CONF_CLI_H -#define _APP_CONF_CLI_H - -// -// includes -// - -#include "app_conference.h" -#include "common.h" - -// -// function declarations -// - -int conference_show_stats( int fd, int argc, char *argv[] ) ; -int conference_show_stats_name( int fd, const char* name ) ; - - -int conference_debug( int fd, int argc, char *argv[] ) ; -int conference_no_debug( int fd, int argc, char *argv[] ) ; - -int conference_play_sound( int fd, int argc, char *argv[] ) ; -int conference_stop_sounds( int fd, int argc, char *argv[] ) ; - -void register_conference_cli( void ) ; -void unregister_conference_cli( void ) ; - - -#endif diff --git a/app_conference/common.h b/app_conference/common.h deleted file mode 100644 index a8015462..00000000 --- a/app_conference/common.h +++ /dev/null @@ -1,50 +0,0 @@ - -// $Id: common.h,v 1.3 2005/10/26 21:02:07 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#ifndef _APP_CONF_COMMON_H -#define _APP_CONF_COMMON_H - -// typedef includes -#include "conf_frame.h" - -// function includesee -#include "conference.h" -#include "member.h" -#include "frame.h" -#include "cli.h" - - -/* Utility functions */ - -/* LOG the time taken to execute a function (like lock acquisition */ -#if 1 -#define TIMELOG(func,min,message) \ - do { \ - struct timeval t1, t2; \ - int diff; \ - gettimeofday(&t1,NULL); \ - func; \ - gettimeofday(&t2,NULL); \ - if((diff = usecdiff(&t2, &t1)) > min) \ - ast_log( AST_CONF_DEBUG, "TimeLog: %s: %d ms\n", message, diff); \ - } while (0) -#else -#define TIMELOG(func,min,message) func -#endif - -#endif diff --git a/app_conference/conf_frame.h b/app_conference/conf_frame.h deleted file mode 100644 index 24cac7f9..00000000 --- a/app_conference/conf_frame.h +++ /dev/null @@ -1,61 +0,0 @@ - -// $Id: conf_frame.h,v 1.3 2005/10/26 21:02:07 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#ifndef _APP_CONF_STRUCTS_H -#define _APP_CONF_STRUCTS_H - -// -// includes -// - -#include "app_conference.h" -#include "common.h" - -// -// struct declarations -// - -typedef struct conf_frame -{ - // frame audio data - struct ast_frame* fr ; - - // array of converted versions for listeners - struct ast_frame* converted[ AC_SUPPORTED_FORMATS ] ; - - // pointer to the frame's owner - struct ast_conf_member* member ; // who sent this frame - - // frame meta data -// struct timeval timestamp ; -// unsigned long cycleid ; -// int priority ; - - // linked-list pointers - struct conf_frame* next ; - struct conf_frame* prev ; - - // should this frame be preserved - short static_frame ; - - // pointer to mixing buffer - char* mixed_buffer ; -} conf_frame ; - - -#endif diff --git a/app_conference/conference.c b/app_conference/conference.c deleted file mode 100644 index 4bdb64ca..00000000 --- a/app_conference/conference.c +++ /dev/null @@ -1,1410 +0,0 @@ - -// $Id: conference.c,v 1.7 2005/10/27 17:53:35 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#include "conference.h" -#include "regex.h" - -// -// static variables -// - -// single-linked list of current conferences -static struct ast_conference *conflist = NULL ; - -// mutex for synchronizing access to conflist -AST_MUTEX_DEFINE_STATIC(conflist_lock); -//static ast_mutex_t conflist_lock = AST_MUTEX_INITIALIZER ; - -// mutex for synchronizing calls to start_conference() and remove_conf() -AST_MUTEX_DEFINE_STATIC(start_stop_conf_lock); -//static ast_mutex_t start_stop_conf_lock = AST_MUTEX_INITIALIZER ; - -static int conference_count = 0 ; - -// -// main conference function -// - -void conference_exec( struct ast_conference *conf ) -{ - - struct ast_conf_member *member, *temp_member , *membertest; - struct conf_frame *cfr, *spoken_frames, *send_frames ; - - // count number of speakers, number of listeners - int speaker_count ; - int listener_count ; - - ast_log( AST_CONF_DEBUG, "[ $Revision: 1.7 $ ] entered conference_exec, name => %s\n", conf->name ) ; - - // timer timestamps - struct timeval base, curr, notify ; - gettimeofday( &base, NULL ) ; - gettimeofday( ¬ify, NULL ) ; - - // holds differences of curr and base - long time_diff = 0 ; - long time_sleep = 0 ; - - int since_last_slept = 0 ; - - // - // variables for checking thread frequency - // - - // count to AST_CONF_FRAMES_PER_SECOND - int tf_count = 0 ; - long tf_diff = 0 ; - float tf_frequency = 0.0 ; - - struct timeval tf_base, tf_curr ; - gettimeofday( &tf_base, NULL ) ; - - // - // main conference thread loop - // - - - while ( 42 == 42 ) - { - // update the current timestamp - gettimeofday( &curr, NULL ) ; - - // calculate difference in timestamps - time_diff = usecdiff( &curr, &base ) ; - - // calculate time we should sleep - time_sleep = AST_CONF_FRAME_INTERVAL - time_diff ; - - if ( time_sleep > 0 ) - { - // sleep for sleep_time ( as milliseconds ) - usleep( time_sleep * 1000 ) ; - - // reset since last slept counter - since_last_slept = 0 ; - - continue ; - } - else - { - // long sleep warning - if ( - since_last_slept == 0 - && time_diff > AST_CONF_CONFERENCE_SLEEP * 2 - ) - { - ast_log( - AST_CONF_DEBUG, - "long scheduling delay, time_diff => %ld, AST_CONF_FRAME_INTERVAL => %d\n", - time_diff, AST_CONF_FRAME_INTERVAL - ) ; - } - - // increment times since last slept - ++since_last_slept ; - - // sleep every other time - if ( since_last_slept % 2 ) - usleep( 0 ) ; - } - - // adjust the timer base ( it will be used later to timestamp outgoing frames ) - add_milliseconds( &base, AST_CONF_FRAME_INTERVAL ) ; - - // - // check thread frequency - // - - if ( ++tf_count >= AST_CONF_FRAMES_PER_SECOND ) - { - // update current timestamp - gettimeofday( &tf_curr, NULL ) ; - - // compute timestamp difference - tf_diff = usecdiff( &tf_curr, &tf_base ) ; - - // compute sampling frequency - tf_frequency = ( float )( tf_diff ) / ( float )( tf_count ) ; - - if ( - ( tf_frequency <= ( float )( AST_CONF_FRAME_INTERVAL - 1 ) ) - || ( tf_frequency >= ( float )( AST_CONF_FRAME_INTERVAL + 1 ) ) - ) - { - ast_log( - LOG_WARNING, - "processed frame frequency variation, name => %s, tf_count => %d, tf_diff => %ld, tf_frequency => %2.4f\n", - conf->name, tf_count, tf_diff, tf_frequency - ) ; - } - - // reset values - tf_base = tf_curr ; - tf_count = 0 ; - } - - //-----------------// - // INCOMING FRAMES // - //-----------------// - - // ast_log( AST_CONF_DEBUG, "PROCESSING FRAMES, conference => %s, step => %d, ms => %ld\n", - // conf->name, step, ( base.tv_usec / 20000 ) ) ; - - // acquire conference mutex - TIMELOG(ast_mutex_lock( &conf->lock ),1,"conf thread conf lock"); - - // update the current delivery time - conf->delivery_time = base ; - - // - // loop through the list of members - // ( conf->memberlist is a single-linked list ) - // - - // ast_log( AST_CONF_DEBUG, "begin processing incoming audio, name => %s\n", conf->name ) ; - - // reset speaker and listener count - speaker_count = 0 ; - listener_count = 0 ; - - // get list of conference members - member = conf->memberlist ; - - // reset pointer lists - spoken_frames = NULL ; - - // loop over member list to retrieve queued frames - while ( member != NULL ) - { - // acquire member mutex - TIMELOG(ast_mutex_lock( &member->lock ),1,"conf thread member lock") ; - - // check for dead members - if ( member->remove_flag == 1 ) - { - // leave message for other members of the conference - membertest = conf->memberlist ; - - int silent_exit = 0 ; - if (member->quiet_entry_exit == -1) - { - silent_exit = 1 ; - } - - while (membertest != NULL) - { - if (silent_exit < 1) - { - if(!strcmp(membertest->channel_name, member->channel_name)) - { - ast_log( LOG_ERROR, "skipping leave message on %s\n", membertest->channel_name ) ; - } - else - { - if (!basic_play_sound ( membertest->channel_name, "leave" )) - { - ast_log( LOG_ERROR, "playing conference leave message FAILED on %s\n", membertest->channel_name ) ; - } - } - } - else - { - ast_log( LOG_NOTICE, "skipping all entry messages on %s\n", membertest->channel_name ) ; - } - membertest = membertest->next; - } - - - ast_log( LOG_NOTICE, "found member slated for removal, channel => %s\n", member->channel_name ) ; - temp_member = member->next ; - remove_member( member, conf ) ; - member = temp_member ; - continue ; - } - - // get speaking member's audio frames, - if ( member->type == 'L' ) - { - // listeners never have frames - cfr = NULL ; - } - else - { - // tell member the number of frames we're going to need ( used to help dropping algorithm ) - member->inFramesNeeded = ( time_diff / AST_CONF_FRAME_INTERVAL ) - 1 ; - -// !!! TESTING !!! -if ( - conf->debug_flag == 1 - && member->inFramesNeeded > 0 -) -{ - ast_log( AST_CONF_DEBUG, "channel => %s, inFramesNeeded => %d, inFramesCount => %d\n", - member->channel_name, member->inFramesNeeded, member->inFramesCount ) ; -} - - // non-listener member should have frames, - // unless silence detection dropped them - cfr = get_incoming_frame( member ) ; - } - - // handle retrieved frames - if ( cfr == NULL ) - { - // this member is listen-only, or has not spoken - // ast_log( AST_CONF_DEBUG, "silent member, channel => %s\n", member->channel_name ) ; - -// !!! TESTING !!! -#if 0 -if ( member->speaking_state == 1 ) -{ - ast_log( AST_CONF_DEBUG, "member has stopped speaking, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount ) ; -} -#endif -if ( conf->debug_flag == 1 ) -{ - ast_log( AST_CONF_DEBUG, "member is silent, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount ) ; -} - - // mark member as silent - member->speaking_state = 0 ; - - // count the listeners - ++listener_count ; - } - else if ( cfr->fr == NULL ) - { - ast_log( AST_CONF_DEBUG, "got incoming conf_frame with null ast_frame\n" ) ; - -// !!! TESTING !!! -#if 0 -if ( member->speaking_state == 1 ) -{ - ast_log( AST_CONF_DEBUG, "member has stopped speaking, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount ) ; -} -#endif -if ( conf->debug_flag == 1 ) -{ - ast_log( AST_CONF_DEBUG, "member is silent, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount ) ; -} - - // mark member as silent - member->speaking_state = 0 ; - - // count the listeners - ++listener_count ; - } - else - { - // this speaking member has spoken - // ast_log( AST_CONF_DEBUG, "speaking member, channel => %s\n", member->channel_name ) ; - - // append the frame to the list of spoken frames - if ( spoken_frames != NULL ) - { - // add new frame to end of list - cfr->next = spoken_frames ; - spoken_frames->prev = cfr ; - } - - // point the list at the new frame - spoken_frames = cfr ; - -// !!! TESTING !!! -#if 0 -if ( member->speaking_state == 0 ) -{ - ast_log( AST_CONF_DEBUG, "member has started speaking, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount ) ; -} -#endif -if ( conf->debug_flag == 1 ) -{ - ast_log( AST_CONF_DEBUG, "member is speaking, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount ) ; -} - - // mark member as speaker - member->speaking_state = 1 ; - member->speaking_state_notify = 1 ; - - // count the speakers - ++speaker_count ; - } - - // release member mutex - ast_mutex_unlock( &member->lock ) ; - - // adjust our pointer to the next inline - member = member->next ; - } - - // - // break, if we have no more members - // - - if ( conf->membercount == 0 ) - { - ast_log( LOG_NOTICE, "removing conference, count => %d, name => %s\n", conf->membercount, conf->name ) ; - remove_conf( conf ) ; // stop the conference - break ; // break from main processing loop - } - - // ast_log( AST_CONF_DEBUG, "finished processing incoming audio, name => %s\n", conf->name ) ; - - - //---------------// - // MIXING FRAMES // - //---------------// - - // mix frames and get batch of outgoing frames - send_frames = mix_frames( spoken_frames, speaker_count, listener_count ) ; - - // accounting: if there are frames, count them as one incoming frame - if ( send_frames != NULL ) - { - // set delivery timestamp - // set_conf_frame_delivery( send_frames, base ) ; - - // ast_log( AST_CONF_DEBUG, "base => %ld.%ld %d\n", base.tv_sec, base.tv_usec, ( int )( base.tv_usec / 1000 ) ) ; - - conf->stats.frames_in++ ; - } - - //-----------------// - // OUTGOING FRAMES // - //-----------------// - - - // - // queue send frames - // - - // ast_log( AST_CONF_DEBUG, "begin queueing outgoing audio, name => %s\n", conf->name ) ; - - // - // loop over member list to queue outgoing frames - // - for ( member = conf->memberlist ; member != NULL ; member = member->next ) - { - // skip members that are not ready - if ( member->ready_for_outgoing == 0 ) - continue ; - - if ( member->speaking_state == 0 ) - { - // queue listener frame - queue_frame_for_listener( conf, member, send_frames ) ; - } - else - { - // queue speaker frame - queue_frame_for_speaker( conf, member, send_frames ) ; - } - } - - // ast_log( AST_CONF_DEBUG, "end queueing outgoing audio, name => %s\n", conf->name ) ; - - //---------// - // CLEANUP // - //---------// - - // clean up send frames - while ( send_frames != NULL ) - { - // accouting: count all frames and mixed frames - if ( send_frames->member == NULL ) - conf->stats.frames_out++ ; - else - conf->stats.frames_mixed++ ; - - // delete the frame - send_frames = delete_conf_frame( send_frames ) ; - } - - // - // notify the manager of state changes every 500 milliseconds - // - - if ( ( usecdiff( &curr, ¬ify ) / AST_CONF_NOTIFICATION_SLEEP ) >= 1 ) - { - // send the notifications - send_state_change_notifications( conf->memberlist ) ; - - // increment the notification timer base - add_milliseconds( ¬ify, AST_CONF_NOTIFICATION_SLEEP ) ; - } - - // release conference mutex - ast_mutex_unlock( &conf->lock ) ; - - // !!! TESTING !!! - // usleep( 1 ) ; - } - // end while ( 42 == 42 ) - - // - // exit the conference thread - // - - ast_log( AST_CONF_DEBUG, "exit conference_exec\n" ) ; - - // exit the thread - pthread_exit( NULL ) ; - - return ; -} - -// -// manange conference functions -// - -// called by app_conference.c:load_module() -void init_conference( void ) -{ - ast_mutex_init( &start_stop_conf_lock ) ; - ast_mutex_init( &conflist_lock ) ; -} - -struct ast_conference* start_conference( struct ast_conf_member* member ) -{ - // check input - if ( member == NULL ) - { - ast_log( LOG_WARNING, "unable to handle null member\n" ) ; - return NULL ; - } - - struct ast_conference* conf = NULL ; - - // acquire mutex - ast_mutex_lock( &start_stop_conf_lock ) ; - - // look for an existing conference - ast_log( AST_CONF_DEBUG, "attempting to find requested conference\n" ) ; - conf = find_conf( member->id ) ; - - // unable to find an existing conference, try to create one - if ( conf == NULL ) - { - // create a new conference - ast_log( AST_CONF_DEBUG, "attempting to create requested conference\n" ) ; - - // create the new conference with one member - conf = create_conf( member->id, member ) ; - - // return an error if create_conf() failed - if ( conf == NULL ) - { - ast_log( LOG_ERROR, "unable to find or create requested conference\n" ) ; - ast_mutex_unlock( &start_stop_conf_lock ) ; // release mutex - return NULL ; - } - } - else - { - // - // existing conference found, add new member to the conference - // - // once we call add_member(), this thread - // is responsible for calling delete_member() - // - add_member( member, conf ) ; - - } - - // release mutex - ast_mutex_unlock( &start_stop_conf_lock ) ; - - return conf ; -} - - -struct ast_conference* find_conf( const char* name ) -{ - // no conferences exist - if ( conflist == NULL ) - { - ast_log( AST_CONF_DEBUG, "conflist has not yet been initialized, name => %s\n", name ) ; - return NULL ; - } - - // acquire mutex - ast_mutex_lock( &conflist_lock ) ; - - struct ast_conference *conf = conflist ; - - // loop through conf list - while ( conf != NULL ) - { - if ( strncasecmp( (char*)&(conf->name), name, 80 ) == 0 ) - { - // found conf name match - ast_log( AST_CONF_DEBUG, "found conference in conflist, name => %s\n", name ) ; - break ; - } - - conf = conf->next ; - } - - // release mutex - ast_mutex_unlock( &conflist_lock ) ; - - if ( conf == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to find conference in conflist, name => %s\n", name ) ; - } - - return conf ; -} - -struct ast_conference* create_conf( char* name, struct ast_conf_member* member ) -{ - ast_log( AST_CONF_DEBUG, "entered create_conf, name => %s\n", name ) ; - - // - // allocate memory for conference - // - - struct ast_conference *conf = malloc( sizeof( struct ast_conference ) ) ; - - if ( conf == NULL ) - { - ast_log( LOG_ERROR, "unable to malloc ast_conference\n" ) ; - return NULL ; - } - - // - // initialize conference - // - - conf->next = NULL ; - conf->memberlist = NULL ; - - conf->membercount = 0 ; - conf->conference_thread = -1 ; - - conf->debug_flag = 0 ; - - // zero stats - memset( &conf->stats, 0x0, sizeof( ast_conference_stats ) ) ; - - // record start time - gettimeofday( &conf->stats.time_entered, NULL ) ; - - // copy name to conference - strncpy( (char*)&(conf->name), name, sizeof(conf->name) - 1 ) ; - strncpy( (char*)&(conf->stats.name), name, sizeof(conf->name) - 1 ) ; - - // initialize mutexes - ast_mutex_init( &conf->lock ) ; - - // build translation paths - - int c; - for ( c = 0 ; c < AC_SUPPORTED_FORMATS ; ++c ) - { - if ( c == AC_SLINEAR_INDEX ) - conf->from_slinear_paths[ c ] = NULL; - else - conf->from_slinear_paths[ c ] =ast_translator_build_path( 1 << c, AST_FORMAT_SLINEAR); - } - - // add the initial member - add_member( member, conf ) ; - - // - // prepend new conference to conflist - // - - // acquire mutex - ast_mutex_lock( &conflist_lock ) ; - - conf->next = conflist ; - conflist = conf ; - - ast_log( AST_CONF_DEBUG, "added new conference to conflist, name => %s\n", name ) ; - - // - // spawn thread for new conference, using conference_exec( conf ) - // - - // acquire conference mutexes - ast_mutex_lock( &conf->lock ) ; - - if ( pthread_create( &conf->conference_thread, NULL, (void*)conference_exec, conf ) == 0 ) - { - // detach the thread so it doesn't leak - pthread_detach( conf->conference_thread ) ; - - // release conference mutexes - ast_mutex_unlock( &conf->lock ) ; - - ast_log( AST_CONF_DEBUG, "started conference thread for conference, name => %s\n", conf->name ) ; - } - else - { - ast_log( LOG_ERROR, "unable to start conference thread for conference %s\n", conf->name ) ; - - conf->conference_thread = -1 ; - - // release conference mutexes - ast_mutex_unlock( &conf->lock ) ; - - // clean up conference - free( conf ) ; - conf = NULL ; - } - - // count new conference - if ( conf != NULL ) - ++conference_count ; - - // release mutex - ast_mutex_unlock( &conflist_lock ) ; - - return conf ; -} - -void remove_conf( struct ast_conference *conf ) -{ - // ast_log( AST_CONF_DEBUG, "attempting to remove conference, name => %s\n", conf->name ) ; - - struct ast_conference *conf_current = conflist ; - struct ast_conference *conf_temp = NULL ; - - // acquire mutex - ast_mutex_lock( &start_stop_conf_lock ) ; - - // acquire mutex - ast_mutex_lock( &conflist_lock ) ; - - // loop through list of conferences - while ( conf_current != NULL ) - { - // if conf_current point to the passed conf, - if ( conf_current == conf ) - { - if ( conf_temp == NULL ) - { - // this is the first conf in the list, so we just point - // conflist past the current conf to the next - conflist = conf_current->next ; - } - else - { - // this is not the first conf in the list, so we need to - // point the preceeding conf to the next conf in the list - conf_temp->next = conf_current->next ; - } - - // - // do some frame clean up - // - int c; - for ( c = 0 ; c < AC_SUPPORTED_FORMATS ; ++c ) - { - // free the translation paths - if ( conf_current->from_slinear_paths[ c ] != NULL ) - { - ast_translator_free_path( conf_current->from_slinear_paths[ c ] ) ; - conf_current->from_slinear_paths[ c ] = NULL ; - } - } - - // calculate time in conference - struct timeval time_exited ; - gettimeofday( &time_exited, NULL ) ; - - // total time converted to seconds - long tt = ( usecdiff( &time_exited, &conf_current->stats.time_entered ) / 1000 ) ; - - // report accounting information - ast_log( LOG_NOTICE, "conference accounting, fi => %ld, fo => %ld, fm => %ld, tt => %ld\n", - conf_current->stats.frames_in, conf_current->stats.frames_out, conf_current->stats.frames_mixed, tt ) ; - - ast_log( AST_CONF_DEBUG, "removed conference, name => %s\n", conf_current->name ) ; - - ast_mutex_unlock( &conf_current->lock ) ; - - free( conf_current ) ; - conf_current = NULL ; - - break ; - } - - // save a refence to the soon to be previous conf - conf_temp = conf_current ; - - // move conf_current to the next in the list - conf_current = conf_current->next ; - } - - // count new conference - --conference_count ; - - // release mutex - ast_mutex_unlock( &conflist_lock ) ; - - // release mutex - ast_mutex_unlock( &start_stop_conf_lock ) ; - - return ; -} - -// -// member-related functions -// - -void add_member( struct ast_conf_member *member, struct ast_conference *conf ) -{ - if ( conf == NULL ) - { - ast_log( LOG_ERROR, "unable to add member to NULL conference\n" ) ; - return ; - } - - // acquire the conference lock - ast_mutex_lock( &conf->lock ) ; - - member->next = conf->memberlist ; // next is now list - conf->memberlist = member ; // member is now at head of list - - // update conference stats - count_member( member, conf, 1 ) ; - - ast_log( AST_CONF_DEBUG, "member added to conference, name => %s\n", conf->name ) ; - - // release the conference lock - ast_mutex_unlock( &conf->lock ) ; - - return ; -} - -int remove_member( struct ast_conf_member* member, struct ast_conference* conf ) -{ - // check for member - if ( member == NULL ) - { - ast_log( LOG_WARNING, "unable to remove NULL member\n" ) ; - return -1 ; - } - - // check for conference - if ( conf == NULL ) - { - ast_log( LOG_WARNING, "unable to remove member from NULL conference\n" ) ; - return -1 ; - } - - // - // loop through the member list looking - // for the requested member - // - - struct ast_conf_member *member_list = conf->memberlist ; - struct ast_conf_member *member_temp = NULL ; - - int count = -1 ; // default return code - - while ( member_list != NULL ) - { - if ( member_list == member ) - { - // - // log some accounting information - // - - // calculate time in conference - struct timeval time_exited ; - gettimeofday( &time_exited, NULL ) ; - long tt = ( usecdiff( &time_exited, &member->time_entered ) / 1000 ) ; // convert to seconds - - ast_log( - LOG_NOTICE, - "member accounting, channel => %s, te => %ld, fi => %ld, fid => %ld, fo => %ld, fod => %ld, tt => %ld\n", - member->channel_name, - member->time_entered.tv_sec, member->frames_in, member->frames_in_dropped, - member->frames_out, member->frames_out_dropped, tt - ) ; - - // - // if this is the first member in the linked-list, - // skip over the first member in the list, else - // - // point the previous 'next' to the current 'next', - // thus skipping the current member in the list - // - if ( member_temp == NULL ) - conf->memberlist = member->next ; - else - member_temp->next = member->next ; - - // update conference stats - count = count_member( member, conf, 0 ) ; - - // delete the member - delete_member( member ) ; - - ast_log( AST_CONF_DEBUG, "removed member from conference, name => %s, remaining => %d\n", conf->name, conf->membercount ) ; - - break ; - } - - // save a pointer to the current member, - // and then point to the next member in the list - member_temp = member_list ; - member_list = member_list->next ; - } - - // return -1 on error, or the number of members - // remaining if the requested member was deleted - return count ; -} - -int count_member( struct ast_conf_member* member, struct ast_conference* conf, short add_member ) -{ - if ( member == NULL || conf == NULL ) - { - ast_log( LOG_WARNING, "unable to count member\n" ) ; - return -1 ; - } - - short delta = ( add_member == 1 ) ? 1 : -1 ; - - // member type - if ( memberIsModerator( member ) == 1 ) - { - conf->stats.moderators += delta ; - } - else - { - // count non-moderators as listeners - conf->stats.listeners += delta ; - } - - // connection type - if ( memberIsPhoneClient( member ) == 1 ) - { - conf->stats.phone += delta ; - } - else if ( memberIsIaxClient( member ) == 1 ) - { - conf->stats.iaxclient += delta ; - } - else if ( memberIsSIPClient( member ) == 1 ) - { - conf->stats.sip += delta ; - } - - // increment member count - conf->membercount += delta ; - - return conf->membercount ; -} - -// -// queue incoming frame functions -// - -int queue_frame_for_speaker( - struct ast_conference* conf, - struct ast_conf_member* member, - conf_frame* frame -) -{ - // - // check inputs - // - - if ( conf == NULL ) - { - ast_log( LOG_WARNING, "unable to queue speaker frame with null conference\n" ) ; - return -1 ; - } - - if ( member == NULL ) - { - ast_log( LOG_WARNING, "unable to queue speaker frame with null member\n" ) ; - return -1 ; - } - - // - // loop over spoken frames looking for member's appropriate match - // - - short found_flag = 0 ; - struct ast_frame* qf ; - - for ( ; frame != NULL ; frame = frame->next ) - { - if ( frame->member != member ) - continue ; - - if ( frame->fr == NULL ) - { - ast_log( LOG_WARNING, "unable to queue speaker frame with null data\n" ) ; - continue ; - } - - // - // convert and queue frame - // - - // short-cut pointer to the ast_frame - qf = frame->fr ; - - // acquire member lock - TIMELOG(ast_mutex_lock( &member->lock ),1,"queue_frame_for_speaker: memberlock") ; - - if ( qf->subclass == member->write_format ) - { - // frame is already in correct format, so just queue it - queue_outgoing_frame( member, qf, conf->delivery_time ) ; - } - else - { - // - // convert frame to member's write format - // ( calling ast_frdup() to make sure the translator's copy sticks around ) - // - qf = convert_frame_from_slinear( member->from_slinear, ast_frdup( qf ) ) ; - - if ( qf != NULL ) - { - // queue frame - queue_outgoing_frame( member, qf, conf->delivery_time ) ; - - // free frame ( the translator's copy ) - ast_frfree( qf ) ; - } - else - { - ast_log( LOG_WARNING, "unable to translate outgoing speaker frame, channel => %s\n", member->channel_name ) ; - } - } - - // release member lock - ast_mutex_unlock( &member->lock ) ; - - // set found flag - found_flag = 1 ; - - // we found the frame, skip to the next member - break ; - } - - // queue a silent frame - if ( found_flag == 0 ) - queue_silent_frame( conf, member ) ; - - return 0 ; -} - -int queue_frame_for_listener( - struct ast_conference* conf, - struct ast_conf_member* member, - conf_frame* frame -) -{ - // - // check inputs - // - - if ( conf == NULL ) - { - ast_log( LOG_WARNING, "unable to queue listener frame with null conference\n" ) ; - return -1 ; - } - - if ( member == NULL ) - { - ast_log( LOG_WARNING, "unable to queue listener frame with null member\n" ) ; - return -1 ; - } - - // - // loop over spoken frames looking for member's appropriate match - // - - short found_flag = 0 ; - struct ast_frame* qf ; - - for ( ; frame != NULL ; frame = frame->next ) - { - // we're looking for a null or matching member - if ( frame->member != NULL && frame->member != member ) - continue ; - - if ( frame->fr == NULL ) - { - ast_log( LOG_WARNING, "unknown error queueing frame for listener, frame->fr == NULL\n" ) ; - continue ; - } - - // acquire member lock - TIMELOG(ast_mutex_lock( &member->lock ),1,"queue_frame_for_listener") ; - - // first, try for a pre-converted frame - qf = frame->converted[ member->write_format_index ] ; - - /* - if ( qf != NULL && (member->smooth_size_out > 0)) { - if (qf->datalen != member->smooth_size_out ) { -//ast_log (AST_CONF_DEBUG, "ignoring and freeing previously stored frame, with datalen=>%d != smooth_size_out=>%d\n",qf->datalen,member->smooth_size_out); - ast_frfree( qf ) ; - qf = NULL ; - } - } - */ - - // convert ( and store ) the frame - if ( qf == NULL ) - { - // make a copy of the slinear version of the frame - qf = ast_frdup( frame->fr ) ; - - if ( qf == NULL ) - { - ast_log( LOG_WARNING, "unable to duplicate frame\n" ) ; - continue ; - } - - // convert using the conference's translation path - qf = convert_frame_from_slinear( conf->from_slinear_paths[ member->write_format_index ], qf ) ; - if ( qf == NULL ) - ast_log( LOG_WARNING, "unable to translate frame for listener, channel => %s , member->write_format => %d , member->write_format_index %d , qf->frametype -> %d , qf->subclass -> %d, qf->datalen=> %d, qf->samples =>%d\n", member->channel_name , member->write_format, member->write_format_index, qf->frametype, qf->subclass , qf->datalen, qf->samples) ; - - // store the converted frame - // ( the frame will be free'd next time through the loop ) - frame->converted[ member->write_format_index ] = qf ; -//ast_log (AST_CONF_DEBUG, "storing converted frame into index=>%d, qf->frametype=>%d, qf->subclass=%d, qf->datalen=%d \n",member->write_format_index, qf->frametype, qf->subclass, qf->datalen); - } - - if ( qf != NULL ) - { - // duplicate the frame before queue'ing it - // ( since this member doesn't own this _shared_ frame ) - // qf = ast_frdup( qf ) ; - - if ( queue_outgoing_frame( member, qf, conf->delivery_time ) != 0 ) - { - // free the new frame if it couldn't be queue'd - ast_frfree( qf ) ; - qf = NULL ; - } - } - else - { - ast_log( LOG_WARNING, "unable to translate outgoing listener frame, channel => %s\n", member->channel_name ) ; - } - - // release member lock - ast_mutex_unlock( &member->lock ) ; - - // set found flag - found_flag = 1 ; - - // break from for loop - break ; - } - - // queue a silent frame - if ( found_flag == 0 ) - queue_silent_frame( conf, member ) ; - - return 0 ; -} - -int queue_silent_frame( - struct ast_conference* conf, - struct ast_conf_member* member -) -{ -#ifdef APP_CONFERENCE_DEBUG - // - // check inputs - // - - if ( conf == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to queue silent frame for null conference\n" ) ; - return -1 ; - } - - if ( member == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to queue silent frame for null member\n" ) ; - return -1 ; - } -#endif // APP_CONFERENCE_DEBUG - - // - // initialize static variables - // - - static conf_frame* silent_frame = NULL ; - static struct ast_frame* qf = NULL ; - - if ( silent_frame == NULL ) - { - if ( ( silent_frame = get_silent_frame() ) == NULL ) - { - ast_log( LOG_WARNING, "unable to initialize static silent frame\n" ) ; - return -1 ; - } - } - - // acquire member lock - TIMELOG(ast_mutex_lock( &member->lock ),1,"queue_silent_frame") ; - - // get the appropriate silent frame - qf = silent_frame->converted[ member->write_format_index ] ; - - if ( qf == NULL ) - { - // - // we need to do this to avoid echo on the speaker's line. - // translators seem to be single-purpose, i.e. they - // can't be used simultaneously for multiple audio streams - // - - struct ast_trans_pvt* trans = ast_translator_build_path( member->write_format, AST_FORMAT_SLINEAR ) ; - - if ( trans != NULL ) - { - // attempt ( five times ) to get a silent frame - // to make sure we provice the translator with enough data - int c; - for ( c = 0 ; c < 5 ; ++c ) - { - // translate the frame - qf = ast_translate( trans, silent_frame->fr, 0 ) ; - - // break if we get a frame - if ( qf != NULL ) break ; - } - - if ( qf != NULL ) - { - // isolate the frame so we can keep it around after trans is free'd - qf = ast_frisolate( qf ) ; - - // cache the new, isolated frame - silent_frame->converted[ member->write_format_index ] = qf ; - } - - ast_translator_free_path( trans ) ; - } - } - - // - // queue the frame, if it's not null, - // otherwise there was an error - // - if ( qf != NULL ) - { - queue_outgoing_frame( member, qf, conf->delivery_time ) ; - } - else - { - ast_log( LOG_ERROR, "unable to translate outgoing silent frame, channel => %s\n", member->channel_name ) ; - } - - // release member lock - ast_mutex_unlock( &member->lock ) ; - - return 0 ; -} - -// -// get conference stats -// - -// -// returns: -1 => error, 0 => debugging off, 1 => debugging on -// state: on => 1, off => 0, toggle => -1 -// -int set_conference_debugging( const char* name, int state ) -{ - if ( name == NULL ) - return -1 ; - - // acquire mutex - ast_mutex_lock( &conflist_lock ) ; - - struct ast_conference *conf = conflist ; - int new_state = -1 ; - - // loop through conf list - while ( conf != NULL ) - { - if ( strncasecmp( (const char*)&(conf->name), name, 80 ) == 0 ) - { - // lock conference - // ast_mutex_lock( &(conf->lock) ) ; - - // toggle or set the state - if ( state == -1 ) - conf->debug_flag = ( conf->debug_flag == 0 ) ? 1 : 0 ; - else - conf->debug_flag = ( state == 0 ) ? 0 : 1 ; - - new_state = conf->debug_flag ; - - // unlock conference - // ast_mutex_unlock( &(conf->lock) ) ; - - break ; - } - - conf = conf->next ; - } - - // release mutex - ast_mutex_unlock( &conflist_lock ) ; - - return new_state ; -} - -int get_conference_count( void ) -{ - return conference_count ; -} - -int get_conference_stats( ast_conference_stats* stats, int requested ) -{ - // no conferences exist - if ( conflist == NULL ) - { - ast_log( AST_CONF_DEBUG, "conflist has not yet been initialize\n" ) ; - return 0 ; - } - - // acquire mutex - ast_mutex_lock( &conflist_lock ) ; - - // compare the number of requested to the number of available conferences - requested = ( get_conference_count() < requested ) ? get_conference_count() : requested ; - - // - // loop through conf list - // - - struct ast_conference* conf = conflist ; - int count = 0 ; - - while ( count <= requested && conf != NULL ) - { - // copy stats struct to array - stats[ count ] = conf->stats ; - - conf = conf->next ; - ++count ; - } - - // release mutex - ast_mutex_unlock( &conflist_lock ) ; - - return count ; -} - -int get_conference_stats_by_name( ast_conference_stats* stats, const char* name ) -{ - // no conferences exist - if ( conflist == NULL ) - { - ast_log( AST_CONF_DEBUG, "conflist has not yet been initialized, name => %s\n", name ) ; - return 0 ; - } - - // make sure stats is null - stats = NULL ; - - // acquire mutex - ast_mutex_lock( &conflist_lock ) ; - - struct ast_conference *conf = conflist ; - - // loop through conf list - while ( conf != NULL ) - { - if ( strncasecmp( (const char*)&(conf->name), name, 80 ) == 0 ) - { - // copy stats for found conference - *stats = conf->stats ; - break ; - } - - conf = conf->next ; - } - - // release mutex - ast_mutex_unlock( &conflist_lock ) ; - - return ( stats == NULL ) ? 0 : 1 ; -} - -struct ast_conf_member *find_member ( char *chan, int lock) -{ - struct ast_conf_member *found = NULL; - struct ast_conf_member *member; - struct ast_conference *conf; - - - - ast_mutex_lock( &conflist_lock ) ; - - conf = conflist; - - // loop through conf list - while ( conf != NULL && !found ) - { - // lock conference - ast_mutex_lock( &conf->lock ); - - member = conf->memberlist ; - - while (member != NULL) - { - if(!strcmp(member->channel_name, chan)) { - found = member; - if(lock) - ast_mutex_lock(&member->lock); - break; - } - member = member->next; - } - - // unlock conference - ast_mutex_unlock( &conf->lock ); - - conf = conf->next ; - } - - // release mutex - ast_mutex_unlock( &conflist_lock ) ; - - return found; -} - diff --git a/app_conference/conference.h b/app_conference/conference.h deleted file mode 100644 index 08c1018f..00000000 --- a/app_conference/conference.h +++ /dev/null @@ -1,121 +0,0 @@ - -// $Id: conference.h,v 1.6 2005/10/26 21:02:07 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#ifndef _APP_CONF_CONFERENCE_H -#define _APP_CONF_CONFERENCE_H - -// -// includes -// - -#include "app_conference.h" -#include "common.h" - -// -// struct declarations -// - -typedef struct ast_conference_stats -{ - // conference name ( copied for ease of use ) - char name[128] ; - - // type of connection - unsigned short phone ; - unsigned short iaxclient ; - unsigned short sip ; - - // type of users - unsigned short moderators ; - unsigned short listeners ; - - // accounting data - unsigned long frames_in ; - unsigned long frames_out ; - unsigned long frames_mixed ; - - struct timeval time_entered ; - -} ast_conference_stats ; - - -struct ast_conference -{ - // conference name - char name[128] ; - - // single-linked list of members in conference - struct ast_conf_member* memberlist ; - int membercount ; - - // conference thread id - pthread_t conference_thread ; - - // conference data mutex - ast_mutex_t lock ; - - // pointer to next conference in single-linked list - struct ast_conference* next ; - - // pointer to translation paths - struct ast_trans_pvt* from_slinear_paths[ AC_SUPPORTED_FORMATS ] ; - - // conference stats - ast_conference_stats stats ; - - // keep track of current delivery time - struct timeval delivery_time ; - - // 1 => on, 0 => off - short debug_flag ; -} ; - -// -// function declarations -// - -struct ast_conference* start_conference( struct ast_conf_member* member ) ; - -void conference_exec( struct ast_conference* conf ) ; - -struct ast_conference* find_conf( const char* name ) ; -struct ast_conference* create_conf( char* name, struct ast_conf_member* member ) ; -void remove_conf( struct ast_conference* conf ) ; - -// find a particular member, locking if requested. -struct ast_conf_member *find_member ( char *chan, int lock) ; - - -int queue_frame_for_listener( struct ast_conference* conf, struct ast_conf_member* member, conf_frame* frame ) ; -int queue_frame_for_speaker( struct ast_conference* conf, struct ast_conf_member* member, conf_frame* frame ) ; -int queue_silent_frame( struct ast_conference* conf, struct ast_conf_member* member ) ; - -void add_member( struct ast_conf_member* member, struct ast_conference* conf ) ; -int remove_member( struct ast_conf_member* member, struct ast_conference* conf ) ; -int count_member( struct ast_conf_member* member, struct ast_conference* conf, short add_member ) ; - -// called by app_confernce.c:load_module() -void init_conference( void ) ; - -int get_conference_count( void ) ; -int get_conference_stats( ast_conference_stats* stats, int requested ) ; -int get_conference_stats_by_name( ast_conference_stats* stats, const char* name ) ; - -int set_conference_debugging( const char* name, int state ) ; - -#endif diff --git a/app_conference/enter.gsm b/app_conference/enter.gsm deleted file mode 100644 index aa4dafb6..00000000 Binary files a/app_conference/enter.gsm and /dev/null differ diff --git a/app_conference/frame.c b/app_conference/frame.c deleted file mode 100644 index a50a378e..00000000 --- a/app_conference/frame.c +++ /dev/null @@ -1,614 +0,0 @@ - -// $Id: frame.c,v 1.7 2005/10/27 17:53:35 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#include "frame.h" - -conf_frame* mix_frames( conf_frame* frames_in, int speaker_count, int listener_count ) -{ - if ( frames_in == NULL ) - return NULL ; - - conf_frame* frames_out = NULL ; - - if ( speaker_count > 1 ) - { - if ( speaker_count == 2 && listener_count == 0 ) - { - // optimize here also? - frames_out = mix_multiple_speakers( frames_in, speaker_count, listener_count ) ; - } - else - { - // mix spoken frames for sending - // ( note: this call also releases us from free'ing spoken_frames ) - frames_out = mix_multiple_speakers( frames_in, speaker_count, listener_count ) ; - } - } - else if ( speaker_count == 1 ) - { - // pass-through frames - frames_out = mix_single_speaker( frames_in ) ; - } - else - { - // no frames to send, leave frames_out null - } - - return frames_out ; -} - -conf_frame* mix_single_speaker( conf_frame* frames_in ) -{ -#ifdef APP_CONFERENCE_DEBUG - // ast_log( AST_CONF_DEBUG, "returning single spoken frame\n" ) ; - - // - // check input - // - - if ( frames_in == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to mix single spoken frame with null frame\n" ) ; - return NULL ; - } - - if ( frames_in->fr == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to mix single spoken frame with null data\n" ) ; - return NULL ; - } - - if ( frames_in->member == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to mix single spoken frame with null member\n" ) ; - return NULL ; - } -#endif // APP_CONFERENCE_DEBUG - - // - // 'mix' the frame - // - - // copy orignal frame to converted array so listeners don't need to re-encode it - frames_in->converted[ frames_in->member->read_format_index ] = ast_frdup( frames_in->fr ) ; - - // convert frame to slinear, if we have a path - frames_in->fr = convert_frame_to_slinear( - frames_in->member->to_slinear, - frames_in->fr - ) ; - - // set the frame's member to null ( i.e. all listeners ) - frames_in->member = NULL ; - - return frames_in ; -} - -// { - // - // a little optimization for testing only: - // when two speakers ( of the same type ) and no listeners - // are in a conference, we just swamp the frame's member pointers - // -/* - if ( - listeners == 0 - && speakers == 2 - && cf_spokenFrames->member->read_format == cf_spokenFrames->next->member->write_format - && cf_spokenFrames->member->write_format == cf_spokenFrames->next->member->read_format - ) - { - struct ast_conf_member* m = NULL ; - m = cf_spokenFrames->member ; - cf_spokenFrames->member = cf_spokenFrames->next->member ; - cf_spokenFrames->next->member = m ; - return cf_spokenFrames ; - } -*/ -// } - -void set_conf_frame_delivery( conf_frame* frame, struct timeval time ) -{ - for ( ; frame != NULL ; frame = frame->next ) - { - if ( frame->fr != NULL ) - { - // copy passed timeval to frame's delivery timeval - frame->fr->delivery = time ; - } - } - - return ; -} - -conf_frame* mix_multiple_speakers( - conf_frame* frames_in, - int speakers, - int listeners -) -{ -#ifdef APP_CONFERENCE_DEBUG - // - // check input - // - - // no frames to mix - if ( ( frames_in == NULL ) || ( frames_in->fr == NULL ) ) - { - ast_log( AST_CONF_DEBUG, "passed spoken frame list was NULL\n" ) ; - return NULL ; - } - - // if less than two speakers, then no frames to mix - if ( speakers < 2 ) - { - ast_log( AST_CONF_DEBUG, "mix_multiple_speakers() called with less than two speakers\n" ) ; - return NULL ; - } -#endif // APP_CONFERENCE_DEBUG - - // - // at this point we know that there is more than one frame, - // and that the frames need to be converted to pcm to be mixed - // - // now, if there are only two frames and two members, - // we can swap them. ( but we'll get to that later. ) - // - - // - // loop through the spoken frames, making a list of spoken members, - // and converting gsm frames to slinear frames so we can mix them. - // - - // pointer to the spoken frames list - conf_frame* cf_spoken = frames_in ; - - // pointer to the new list of mixed frames - conf_frame* cf_sendFrames = NULL ; - - while ( cf_spoken != NULL ) - { - // - // while we're looping through the spoken frames, we'll - // convert the frame to a format suitable for mixing - // - // if the frame fails to convert, drop it and treat - // the speaking member like a listener by not adding - // them to the cf_sendFrames list - // - - if ( cf_spoken->member == NULL ) - { - ast_log( LOG_WARNING, "unable to determine frame member\n" ) ; - } - else - { - // ast_log( AST_CONF_DEBUG, "converting frame to slinear, channel => %s\n", cf_spoken->member->channel_name ) ; - cf_spoken->fr = convert_frame_to_slinear( - cf_spoken->member->to_slinear, - cf_spoken->fr - ) ; - - if ( cf_spoken->fr == NULL ) - { - ast_log( LOG_WARNING, "unable to convert frame to slinear\n" ) ; - } - else - { - // create new conf frame with last frame as 'next' - cf_sendFrames = create_conf_frame( cf_spoken->member, cf_sendFrames, NULL ) ; - } - } - - // point to the next spoken frame - cf_spoken = cf_spoken->next ; - } - - // if necessary, add a frame with a null member pointer. - // this frame will hold the audio mixed for all listeners - if ( listeners > 0 ) - { - cf_sendFrames = create_conf_frame( NULL, cf_sendFrames, NULL ) ; - } - - // - // mix the audio - // - - // convenience pointer that skips over the friendly offset - char* cp_listenerData ; - - // pointer to the send frames list - conf_frame* cf_send = NULL ; - - for ( cf_send = cf_sendFrames ; cf_send != NULL ; cf_send = cf_send->next ) - { - // allocate a mix buffer which fill large enough memory to - // hold a frame, and reset it's memory so we don't get noise - char* cp_listenerBuffer = malloc( AST_CONF_BUFFER_SIZE ) ; - memset( cp_listenerBuffer, 0x0, AST_CONF_BUFFER_SIZE ) ; - - // point past the friendly offset right to the data - cp_listenerData = cp_listenerBuffer + AST_FRIENDLY_OFFSET ; - - // reset the spoken list pointer - cf_spoken = frames_in ; - - // really mix the audio - for ( ; cf_spoken != NULL ; cf_spoken = cf_spoken->next ) - { - // - // if the members are equal, and they - // are not null, do not mix them. - // - if ( - ( cf_send->member == cf_spoken->member ) - && ( cf_send->member != NULL ) - ) - { - // don't mix this frame - } - else if ( cf_spoken->fr == NULL ) - { - ast_log( LOG_WARNING, "unable to mix conf_frame with null ast_frame\n" ) ; - } - else - { - // mix the new frame in with the existing buffer - mix_slinear_frames( cp_listenerData, (char*)( cf_spoken->fr->data ), cf_spoken->fr->samples ) ; - } - } - - // copy a pointer to the frame data to the conf_frame - cf_send->mixed_buffer = cp_listenerData ; - } - - // - // copy the mixed buffer to a new frame - // - - // reset the send list pointer - cf_send = cf_sendFrames ; - - while ( cf_send != NULL ) - { - cf_send->fr = create_slinear_frame( cf_send->mixed_buffer ) ; - cf_send = cf_send->next ; - } - - // - // clean up the spoken frames we were passed - // ( caller will only be responsible for free'ing returns frames ) - // - - // reset the spoken list pointer - cf_spoken = frames_in ; - - while ( cf_spoken != NULL ) - { - // delete the frame - cf_spoken = delete_conf_frame( cf_spoken ) ; - } - - // return the list of frames for sending - return cf_sendFrames ; -} - - -struct ast_frame* convert_frame_to_slinear( struct ast_trans_pvt* trans, struct ast_frame* fr ) -{ - // check for null frame - if ( fr == NULL ) - { - ast_log( LOG_ERROR, "unable to translate null frame to slinear\n" ) ; - return NULL ; - } - - // we don't need to duplicate this frame since - // the normal translation would free it anyway, so - // we'll just pretend we free'd and malloc'd a new one. - if ( fr->subclass == AST_FORMAT_SLINEAR ) - return fr ; - - // check for null translator ( after we've checked that we need to translate ) - if ( trans == NULL ) - { -// ast_log( LOG_ERROR, "unable to translate frame with null translation path\n" ) ; - return fr ; - } - - // return the converted frame - return convert_frame( trans, fr ) ; -} - -struct ast_frame* convert_frame_from_slinear( struct ast_trans_pvt* trans, struct ast_frame* fr ) -{ - // check for null translator ( after we've checked that we need to translate ) - if ( trans == NULL ) - { -// ast_log( LOG_ERROR, "unable to translate frame with null translation path\n" ) ; - return fr ; - } - - // check for null frame - if ( fr == NULL ) - { - ast_log( LOG_ERROR, "unable to translate null slinear frame\n" ) ; - return NULL ; - } - - // if the frame is not slinear, return an error - if ( fr->subclass != AST_FORMAT_SLINEAR ) - { - ast_log( LOG_ERROR, "unable to translate non-slinear frame\n" ) ; - return NULL ; - } - - // return the converted frame - return convert_frame( trans, fr ) ; -} - -struct ast_frame* convert_frame( struct ast_trans_pvt* trans, struct ast_frame* fr ) -{ - if ( trans == NULL ) - { - ast_log( LOG_WARNING, "unable to convert frame with null translator\n" ) ; - return NULL ; - } - - if ( fr == NULL ) - { - ast_log( LOG_WARNING, "unable to convert null frame\n" ) ; - return NULL ; - } - - // convert the frame - struct ast_frame* translated_frame = ast_translate( trans, fr, 1 ) ; - - // check for errors - if ( translated_frame == NULL ) - { - ast_log( LOG_ERROR, "unable to translate frame\n" ) ; - return NULL ; - } - - // return the translated frame - return translated_frame ; -} - -conf_frame* delete_conf_frame( conf_frame* cf ) -{ - // check for null frames - if ( cf == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to delete null conf frame\n" ) ; - return NULL ; - } - - // check for frame marked as static - if ( cf->static_frame == 1 ) - return NULL ; - - if ( cf->fr != NULL ) - { - ast_frfree( cf->fr ) ; - cf->fr = NULL ; - } - - // make sure converted frames are set to null - int c; - for ( c = 0 ; c < AC_SUPPORTED_FORMATS ; ++c ) - { - if ( cf->converted[ c ] != NULL ) - { - ast_frfree( cf->converted[ c ] ) ; - cf->converted[ c ] = NULL ; - } - } - - // get a pointer to the next frame - // in the list so we can return it - conf_frame* nf = cf->next ; - - free( cf ) ; - cf = NULL ; - - return nf ; -} - -conf_frame* create_conf_frame( struct ast_conf_member* member, conf_frame* next, const struct ast_frame* fr ) -{ - // pointer to list of mixed frames - conf_frame* cf = malloc( sizeof( struct conf_frame ) ) ; - - if ( cf == NULL ) - { - ast_log( LOG_ERROR, "unable to allocate memory for conf frame\n" ) ; - return NULL ; - } - - // - // init with some defaults - // - - // make sure converted frames are set to null -// for ( int c = 0 ; c < AC_SUPPORTED_FORMATS ; ++c ) -// { -// cf->converted[ c ] = NULL ; -// } - - memset( (struct ast_frame*)( cf->converted ), 0x0, ( sizeof( struct ast_frame* ) * AC_SUPPORTED_FORMATS ) ) ; - - cf->member = member ; - // cf->priority = 0 ; - - cf->prev = NULL ; - cf->next = next ; - - cf->static_frame = 0 ; - - // establish relationship to 'next' - if ( next != NULL ) next->prev = cf ; - - // this holds the ast_frame pointer - cf->fr = ( fr == NULL ) ? NULL : ast_frdup( ( struct ast_frame* )( fr ) ) ; - - // this holds the temporu mix buffer - cf->mixed_buffer = NULL ; - - return cf ; -} - -conf_frame* copy_conf_frame( conf_frame* src ) -{ - // - // check inputs - // - - if ( src == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to copy null conf frame\n" ) ; - return NULL ; - } - - // - // copy the frame - // - - struct conf_frame *cfr = NULL ; - - // create a new conf frame - cfr = create_conf_frame( src->member, NULL, src->fr ) ; - - if ( cfr == NULL ) - { - ast_log( AST_CONF_DEBUG, "unable to create new conf frame for copy\n" ) ; - return NULL ; - } - - return cfr ; -} - -// -// slinear frame functions -// - -struct ast_frame* create_slinear_frame( char* data ) -{ - struct ast_frame* f ; - - f = calloc( 1, sizeof( struct ast_frame ) ) ; - if ( f == NULL ) - { - ast_log( LOG_ERROR, "unable to allocate memory for slinear frame\n" ) ; - return NULL ; - } - - f->frametype = AST_FRAME_VOICE ; - f->subclass = AST_FORMAT_SLINEAR ; - f->samples = AST_CONF_BLOCK_SAMPLES ; - f->offset = AST_FRIENDLY_OFFSET ; - f->mallocd = AST_MALLOCD_HDR | AST_MALLOCD_DATA ; - - f->datalen = AST_CONF_FRAME_DATA_SIZE ; - f->data = data ; - - f->src = NULL ; - - return f ; -} - -void mix_slinear_frames( char *dst, const char *src, int samples ) -{ - if ( dst == NULL ) return ; - if ( src == NULL ) return ; - - int i, val ; - - for ( i = 0 ; i < samples ; ++i ) - { - val = ( (short*)dst )[i] + ( (short*)src )[i] ; - - if ( val > 0x7fff ) - { - ( (short*)dst )[i] = 0x7fff - 1 ; - continue ; - } - else if ( val < -0x7fff ) - { - ( (short*)dst )[i] = -0x7fff + 1 ; - continue ; - } - else - { - ( (short*)dst )[i] = val ; - continue ; - } - } - - return ; -} - -// -// silent frame functions -// - -conf_frame* get_silent_frame( void ) -{ - static conf_frame* static_silent_frame = NULL ; - - // we'll let this leak until the application terminates - if ( static_silent_frame == NULL ) - { - // ast_log( AST_CONF_DEBUG, "creating cached silent frame\n" ) ; - struct ast_frame* fr = get_silent_slinear_frame() ; - - static_silent_frame = create_conf_frame( NULL, NULL, fr ) ; - - if ( static_silent_frame == NULL ) - { - ast_log( LOG_WARNING, "unable to create cached silent frame\n" ) ; - return NULL ; - } - - // init the 'converted' slinear silent frame - static_silent_frame->converted[ AC_SLINEAR_INDEX ] = get_silent_slinear_frame() ; - - // mark frame as static so it's not deleted - static_silent_frame->static_frame = 1 ; - } - - return static_silent_frame ; -} - -struct ast_frame* get_silent_slinear_frame( void ) -{ - static struct ast_frame* f = NULL ; - - // we'll let this leak until the application terminates - if ( f == NULL ) - { - char* data = malloc( AST_CONF_BUFFER_SIZE ) ; - memset( data, 0x0, AST_CONF_BUFFER_SIZE ) ; - f = create_slinear_frame( data ) ; - } - - return ast_frdup( f ) ; -} - - diff --git a/app_conference/frame.h b/app_conference/frame.h deleted file mode 100644 index d5b39613..00000000 --- a/app_conference/frame.h +++ /dev/null @@ -1,60 +0,0 @@ - -// $Id: frame.h,v 1.6 2005/10/26 21:02:07 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#ifndef _APP_CONF_FRAME_H -#define _APP_CONF_FRAME_H - -// -// includes -// - -#include "app_conference.h" -#include "common.h" - -// -// function declarations -// - -// mixing -conf_frame* mix_frames( conf_frame* frames_in, int speaker_count, int listener_count ) ; - -conf_frame* mix_multiple_speakers( conf_frame* frames_in, int speakers, int listeners ) ; -conf_frame* mix_single_speaker( conf_frame* frames_in ) ; - -// frame creation and deletion -conf_frame* create_conf_frame( struct ast_conf_member* member, conf_frame* next, const struct ast_frame* fr ) ; -conf_frame* delete_conf_frame( conf_frame* cf ) ; -conf_frame* copy_conf_frame( conf_frame* src ) ; - -// convert frame functions -struct ast_frame* convert_frame_to_slinear( struct ast_trans_pvt* trans, struct ast_frame* fr ) ; -struct ast_frame* convert_frame_from_slinear( struct ast_trans_pvt* trans, struct ast_frame* fr ) ; -struct ast_frame* convert_frame( struct ast_trans_pvt* trans, struct ast_frame* fr ) ; - -// slinear frame functions -struct ast_frame* create_slinear_frame( char* data ) ; -void mix_slinear_frames( char* dst, const char* src, int samples ) ; - -// silent frame functions -conf_frame* get_silent_frame( void ) ; -struct ast_frame* get_silent_slinear_frame( void ) ; - -// set delivery timestamp for frames -void set_conf_frame_delivery( conf_frame* frame, struct timeval time ) ; - -#endif diff --git a/app_conference/hash.gsm b/app_conference/hash.gsm deleted file mode 100644 index 0d0a8ecf..00000000 --- a/app_conference/hash.gsm +++ /dev/null @@ -1,2 +0,0 @@ -\}PcȣP tۆD#E)#i(*E3yBF:W2wWԢ6TyuWI+sdWysuk2yct9,,Wk|UTWu#.1c}yQ( dº\2! Q\?;waWnfy.7FW){?YW!Q nSB*qUUy>XWQDm! \ No newline at end of file diff --git a/app_conference/hash.wav b/app_conference/hash.wav deleted file mode 100644 index a079f449..00000000 Binary files a/app_conference/hash.wav and /dev/null differ diff --git a/app_conference/leave.gsm b/app_conference/leave.gsm deleted file mode 100644 index 7b3bef01..00000000 Binary files a/app_conference/leave.gsm and /dev/null differ diff --git a/app_conference/libspeex/CVS/Entries b/app_conference/libspeex/CVS/Entries deleted file mode 100644 index a6a76f82..00000000 --- a/app_conference/libspeex/CVS/Entries +++ /dev/null @@ -1,7 +0,0 @@ -/misc.c/1.1/Thu Mar 25 15:10:17 2004// -/misc.h/1.1/Thu Mar 25 15:10:17 2004// -/preprocess.c/1.4/Fri Mar 25 20:26:26 2005// -/smallft.c/1.3/Fri Mar 25 20:26:26 2005// -/smallft.h/1.2/Wed Jul 7 13:39:42 2004// -/speex_preprocess.h/1.1/Thu Mar 25 15:10:17 2004// -D diff --git a/app_conference/libspeex/CVS/Repository b/app_conference/libspeex/CVS/Repository deleted file mode 100644 index c74f117b..00000000 --- a/app_conference/libspeex/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -app_conference/libspeex diff --git a/app_conference/libspeex/CVS/Root b/app_conference/libspeex/CVS/Root deleted file mode 100644 index 76ea6939..00000000 --- a/app_conference/libspeex/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@iaxclient.cvs.sourceforge.net:/cvsroot/iaxclient diff --git a/app_conference/libspeex/misc.c b/app_conference/libspeex/misc.c deleted file mode 100644 index 55728099..00000000 --- a/app_conference/libspeex/misc.c +++ /dev/null @@ -1,145 +0,0 @@ -/* Copyright (C) 2002 Jean-Marc Valin - File: mics.c - Various utility routines for Speex - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "misc.h" -#include -#include -#include - -#ifndef RELEASE -void print_vec(float *vec, int len, char *name) -{ - int i; - printf ("%s ", name); - for (i=0;i>24; - ret += (i>>8)&0x0000ff00; - ret += (i<<8)&0x00ff0000; - ret += (i<<24); -#endif - return ret; -} - -unsigned int le_int(unsigned int i) -{ - unsigned int ret=i; -#ifdef WORDS_BIGENDIAN - ret = i>>24; - ret += (i>>8)&0x0000ff00; - ret += (i<<8)&0x00ff0000; - ret += (i<<24); -#endif - return ret; -} - -unsigned short be_short(unsigned short s) -{ - unsigned short ret=s; -#ifndef WORDS_BIGENDIAN - ret = s>>8; - ret += s<<8; -#endif - return ret; -} - -unsigned short le_short(unsigned short s) -{ - unsigned short ret=s; -#ifdef WORDS_BIGENDIAN - ret = s>>8; - ret += s<<8; -#endif - return ret; -} - -void *speex_alloc (int size) -{ - return calloc(size,1); -} - -void *speex_realloc (void *ptr, int size) -{ - return realloc(ptr, size); -} - -void speex_free (void *ptr) -{ - free(ptr); -} - -void *speex_move (void *dest, void *src, int n) -{ - return memmove(dest,src,n); -} - -void speex_error(char *str) -{ - fprintf (stderr, "Fatal error: %s\n", str); - exit(1); -} - -void speex_warning(char *str) -{ - fprintf (stderr, "warning: %s\n", str); -} - -void speex_warning_int(char *str, int val) -{ - fprintf (stderr, "warning: %s %d\n", str, val); -} - -void speex_rand_vec(float std, spx_sig_t *data, int len) -{ - int i; - for (i=0;i> (shift)) -#define SHR(a,shift) ((a) >> (shift)) -#define SHL(a,shift) ((a) << (shift)) - -/* result fits in 16 bits */ -#define MULT16_16_16(a,b) (((short)(a))*(b)) - -#define MULT16_16(a,b) (((signed int)(a))*(b)) -#define MULT16_32_Q13(a,b) (((a)*((b)>>13)) + ((a)*((signed int)((b)&0x00001fff))>>13)) -#define MULT16_32_Q14(a,b) (((a)*((b)>>14)) + ((a)*((signed int)((b)&0x00003fff))>>14)) -#define MULT16_32_Q15(a,b) (((a)*((b)>>15)) + ((a)*((signed int)((b)&0x00007fff))>>15)) - -#define MULT16_16_Q13(a,b) (((signed int)(a))*(b)>>13) -#define MULT16_16_Q14(a,b) (((signed int)(a))*(b)>>14) -#define MULT16_16_Q15(a,b) (((signed int)(a))*(b)>>15) - -#define MULT16_16_P14(a,b) ((8192+((signed int)(a))*(b))>>14) - - -#define DIV32_16(a,b) (((signed int)(a))/(b)) - -#else - -typedef float spx_mem_t; -typedef float spx_coef_t; -typedef float spx_lsp_t; -typedef float spx_sig_t; -typedef float spx_word16_t; -typedef float spx_word32_t; - -#define LPC_SCALING 1. -#define SIG_SCALING 1. -#define LSP_SCALING 1. - -#define LPC_SHIFT 0 -#define SIG_SHIFT 0 - -#define PSHR(a,shift) (a) -#define SHR(a,shift) (a) -#define SHL(a,shift) (a) -#define MULT16_16_16(a,b) ((a)*(b)) -#define MULT16_16(a,b) ((a)*(b)) - -#define MULT16_32_Q13(a,b) ((a)*(b)) -#define MULT16_32_Q14(a,b) ((a)*(b)) -#define MULT16_32_Q15(a,b) ((a)*(b)) - -#define MULT16_16_Q13(a,b) ((a)*(b)) -#define MULT16_16_Q14(a,b) ((a)*(b)) -#define MULT16_16_Q15(a,b) ((a)*(b)) - - -#endif - -#ifndef RELEASE -void print_vec(float *vec, int len, char *name); -#endif - -unsigned int be_int(unsigned int i); -unsigned int le_int(unsigned int i); - - -unsigned short be_short(unsigned short s); -unsigned short le_short(unsigned short s); - -/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free */ -void *speex_alloc (int size); - -/** Speex wrapper for realloc. To do your own dynamic allocation, all you need to do is replace this function, speex_alloc and speex_free */ -void *speex_realloc (void *ptr, int size); - -/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_alloc */ -void speex_free (void *ptr); - -/** Speex wrapper for mem_move */ -void *speex_move (void *dest, void *src, int n); - -void speex_error(char *str); - -void speex_warning(char *str); - -void speex_warning_int(char *str, int val); - -void speex_rand_vec(float std, spx_sig_t *data, int len); - -float speex_rand(float std); - -void _speex_putc(int ch, void *file); - -#endif diff --git a/app_conference/libspeex/preprocess.c b/app_conference/libspeex/preprocess.c deleted file mode 100644 index 4e8a5470..00000000 --- a/app_conference/libspeex/preprocess.c +++ /dev/null @@ -1,1136 +0,0 @@ -/* Copyright (C) 2003 Epic Games - Written by Jean-Marc Valin - - File: preprocess.c - Preprocessor with denoising based on the algorithm by Ephraim and Malah - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include "speex_preprocess.h" -#include "misc.h" -#include "smallft.h" - -#define max(a,b) ((a) > (b) ? (a) : (b)) -#define min(a,b) ((a) < (b) ? (a) : (b)) - -/* use single-precision math funcs. (1.3% perf improvement). */ -#if 1 -#define exp(a) expf(a) -#define sqrt(a) sqrtf(a) -#define floor(a) floorf(a) -#define log(a) logf(a) -#endif - - - -#ifndef M_PI -#define M_PI 3.14159263 -#endif - -#define SQRT_M_PI_2 0.88623 -#define LOUDNESS_EXP 2.5 - -#define NB_BANDS 8 - -#define ZMIN .1 -#define ZMAX .316 -#define ZMIN_1 10 -#define LOG_MIN_MAX_1 0.86859 - -static void conj_window(float *w, int len) -{ - int i; - for (i=0;i9.5) - return 1+.12/x; - - integer = floor(x); - frac = x-integer; - ind = (int)integer; - - return ((1-frac)*table[ind] + frac*table[ind+1])/sqrt(x+.0001); -} - -SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate) -{ - int i; - int N, N3, N4; - - SpeexPreprocessState *st = (SpeexPreprocessState *)speex_alloc(sizeof(SpeexPreprocessState)); - st->frame_size = frame_size; - - /* Round ps_size down to the nearest power of two */ -#if 0 - i=1; - st->ps_size = st->frame_size; - while(1) - { - if (st->ps_size & ~i) - { - st->ps_size &= ~i; - i<<=1; - } else { - break; - } - } - - - if (st->ps_size < 3*st->frame_size/4) - st->ps_size = st->ps_size * 3 / 2; -#else - st->ps_size = st->frame_size; -#endif - - N = st->ps_size; - N3 = 2*N - st->frame_size; - N4 = st->frame_size - N3; - - st->sampling_rate = sampling_rate; - st->denoise_enabled = 1; - st->agc_enabled = 0; - st->agc_level = 8000; - st->vad_enabled = 0; - - st->speech_prob_start = SPEEX_PROB_START ; - st->speech_prob_continue = SPEEX_PROB_CONTINUE ; - - st->frame = (float*)speex_alloc(2*N*sizeof(float)); - st->ps = (float*)speex_alloc(N*sizeof(float)); - st->gain2 = (float*)speex_alloc(N*sizeof(float)); - st->window = (float*)speex_alloc(2*N*sizeof(float)); - st->noise = (float*)speex_alloc(N*sizeof(float)); - st->old_ps = (float*)speex_alloc(N*sizeof(float)); - st->gain = (float*)speex_alloc(N*sizeof(float)); - st->prior = (float*)speex_alloc(N*sizeof(float)); - st->post = (float*)speex_alloc(N*sizeof(float)); - st->loudness_weight = (float*)speex_alloc(N*sizeof(float)); - st->inbuf = (float*)speex_alloc(N3*sizeof(float)); - st->outbuf = (float*)speex_alloc(N3*sizeof(float)); - st->echo_noise = (float*)speex_alloc(N*sizeof(float)); - - st->S = (float*)speex_alloc(N*sizeof(float)); - st->Smin = (float*)speex_alloc(N*sizeof(float)); - st->Stmp = (float*)speex_alloc(N*sizeof(float)); - st->update_prob = (float*)speex_alloc(N*sizeof(float)); - - st->zeta = (float*)speex_alloc(N*sizeof(float)); - st->Zpeak = 0; - st->Zlast = 0; - - st->noise_bands = (float*)speex_alloc(NB_BANDS*sizeof(float)); - st->noise_bands2 = (float*)speex_alloc(NB_BANDS*sizeof(float)); - st->speech_bands = (float*)speex_alloc(NB_BANDS*sizeof(float)); - st->speech_bands2 = (float*)speex_alloc(NB_BANDS*sizeof(float)); - st->noise_bandsN = st->speech_bandsN = 1; - - conj_window(st->window, 2*N3); - for (i=2*N3;i<2*st->ps_size;i++) - st->window[i]=1; - - if (N4>0) - { - for (i=N3-1;i>=0;i--) - { - st->window[i+N3+N4]=st->window[i+N3]; - st->window[i+N3]=1; - } - } - for (i=0;inoise[i]=1e4; - st->old_ps[i]=1e4; - st->gain[i]=1; - st->post[i]=1; - st->prior[i]=1; - } - - for (i=0;iinbuf[i]=0; - st->outbuf[i]=0; - } - - for (i=0;iloudness_weight[i] = .35-.35*ff/16000+.73*exp(-.5*(ff-3800)*(ff-3800)/9e5); - if (st->loudness_weight[i]<.01) - st->loudness_weight[i]=.01; - st->loudness_weight[i] *= st->loudness_weight[i]; - } - - st->speech_prob = 0; - st->last_speech = 1000; - st->loudness = pow(6000,LOUDNESS_EXP); - st->loudness2 = 6000; - st->nb_loudness_adapt = 0; - - st->fft_lookup = (struct drft_lookup*)speex_alloc(sizeof(struct drft_lookup)); - drft_init(st->fft_lookup,2*N); - - st->nb_adapt=0; - st->consec_noise=0; - st->nb_preprocess=0; - return st; -} - -void speex_preprocess_state_destroy(SpeexPreprocessState *st) -{ - speex_free(st->frame); - speex_free(st->ps); - speex_free(st->gain2); - speex_free(st->window); - speex_free(st->noise); - speex_free(st->old_ps); - speex_free(st->gain); - speex_free(st->prior); - speex_free(st->post); - speex_free(st->loudness_weight); - speex_free(st->echo_noise); - - speex_free(st->S); - speex_free(st->Smin); - speex_free(st->Stmp); - speex_free(st->update_prob); - - speex_free(st->noise_bands); - speex_free(st->noise_bands2); - speex_free(st->speech_bands); - speex_free(st->speech_bands2); - - speex_free(st->inbuf); - speex_free(st->outbuf); - - drft_clear(st->fft_lookup); - speex_free(st->fft_lookup); - - speex_free(st); -} - -static void update_noise(SpeexPreprocessState *st, float *ps, float *echo) -{ - int i; - float beta; - st->nb_adapt++; - beta=1.0/st->nb_adapt; - if (beta < .05) - beta=.05; - - if (!echo) - { - for (i=0;ips_size;i++) - st->noise[i] = (1-beta)*st->noise[i] + beta*ps[i]; - } else { - for (i=0;ips_size;i++) - st->noise[i] = (1-beta)*st->noise[i] + beta*max(0,ps[i]-echo[i]); -#if 0 - for (i=0;ips_size;i++) - st->noise[i] = 0; -#endif - } -} - -static int speex_compute_vad(SpeexPreprocessState *st, float *ps, float mean_prior, float mean_post) -{ - int i, is_speech=0; - int N = st->ps_size; - float scale=.5/N; - - /* FIXME: Clean this up a bit */ - { - float bands[NB_BANDS]; - int j; - float p0, p1; - float tot_loudness=0; - float x = sqrt(mean_post); - - for (i=5;ips[i] * st->loudness_weight[i]; - } - - for (i=0;ispeech_prob + .01*(1-st->speech_prob); - p1 *= .01*st->speech_prob + .99*(1-st->speech_prob); - - st->speech_prob = p0/(p1+p0); - */ - - if (st->noise_bandsN < 50 || st->speech_bandsN < 50) - { - if (mean_post > 5) - { - float adapt = 1./st->speech_bandsN++; - if (adapt<.005) - adapt = .005; - for (i=0;ispeech_bands[i] = (1-adapt)*st->speech_bands[i] + adapt*bands[i]; - /*st->speech_bands2[i] = (1-adapt)*st->speech_bands2[i] + adapt*bands[i]*bands[i];*/ - st->speech_bands2[i] = (1-adapt)*st->speech_bands2[i] + adapt*(bands[i]-st->speech_bands[i])*(bands[i]-st->speech_bands[i]); - } - } else { - float adapt = 1./st->noise_bandsN++; - if (adapt<.005) - adapt = .005; - for (i=0;inoise_bands[i] = (1-adapt)*st->noise_bands[i] + adapt*bands[i]; - /*st->noise_bands2[i] = (1-adapt)*st->noise_bands2[i] + adapt*bands[i]*bands[i];*/ - st->noise_bands2[i] = (1-adapt)*st->noise_bands2[i] + adapt*(bands[i]-st->noise_bands[i])*(bands[i]-st->noise_bands[i]); - } - } - } - p0=p1=1; - for (i=0;inoise_bands2[i] - st->noise_bands[i]*st->noise_bands[i]; - speech_var = 1.01*st->speech_bands2[i] - st->speech_bands[i]*st->speech_bands[i];*/ - noise_var = st->noise_bands2[i]; - speech_var = st->speech_bands2[i]; - if (noise_var < .1) - noise_var = .1; - if (speech_var < .1) - speech_var = .1; - - /*speech_var = sqrt(speech_var*noise_var); - noise_var = speech_var;*/ - if (speech_var < .05*speech_var) - noise_var = .05*speech_var; - if (speech_var < .05*noise_var) - speech_var = .05*noise_var; - - if (bands[i] < st->noise_bands[i]) - speech_var = noise_var; - if (bands[i] > st->speech_bands[i]) - noise_var = speech_var; - - speech_mean = st->speech_bands[i]; - noise_mean = st->noise_bands[i]; - if (noise_mean < speech_mean - 5) - noise_mean = speech_mean - 5; - - tmp1 = exp(-.5*(bands[i]-speech_mean)*(bands[i]-speech_mean)/speech_var)/sqrt(2*M_PI*speech_var); - tmp2 = exp(-.5*(bands[i]-noise_mean)*(bands[i]-noise_mean)/noise_var)/sqrt(2*M_PI*noise_var); - /*fprintf (stderr, "%f ", (float)(p0/(.01+p0+p1)));*/ - /*fprintf (stderr, "%f ", (float)(bands[i]));*/ - pr = tmp1/(1e-25+tmp1+tmp2); - /*if (bands[i] < st->noise_bands[i]) - pr=.01; - if (bands[i] > st->speech_bands[i] && pr < .995) - pr=.995;*/ - if (pr>.999) - pr=.999; - if (pr<.001) - pr=.001; - /*fprintf (stderr, "%f ", pr);*/ - p0 *= pr; - p1 *= (1-pr); - } - - p0 = pow(p0,.2); - p1 = pow(p1,.2); - -#if 1 - p0 *= 2; - p0=p0/(p1+p0); - if (st->last_speech>20) - { - float tmp = sqrt(tot_loudness)/st->loudness2; - tmp = 1-exp(-10*tmp); - if (p0>tmp) - p0=tmp; - } - p1=1-p0; -#else - if (sqrt(tot_loudness) < .6*st->loudness2 && p0>15*p1) - p0=15*p1; - if (sqrt(tot_loudness) < .45*st->loudness2 && p0>7*p1) - p0=7*p1; - if (sqrt(tot_loudness) < .3*st->loudness2 && p0>3*p1) - p0=3*p1; - if (sqrt(tot_loudness) < .15*st->loudness2 && p0>p1) - p0=p1; - /*fprintf (stderr, "%f %f ", (float)(sqrt(tot_loudness) /( .25*st->loudness2)), p0/(p1+p0));*/ -#endif - - p0 *= .99*st->speech_prob + .01*(1-st->speech_prob); - p1 *= .01*st->speech_prob + .99*(1-st->speech_prob); - - st->speech_prob = p0/(1e-25+p1+p0); - /*fprintf (stderr, "%f %f %f ", tot_loudness, st->loudness2, st->speech_prob);*/ - - /* decide if frame is speech using speech probability settings */ - -/* if (st->speech_prob> .35 || (st->last_speech < 20 && st->speech_prob>.1)) */ - if ( - st->speech_prob > st->speech_prob_start - || ( st->last_speech < 20 && st->speech_prob > st->speech_prob_continue ) - ) - { - is_speech = 1; - st->last_speech = 0; - } - else - { - st->last_speech++; - if ( st->last_speech < 20 ) - is_speech = 1; - } - - if (st->noise_bandsN > 50 && st->speech_bandsN > 50) - { - if (mean_post > 5) - { - float adapt = 1./st->speech_bandsN++; - if (adapt<.005) - adapt = .005; - for (i=0;ispeech_bands[i] = (1-adapt)*st->speech_bands[i] + adapt*bands[i]; - /*st->speech_bands2[i] = (1-adapt)*st->speech_bands2[i] + adapt*bands[i]*bands[i];*/ - st->speech_bands2[i] = (1-adapt)*st->speech_bands2[i] + adapt*(bands[i]-st->speech_bands[i])*(bands[i]-st->speech_bands[i]); - } - } else { - float adapt = 1./st->noise_bandsN++; - if (adapt<.005) - adapt = .005; - for (i=0;inoise_bands[i] = (1-adapt)*st->noise_bands[i] + adapt*bands[i]; - /*st->noise_bands2[i] = (1-adapt)*st->noise_bands2[i] + adapt*bands[i]*bands[i];*/ - st->noise_bands2[i] = (1-adapt)*st->noise_bands2[i] + adapt*(bands[i]-st->noise_bands[i])*(bands[i]-st->noise_bands[i]); - } - } - } - - - } - - return is_speech; -} - -static void speex_compute_agc(SpeexPreprocessState *st, float mean_prior) -{ - int i; - int N = st->ps_size; - float scale=.5/N; - float agc_gain; - int freq_start, freq_end; - float active_bands = 0; - - freq_start = (int)(300.0*2*N/st->sampling_rate); - freq_end = (int)(2000.0*2*N/st->sampling_rate); - for (i=freq_start;iS[i] > 20*st->Smin[i]+1000) - active_bands+=1; - } - active_bands /= (freq_end-freq_start+1); - - if (active_bands > .2) - { - float loudness=0; - float rate, rate2=.2; - st->nb_loudness_adapt++; - rate=2.0/(1+st->nb_loudness_adapt); - if (rate < .05) - rate = .05; - if (rate < .1 && pow(loudness, LOUDNESS_EXP) > st->loudness) - rate = .1; - if (rate < .2 && pow(loudness, LOUDNESS_EXP) > 3*st->loudness) - rate = .2; - if (rate < .4 && pow(loudness, LOUDNESS_EXP) > 10*st->loudness) - rate = .4; - - for (i=2;ips[i] * st->gain2[i] * st->gain2[i] * st->loudness_weight[i]; - } - loudness=sqrt(loudness); - /*if (loudness < 2*pow(st->loudness, 1.0/LOUDNESS_EXP) && - loudness*2 > pow(st->loudness, 1.0/LOUDNESS_EXP))*/ - st->loudness = (1-rate)*st->loudness + (rate)*pow(loudness, LOUDNESS_EXP); - - st->loudness2 = (1-rate2)*st->loudness2 + rate2*pow(st->loudness, 1.0/LOUDNESS_EXP); - - loudness = pow(st->loudness, 1.0/LOUDNESS_EXP); - - /*fprintf (stderr, "%f %f %f\n", loudness, st->loudness2, rate);*/ - } - - agc_gain = st->agc_level/st->loudness2; - /*fprintf (stderr, "%f %f %f %f\n", active_bands, st->loudness, st->loudness2, agc_gain);*/ - if (agc_gain>200) - agc_gain = 200; - - for (i=0;igain2[i] *= agc_gain; - -} - -static void preprocess_analysis(SpeexPreprocessState *st, short *x) -{ - int i; - int N = st->ps_size; - int N3 = 2*N - st->frame_size; - int N4 = st->frame_size - N3; - float *ps=st->ps; - - /* 'Build' input frame */ - for (i=0;iframe[i]=st->inbuf[i]; - for (i=0;iframe_size;i++) - st->frame[N3+i]=x[i]; - - /* Update inbuf */ - for (i=0;iinbuf[i]=x[N4+i]; - - /* Windowing */ - for (i=0;i<2*N;i++) - st->frame[i] *= st->window[i]; - - /* Perform FFT */ - drft_forward(st->fft_lookup, st->frame); - - /* Power spectrum */ - ps[0]=1; - for (i=1;iframe[2*i-1]*st->frame[2*i-1] + st->frame[2*i]*st->frame[2*i]; - -} - -static void update_noise_prob(SpeexPreprocessState *st) -{ - int i; - int N = st->ps_size; - - for (i=1;iS[i] = 100+ .8*st->S[i] + .05*st->ps[i-1]+.1*st->ps[i]+.05*st->ps[i+1]; - - if (st->nb_preprocess<1) - { - for (i=1;iSmin[i] = st->Stmp[i] = st->S[i]+100; - } - - if (st->nb_preprocess%200==0) - { - for (i=1;iSmin[i] = min(st->Stmp[i], st->S[i]); - st->Stmp[i] = st->S[i]; - } - } else { - for (i=1;iSmin[i] = min(st->Smin[i], st->S[i]); - st->Stmp[i] = min(st->Stmp[i], st->S[i]); - } - } - for (i=1;iupdate_prob[i] *= .2; - if (st->S[i] > 5*st->Smin[i]) - st->update_prob[i] += .8; - /*fprintf (stderr, "%f ", st->S[i]/st->Smin[i]);*/ - /*fprintf (stderr, "%f ", st->update_prob[i]);*/ - } - -} - -inline void ephraim_malah(SpeexPreprocessState *st, int N, float Pframe) -{ - int i; - - /* defactor loop for i=1,1 < i < N-1, and i= N-1 cases */ - /* i=1 case */ - { - float MM; - float theta; - float prior_ratio; - float p, q; - float zeta1; - float P1; - - prior_ratio = st->prior[1]/(1.0001+st->prior[1]); - theta = (1+st->post[1])*prior_ratio; - - zeta1 = st->zeta[1]; - - if (zeta1ZMAX) - P1 = 1; - else - P1 = LOG_MIN_MAX_1 * log(ZMIN_1*zeta1); - - /*P1 = log(zeta1/ZMIN)/log(ZMAX/ZMIN);*/ - - /* FIXME: add global prop (P2) */ - q = 1-Pframe*P1; - if (q>.95) - q=.95; - p=1/(1 + (q/(1-q))*(1+st->prior[1])*exp(-theta)); - - /* Optimal estimator for loudness domain */ - MM = hypergeom_gain(theta); - - st->gain[1] = prior_ratio * MM; - /*Put some (very arbitraty) limit on the gain*/ - if (st->gain[1]>2) - { - st->gain[1]=2; - } - - if (st->denoise_enabled) - { - st->gain2[1]=p*p*st->gain[1]; - } else { - st->gain2[1]=1; - } - } - - for (i=2;i<(N-1);i++) - { - float MM; - float theta; - float prior_ratio; - float p, q; - float zeta1; - float P1; - - - zeta1 = .25*st->zeta[i-1] + .5*st->zeta[i] + .25*st->zeta[i+1]; - - prior_ratio = st->prior[i]/(1.0001+st->prior[i]); - theta = (1+st->post[i])*prior_ratio; - - - - if (zeta1ZMAX) - P1 = 1; - else - P1 = LOG_MIN_MAX_1 * log(ZMIN_1*zeta1); - - /*P1 = log(zeta1/ZMIN)/log(ZMAX/ZMIN);*/ - - - /* FIXME: add global prop (P2) */ - q = 1-Pframe*P1; - if (q>.95) - q=.95; - p=1/(1 + (q/(1-q))*(1+st->prior[i])*exp(-theta)); - - /* Optimal estimator for loudness domain */ - MM = hypergeom_gain(theta); - - st->gain[i] = prior_ratio * MM; - /*Put some (very arbitraty) limit on the gain*/ - if (st->gain[i]>2) - { - st->gain[i]=2; - } - - if (st->denoise_enabled) - { - st->gain2[i]=p*p*st->gain[i]; - } else { - st->gain2[i]=1; - } - } - - /* i = N-1 case */ - { - float MM; - float theta; - float prior_ratio; - float p, q; - float zeta1; - float P1; - - prior_ratio = st->prior[N-1]/(1.0001+st->prior[N-1]); - theta = (1+st->post[N-1])*prior_ratio; - - zeta1 = st->zeta[N-1]; - - if (zeta1ZMAX) - P1 = 1; - else - P1 = LOG_MIN_MAX_1 * log(ZMIN_1*zeta1); - - /*P1 = log(zeta1/ZMIN)/log(ZMAX/ZMIN);*/ - - /* FIXME: add global prop (P2) */ - q = 1-Pframe*P1; - if (q>.95) - q=.95; - p=1/(1 + (q/(1-q))*(1+st->prior[N-1])*exp(-theta)); - - /* Optimal estimator for loudness domain */ - MM = hypergeom_gain(theta); - - st->gain[N-1] = prior_ratio * MM; - /*Put some (very arbitraty) limit on the gain*/ - if (st->gain[N-1]>2) - { - st->gain[N-1]=2; - } - - if (st->denoise_enabled) - { - st->gain2[N-1]=p*p*st->gain[N-1]; - } else { - st->gain2[N-1]=1; - } - } - st->gain2[0]=st->gain[0]=0; - st->gain2[N-1]=st->gain[N-1]=0; -} - - -int speex_preprocess(SpeexPreprocessState *st, short *x, float *echo) -{ - int i; - int is_speech=1; - float mean_post=0; - float mean_prior=0; - int N = st->ps_size; - int N3 = 2*N - st->frame_size; - int N4 = st->frame_size - N3; - float scale=.5/N; - float *ps=st->ps; - float Zframe=0, Pframe; - - preprocess_analysis(st, x); - - update_noise_prob(st); - - st->nb_preprocess++; - - /* Noise estimation always updated for the 20 first times */ - if (st->nb_adapt<10) - { - update_noise(st, ps, echo); - } - - /* Deal with residual echo if provided */ - if (echo) - for (i=1;iecho_noise[i] = (.7*st->echo_noise[i] + .3* echo[i]); - - /* Compute a posteriori SNR */ - for (i=1;ipost[i] = ps[i]/(1+st->noise[i]+st->echo_noise[i]) - 1; - if (st->post[i]>100) - st->post[i]=100; - /*if (st->post[i]<0) - st->post[i]=0;*/ - mean_post+=st->post[i]; - } - mean_post /= N; - if (mean_post<0) - mean_post=0; - - /* Special case for first frame */ - if (st->nb_adapt==1) - for (i=1;iold_ps[i] = ps[i]; - - /* Compute a priori SNR */ - { - /* A priori update rate */ - float gamma; - float min_gamma=0.12; - gamma = 1.0/st->nb_preprocess; - - /*Make update rate smaller when there's no speech*/ -#if 0 - if (mean_post<3.5 && mean_prior < 1) - min_gamma *= (mean_post+.5); - else - min_gamma *= 4.; -#else - min_gamma = .1*fabs(mean_prior - mean_post)*fabs(mean_prior - mean_post); - if (min_gamma>.15) - min_gamma = .15; - if (min_gamma<.02) - min_gamma = .02; -#endif - /*min_gamma = .08;*/ - - /*if (gammaprior[i] = gamma*max(0.0,st->post[i]) + - (1-gamma)*st->gain[i]*st->gain[i]*st->old_ps[i]/(1+st->noise[i]+st->echo_noise[i]); - - if (st->prior[i]>100) - st->prior[i]=100; - - mean_prior+=st->prior[i]; - } - } - mean_prior /= N; - -#if 0 - for (i=0;iprior[i]); - } - fprintf (stderr, "\n"); -#endif - /*fprintf (stderr, "%f %f\n", mean_prior,mean_post);*/ - - if (st->nb_preprocess>=20) - { - int do_update = 0; - float noise_ener=0, sig_ener=0; - /* If SNR is low (both a priori and a posteriori), update the noise estimate*/ - /*if (mean_prior<.23 && mean_post < .5)*/ - if (mean_prior<.23 && mean_post < .5) - do_update = 1; - for (i=1;inoise[i]; - sig_ener += ps[i]; - } - if (noise_ener > 3*sig_ener) - do_update = 1; - /*do_update = 0;*/ - if (do_update) - { - st->consec_noise++; - } else { - st->consec_noise=0; - } - } - - if (st->vad_enabled) - is_speech = speex_compute_vad(st, ps, mean_prior, mean_post); - - - if (st->consec_noise>=3) - { - update_noise(st, st->old_ps, echo); - } else { - for (i=1;iupdate_prob[i]<.5) - st->noise[i] = .90*st->noise[i] + .1*st->ps[i]; - } - } - - for (i=1;izeta[i] = .7*st->zeta[i] + .3*st->prior[i]; - } - - { - int freq_start = (int)(300.0*2*N/st->sampling_rate); - int freq_end = (int)(2000.0*2*N/st->sampling_rate); - for (i=freq_start;izeta[i]; - } - } - - Zframe /= N; - if (Zframe 1.5*st->Zlast) - { - Pframe = 1; - st->Zpeak = Zframe; - if (st->Zpeak > 10) - st->Zpeak = 10; - if (st->Zpeak < 1) - st->Zpeak = 1; - } else { - if (Zframe < st->Zpeak*ZMIN) - { - Pframe = 0; - } else if (Zframe > st->Zpeak*ZMAX) - { - Pframe = 1; - } else { - Pframe = log(Zframe/(st->Zpeak*ZMIN)) / log(ZMAX/ZMIN); - } - } - } - st->Zlast = Zframe; - - /*fprintf (stderr, "%f\n", Pframe);*/ - /* Compute gain according to the Ephraim-Malah algorithm */ - ephraim_malah(st,N,Pframe); - - if (st->agc_enabled) - speex_compute_agc(st, mean_prior); - -#if 0 - if (!is_speech) - { - for (i=0;igain2[i] = 0; - } -#if 0 - else { - for (i=0;igain2[i] = 1; - } -#endif -#endif - - /* PERF: 14% when only vad is enabled [7.0 vs 8.2 sec] */ - if(st->agc_enabled || st->denoise_enabled) { - /* Apply computed gain */ - for (i=1;iframe[2*i-1] *= st->gain2[i]; - st->frame[2*i] *= st->gain2[i]; - } - - /* Get rid of the DC and very low frequencies */ - st->frame[0]=0; - st->frame[1]=0; - st->frame[2]=0; - /* Nyquist frequency is mostly useless too */ - st->frame[2*N-1]=0; - - /* Inverse FFT with 1/N scaling */ - drft_backward(st->fft_lookup, st->frame); - - for (i=0;i<2*N;i++) - st->frame[i] *= scale; - - { - float max_sample=0; - for (i=0;i<2*N;i++) - if (fabs(st->frame[i])>max_sample) - max_sample = fabs(st->frame[i]); - if (max_sample>28000) - { - float damp = 28000./max_sample; - for (i=0;i<2*N;i++) - st->frame[i] *= damp; - } - } - - for (i=0;i<2*N;i++) - st->frame[i] *= st->window[i]; - - /* Perform overlap and add */ - for (i=0;ioutbuf[i] + st->frame[i]; - for (i=0;iframe[N3+i]; - - /* Update outbuf */ - for (i=0;ioutbuf[i] = st->frame[st->frame_size+i]; - } - - /* Save old power spectrum */ - for (i=1;iold_ps[i] = ps[i]; - - return is_speech; -} - -void speex_preprocess_estimate_update(SpeexPreprocessState *st, short *x, float *noise) -{ - int i; - int N = st->ps_size; - int N3 = 2*N - st->frame_size; - - float *ps=st->ps; - - preprocess_analysis(st, x); - - update_noise_prob(st); - - st->nb_preprocess++; - - for (i=1;iupdate_prob[i]<.5) - st->noise[i] = .90*st->noise[i] + .1*ps[i]; - } - - for (i=0;ioutbuf[i] = x[st->frame_size-N3+i]*st->window[st->frame_size+i]; - - /* Save old power spectrum */ - for (i=1;iold_ps[i] = ps[i]; - -} - - -int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *ptr) -{ - SpeexPreprocessState *st; - st=(SpeexPreprocessState*)state; - switch(request) - { - case SPEEX_PREPROCESS_SET_DENOISE: - st->denoise_enabled = (*(int*)ptr); - break; - case SPEEX_PREPROCESS_GET_DENOISE: - (*(int*)ptr) = st->denoise_enabled; - break; - - case SPEEX_PREPROCESS_SET_AGC: - st->agc_enabled = (*(int*)ptr); - break; - case SPEEX_PREPROCESS_GET_AGC: - (*(int*)ptr) = st->agc_enabled; - break; - - case SPEEX_PREPROCESS_SET_AGC_LEVEL: - st->agc_level = (*(float*)ptr); - if (st->agc_level<1) - st->agc_level=1; - if (st->agc_level>32768) - st->agc_level=32768; - break; - case SPEEX_PREPROCESS_GET_AGC_LEVEL: - (*(float*)ptr) = st->agc_level; - break; - - case SPEEX_PREPROCESS_SET_VAD: - st->vad_enabled = (*(int*)ptr); - break; - case SPEEX_PREPROCESS_GET_VAD: - (*(int*)ptr) = st->vad_enabled; - break; - - case SPEEX_PREPROCESS_SET_PROB_START: - st->speech_prob_start = (*(float*)ptr) ; - if ( st->speech_prob_start > 1 ) - st->speech_prob_start = st->speech_prob_start / 100 ; - if ( st->speech_prob_start > 1 || st->speech_prob_start < 0 ) - st->speech_prob_start = SPEEX_PROB_START ; - break ; - case SPEEX_PREPROCESS_GET_PROB_START: - (*(float*)ptr) = st->speech_prob_start ; - break ; - - case SPEEX_PREPROCESS_SET_PROB_CONTINUE: - st->speech_prob_continue = (*(float*)ptr) ; - if ( st->speech_prob_continue > 1 ) - st->speech_prob_continue = st->speech_prob_continue / 100 ; - if ( st->speech_prob_continue > 1 || st->speech_prob_continue < 0 ) - st->speech_prob_continue = SPEEX_PROB_CONTINUE ; - break ; - break ; - case SPEEX_PREPROCESS_GET_PROB_CONTINUE: - (*(float*)ptr) = st->speech_prob_continue ; - break ; - - default: - speex_warning_int("Unknown speex_preprocess_ctl request: ", request); - return -1; - } - return 0; -} diff --git a/app_conference/libspeex/qc_20060323.zip b/app_conference/libspeex/qc_20060323.zip deleted file mode 100644 index a2a4d3b3..00000000 Binary files a/app_conference/libspeex/qc_20060323.zip and /dev/null differ diff --git a/app_conference/libspeex/smallft.c b/app_conference/libspeex/smallft.c deleted file mode 100644 index 2a4fc02a..00000000 --- a/app_conference/libspeex/smallft.c +++ /dev/null @@ -1,1256 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * - * by the XIPHOPHORUS Company http://www.xiph.org/ * - * * - ******************************************************************** - - function: *unnormalized* fft transform - last mod: $Id: smallft.c,v 1.3 2005/03/25 20:26:26 stevek Exp $ - - ********************************************************************/ - -/* FFT implementation from OggSquish, minus cosine transforms, - * minus all but radix 2/4 case. In Vorbis we only need this - * cut-down version. - * - * To do more than just power-of-two sized vectors, see the full - * version I wrote for NetLib. - * - * Note that the packing is a little strange; rather than the FFT r/i - * packing following R_0, I_n, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, - * it follows R_0, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, I_n like the - * FORTRAN version - */ - -#include -#include "smallft.h" -#include "misc.h" - -static void drfti1(int n, float *wa, int *ifac){ - static int ntryh[4] = { 4,2,3,5 }; - static float tpi = 6.28318530717958648f; - float arg,argh,argld,fi; - int ntry=0,i,j=-1; - int k1, l1, l2, ib; - int ld, ii, ip, is, nq, nr; - int ido, ipm, nfm1; - int nl=n; - int nf=0; - - L101: - j++; - if (j < 4) - ntry=ntryh[j]; - else - ntry+=2; - - L104: - nq=nl/ntry; - nr=nl-ntry*nq; - if (nr!=0) goto L101; - - nf++; - ifac[nf+1]=ntry; - nl=nq; - if(ntry!=2)goto L107; - if(nf==1)goto L107; - - for (i=1;i>1; - ipp2=ip; - idp2=ido; - nbd=(ido-1)>>1; - t0=l1*ido; - t10=ip*ido; - - if(ido==1)goto L119; - for(ik=0;ikl1){ - for(j=1;j>1; - ipp2=ip; - ipph=(ip+1)>>1; - if(idol1)goto L139; - - is= -ido-1; - t1=0; - for(j=1;jn==1)return; - drftf1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache); -} - -void drft_backward(struct drft_lookup *l,float *data){ - if (l->n==1)return; - drftb1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache); -} - -void drft_init(struct drft_lookup *l,int n) -{ - l->n=n; - l->trigcache=(float*)speex_alloc(3*n*sizeof(*l->trigcache)); - l->splitcache=(int*)speex_alloc(32*sizeof(*l->splitcache)); - fdrffti(n, l->trigcache, l->splitcache); -} - -void drft_clear(struct drft_lookup *l) -{ - if(l) - { - if(l->trigcache) - speex_free(l->trigcache); - if(l->splitcache) - speex_free(l->splitcache); - } -} diff --git a/app_conference/libspeex/smallft.h b/app_conference/libspeex/smallft.h deleted file mode 100644 index d44c41b1..00000000 --- a/app_conference/libspeex/smallft.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * - * by the XIPHOPHORUS Company http://www.xiph.org/ * - * * - ******************************************************************** - - function: fft transform - last mod: $Id: smallft.h,v 1.2 2004/07/07 13:39:42 stevek Exp $ - - ********************************************************************/ - -#ifndef _V_SMFT_H_ -#define _V_SMFT_H_ - -/*#include "vorbis/codec.h"*/ - -#ifdef __cplusplus -extern "C" { -#endif - -struct drft_lookup{ - int n; - float *trigcache; - int *splitcache; -}; - -extern void drft_forward(struct drft_lookup *l,float *data); -extern void drft_backward(struct drft_lookup *l,float *data); -extern void drft_init(struct drft_lookup *l,int n); -extern void drft_clear(struct drft_lookup *l); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/app_conference/libspeex/speex_preprocess.h b/app_conference/libspeex/speex_preprocess.h deleted file mode 100644 index 320224ea..00000000 --- a/app_conference/libspeex/speex_preprocess.h +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright (C) 2003 Epic Games - Written by Jean-Marc Valin - - File: speex_preprocess.h - - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - - -#ifdef __cplusplus -extern "C" { -#endif - -struct drft_lookup; - -typedef struct SpeexPreprocessState { - int frame_size; /**< Number of samples processed each time */ - int ps_size; /**< Number of points in the power spectrum */ - int sampling_rate; /**< Sampling rate of the input/output */ - - /* parameters */ - int denoise_enabled; - int agc_enabled; - float agc_level; - int vad_enabled; - - // probabilities to check speech_prob against - float speech_prob_start ; - float speech_prob_continue ; - - float *frame; /**< Processing frame (2*ps_size) */ - float *ps; /**< Current power spectrum */ - float *gain2; /**< Adjusted gains */ - float *window; /**< Analysis/Synthesis window */ - float *noise; /**< Noise estimate */ - float *old_ps; /**< Power spectrum for last frame */ - float *gain; /**< Ephraim Malah gain */ - float *prior; /**< A-priori SNR */ - float *post; /**< A-posteriori SNR */ - - float *S; /**< Smoothed power spectrum */ - float *Smin; /**< See Cohen paper */ - float *Stmp; /**< See Cohen paper */ - float *update_prob; /**< Propability of speech presence for noise update */ - - float *zeta; /**< Smoothed a priori SNR */ - float Zpeak; - float Zlast; - - float *loudness_weight; /**< Perceptual loudness curve */ - - float *echo_noise; - - float *noise_bands; - float *noise_bands2; - int noise_bandsN; - float *speech_bands; - float *speech_bands2; - int speech_bandsN; - - float *inbuf; /**< Input buffer (overlapped analysis) */ - float *outbuf; /**< Output buffer (for overlap and add) */ - - float speech_prob; - int last_speech; - float loudness; /**< loudness estimate */ - float loudness2; /**< loudness estimate */ - int nb_adapt; /**< Number of frames used for adaptation so far */ - int nb_loudness_adapt; /**< Number of frames used for loudness adaptation so far */ - int consec_noise; /**< Number of consecutive noise frames */ - int nb_preprocess; /**< Number of frames processed so far */ - struct drft_lookup *fft_lookup; /**< Lookup table for the FFT */ - -} SpeexPreprocessState; - -/** Creates a new preprocessing state */ -SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate); - -/** Destroys a denoising state */ -void speex_preprocess_state_destroy(SpeexPreprocessState *st); - -/** Preprocess a frame */ -int speex_preprocess(SpeexPreprocessState *st, short *x, float *noise); - -/** Preprocess a frame */ -void speex_preprocess_estimate_update(SpeexPreprocessState *st, short *x, float *noise); - -/** Used like the ioctl function to control the preprocessor parameters */ -int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr); - -#define SPEEX_PROB_START 0.35 -#define SPEEX_PROB_CONTINUE 0.1 - -#define SPEEX_PREPROCESS_SET_DENOISE 0 -#define SPEEX_PREPROCESS_GET_DENOISE 1 - -#define SPEEX_PREPROCESS_SET_AGC 2 -#define SPEEX_PREPROCESS_GET_AGC 3 - -#define SPEEX_PREPROCESS_SET_VAD 4 -#define SPEEX_PREPROCESS_GET_VAD 5 - -#define SPEEX_PREPROCESS_SET_AGC_LEVEL 6 -#define SPEEX_PREPROCESS_GET_AGC_LEVEL 7 - -#define SPEEX_PREPROCESS_SET_PROB_START 8 -#define SPEEX_PREPROCESS_GET_PROB_START 9 - -#define SPEEX_PREPROCESS_SET_PROB_CONTINUE 10 -#define SPEEX_PREPROCESS_GET_PROB_CONTINUE 11 - -#ifdef __cplusplus -} -#endif diff --git a/app_conference/member.c b/app_conference/member.c deleted file mode 100644 index 30f6ccc8..00000000 --- a/app_conference/member.c +++ /dev/null @@ -1,1946 +0,0 @@ - -// $Id: member.c,v 1.9-1 2006/06/01 16:10:10 mflorell Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003, 2004 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#include "member.h" -#include "regex.h" - - - -// process an incoming frame. Returns 0 normally, 1 if hangup was received. -static int process_incoming(struct ast_conference *conf, struct ast_conf_member *member, struct ast_frame *f) -{ - - int silent_frame = 0; - - if ( - f->frametype == AST_FRAME_DTMF - && member->send_dtmf - ) - { // send the DTMF event to the MGR interface.. - manager_event( - EVENT_FLAG_CALL, - "ConferenceDTMF", - "Channel: %s\r\n" - "Key: %c\r\n", - member->channel_name, - f->subclass - ) ; - - ast_frfree(f); - f = NULL; - } - else if ( member->type == 'L' ) - { - // this is a listen-only user, ignore the frame - ast_frfree( f ) ; - f = NULL ; - } - else if ( ( f->frametype == AST_FRAME_VOICE ) || (f->frametype == AST_FRAME_DTMF) ) -// else if ( f->frametype == AST_FRAME_VOICE ) - { - // accounting: count the incoming frame - member->frames_in++ ; - - if (f->frametype == AST_FRAME_DTMF) - { - if ( (member->inband_dtmf == -1) || (member->rfc_dtmf == -1) ) - { - char *digit = "X" ; - char *dtmfRFC = "X" ; - int conf_count ; - struct ast_conf_member *membertest; - - if (f->subclass == 35) { digit = "hash" ; dtmfRFC = "#" ; } - if (f->subclass == 42) { digit = "star" ; dtmfRFC = "*" ; } - if (f->subclass == 48) { digit = "0" ; dtmfRFC = "0" ; } - if (f->subclass == 49) { digit = "1" ; dtmfRFC = "1" ; } - if (f->subclass == 50) { digit = "2" ; dtmfRFC = "2" ; } - if (f->subclass == 51) { digit = "3" ; dtmfRFC = "3" ; } - if (f->subclass == 52) { digit = "4" ; dtmfRFC = "4" ; } - if (f->subclass == 53) { digit = "5" ; dtmfRFC = "5" ; } - if (f->subclass == 54) { digit = "6" ; dtmfRFC = "6" ; } - if (f->subclass == 55) { digit = "7" ; dtmfRFC = "7" ; } - if (f->subclass == 56) { digit = "8" ; dtmfRFC = "8" ; } - if (f->subclass == 57) { digit = "9" ; dtmfRFC = "9" ; } - - ast_log( LOG_NOTICE, "DTMF debug frame output to voice %d - %s\n", f->subclass, digit ) ; - - int res = 0 ; - int dtmf_invalid = 0 ; - regex_t re; - - if(regcomp(&re, digit, REG_EXTENDED|REG_NOSUB) != 0) { dtmf_invalid = 0; } - dtmf_invalid = regexec(&re, "0123456789*#abcdABCDstarhash", (size_t)0, NULL, 0); - regfree(&re); - ast_log( LOG_NOTICE, "Regex debug %d - %s - %s\n", dtmf_invalid, member->channel_name, digit) ; - - // play DTMF for other members of the conference - membertest = conf->memberlist ; - conf_count = conf->membercount ; - - // ast_log( LOG_NOTICE, "2 DTMF debug frame output to voice, conf count %d\n", conf_count) ; - - while (membertest != NULL) - { - - if( (!strcmp(membertest->channel_name, member->channel_name)) || ( digit == "X" ) ) - { - ast_log( LOG_ERROR, "skipping playing DTMF tone on %s\n", membertest->channel_name ) ; - } - else - { - - if (member->inband_dtmf == -1) - { - if (!basic_play_sound ( membertest->channel_name, digit )) - { - ast_log( LOG_ERROR, "playing DTMF tone FAILED on %s\n", membertest->channel_name ) ; - } - } - - if (member->rfc_dtmf == -1) - { - ast_log( LOG_NOTICE, "START sending DTMF signal on %s\n", membertest->channel_name ) ; - - if(dtmf_invalid > 0) - { - ast_log(LOG_WARNING, "Illegal DTMF character '%s' in string. (0-9*#aAbBcCdD allowed)\n", digit); - } - else - { - - res = ast_dtmf_stream(membertest->chan,NULL,digit,250); - if (res) - { - ast_log( LOG_NOTICE, "DTMF signal %s on %s sent\n", digit, membertest->channel_name ) ; - } - } - } - } - membertest = membertest->next; - } - } - - - } - - -#ifdef DEBUG_OUTPUT_PCM - // !!! TESTING !!! - if ( member->incoming_fh != NULL ) - { - fwrite( f->data, f->datalen, 1, member->incoming_fh ) ; - fflush( member->incoming_fh ) ; - } -#endif - -#if ( SILDET == 2 ) - // - // make sure we have a valid dsp and frame type - // - if ( - member->dsp != NULL - && f->subclass == AST_FORMAT_SLINEAR - && f->datalen == AST_CONF_FRAME_DATA_SIZE - ) - { - // send the frame to the preprocessor -#ifdef DEBUG_USE_TIMELOG - int spx_ret; - TIMELOG(spx_ret = speex_preprocess( member->dsp, f->data, NULL ), 3, "speex_preprocess"); - if ( spx_ret == 0 ) -#else - if ( speex_preprocess( member->dsp, f->data, NULL ) == 0 ) -#endif - { - // - // we ignore the preprocessor's outcome if we've seen voice frames - // in within the last AST_CONF_SKIP_SPEEX_PREPROCESS frames - // - if ( member->ignore_speex_count > 0 ) - { - // ast_log( AST_CONF_DEBUG, "ignore_speex_count => %d\n", member->ignore_speex_count ) ; - - // skip speex_preprocess(), and decrement counter - --member->ignore_speex_count ; - } - else - { - // set silent_frame flag - silent_frame = 1 ; - } - } - else - { - // voice detected, reset skip count - member->ignore_speex_count = AST_CONF_SKIP_SPEEX_PREPROCESS ; - } - } -#endif - - // used to debug drop off in received frames - // struct timeval tv ; - // gettimeofday( &tv, NULL ) ; - - if ( silent_frame == 1 ) - { - // ignore silent frames - // ast_log( AST_CONF_DEBUG, "RECEIVED SILENT FRAME, channel => %s, frames_in => %ld, s => %ld, ms => %ld\n", - // member->channel_name, member->frames_in, tv.tv_sec, tv.tv_usec ) ; - } - else - { - // queue a non-silent frame for mixing - - // ast_log( AST_CONF_DEBUG, "RECEIVED VOICE FRAME, channel => %s, frames_in => %ld, s => %ld, ms => %ld\n", - // member->channel_name, member->frames_in, tv.tv_sec, tv.tv_usec ) ; - - // acquire member lock - ast_mutex_lock( &member->lock ) ; - - // - // queue up the voice frame so the conference - // thread can mix them before sending - // - - // struct ast_frame* af = ast_frdup( f ) ; - - // if ( queue_incoming_frame( member, af ) != 0 ) - if ( queue_incoming_frame( member, f ) != 0 ) - { - // free the duplicated frame, if we can't queue it - // ast_log( LOG_NOTICE, "dropped incoming frame, channel => %s\n", chan->name ) ; - // ast_frfree( af ) ; - // af = NULL ; - } - else - { - // everything is going ok - } - - // release member mutex - ast_mutex_unlock( &member->lock ) ; - } - - // free the original frame - ast_frfree( f ) ; - f = NULL ; - } - else if ( - f->frametype == AST_FRAME_CONTROL - && f->subclass == AST_CONTROL_HANGUP - ) - { - // hangup received - - // free the frame - ast_frfree( f ) ; - f = NULL ; - - // break out of the while ( 42 == 42 ) - return 1 ; - } - else - { - // undesirables - ast_frfree( f ) ; - f = NULL ; - } - return 0; -} - -// get the next frame from the soundq; must be called with member locked. -static struct ast_frame *get_next_soundframe(struct ast_conf_member *member, struct ast_frame - *exampleframe) { - struct ast_frame *f; - -again: - f=ast_readframe(member->soundq->stream); - - if(!f) { // we're done with this sound; remove it from the queue, and try again - struct ast_conf_soundq *toboot = member->soundq; - - ast_closestream(toboot->stream); - member->soundq = toboot->next; - - //ast_log( LOG_WARNING, "finished playing a sound, next = %x\n", member->soundq); - // notify applications via mgr interface that this sound has been played - manager_event( - EVENT_FLAG_CALL, - "ConferenceSoundComplete", - "Channel: %s\r\n" - "Sound: %s\r\n", - member->channel_name, - toboot->name - ); - - free(toboot); - if(member->soundq) goto again; - - // if we get here, we've gotten to the end of the queue; reset write format - if ( ast_set_write_format( member->chan, member->write_format ) < 0 ) - { - ast_log( LOG_ERROR, "unable to set write format to %d\n", - member->write_format ) ; - } - } else { - // copy delivery from exampleframe - f->delivery = exampleframe->delivery; - } - - return f; -} - -// process outgoing frames for the channel, playing either normal conference audio, -// or requested sounds -static int process_outgoing(struct ast_conf_member *member) -{ - conf_frame* cf ; // frame read from the output queue - struct ast_frame *f; - struct ast_frame *realframe = NULL; - - for(;;) - { - // acquire member mutex and grab a frame. - ast_mutex_lock( &member->lock ) ; - cf = get_outgoing_frame( member ) ; - - // if there's no frames exit the loop. - if(!cf){ - ast_mutex_unlock( &member->lock ) ; - break; - } - - f = cf->fr; - - // if we're playing sounds, we can just replace the frame with the - // next sound frame, and send it instead - if(member->soundq) { - realframe = f; - f = get_next_soundframe(member, f); - if(!f) { // if we didn't get anything, just revert to "normal" - f = realframe; - realframe = NULL; - } - } - - ast_mutex_unlock(&member->lock); - -#ifdef DEBUG_FRAME_TIMESTAMPS - // !!! TESTING !!! - int delivery_diff = usecdiff( &f->delivery, &member->lastsent_timeval ) ; - if ( ( delivery_diff != AST_CONF_FRAME_INTERVAL ) && - ( delivery_diff != 2 * AST_CONF_FRAME_INTERVAL ) && - ( delivery_diff != 3 * AST_CONF_FRAME_INTERVAL ) ) - { - ast_log( AST_CONF_DEBUG, "unanticipated delivery time, delivery_diff => %d, delivery.tv_usec => %ld\n", - delivery_diff, f->delivery.tv_usec ) ; - } - - // !!! TESTING !!! - if ( - f->delivery.tv_sec < member->lastsent_timeval.tv_sec - || ( - f->delivery.tv_sec == member->lastsent_timeval.tv_sec - && f->delivery.tv_usec <= member->lastsent_timeval.tv_usec - ) - ) - { - ast_log( LOG_WARNING, "queued frame timestamped in the past, %ld.%ld <= %ld.%ld\n", - f->delivery.tv_sec, f->delivery.tv_usec, - member->lastsent_timeval.tv_sec, member->lastsent_timeval.tv_usec ) ; - } - member->lastsent_timeval = f->delivery ; -#endif - -//#ifdef DEBUG_USE_TIMELOG -// TIMELOG( ast_write( member->chan, f ), 10, "member: ast_write"); -//#else - // send the voice frame - if ( ast_write( member->chan, f ) == 0 ) - { - // struct timeval tv ; - // gettimeofday( &tv, NULL ) ; - // ast_log( AST_CONF_DEBUG, "SENT VOICE FRAME, channel => %s, frames_out => %ld, s => %ld, ms => %ld\n", - // member->channel_name, member->frames_out, tv.tv_sec, tv.tv_usec ) ; - } - else - { - // log 'dropped' outgoing frame - ast_log( LOG_ERROR, "unable to write voice frame to channel, channel => %s\n", member->channel_name ) ; - - // accounting: count dropped outgoing frames - member->frames_out_dropped++ ; - } -//#endif - - // clean up frame - delete_conf_frame( cf ) ; - } - return 0; -} - -// -// main member thread function -// - -int member_exec( struct ast_channel* chan, void* data ) -{ -// struct timeval start, end ; -// gettimeofday( &start, NULL ) ; - - struct ast_conference *conf ; - struct ast_conf_member *member, *membertest; - - struct ast_frame *f ; // frame received from ast_read() - - int left = 0 ; - int res; - - ast_log( AST_CONF_DEBUG, "[ $Revision: 1.9 $ ] begin processing member thread, channel => %s\n", chan->name ) ; - - // - // If the call has not yet been answered, answer the call - // Note: asterisk apps seem to check _state, but it seems like it's safe - // to just call ast_answer. It will just do nothing if it is up. - // it will also return -1 if the channel is a zombie, or has hung up. - // - - res = ast_answer( chan ) ; - if ( res ) - { - ast_log( LOG_ERROR, "unable to answer call\n" ) ; - return -1 ; - } - - // - // create a new member for the conference - // - -// ast_log( AST_CONF_DEBUG, "creating new member, id => %s, flags => %s, p => %s\n", -// id, flags, priority ) ; - - member = create_member( chan, (const char*)( data ) ) ; // flags, atoi( priority ) ) ; - - // unable to create member, return an error - if ( member == NULL ) - { - ast_log( LOG_ERROR, "unable to create member\n" ) ; - return -1 ; - } - - // - // setup asterisk read/write formats - // - - ast_log( AST_CONF_DEBUG, "CHANNEL INFO, CHANNEL => %s, DNID => %s, CALLER_ID => %s, ANI => %s\n", - chan->name, chan->cid.cid_dnid, chan->cid.cid_num, chan->cid.cid_ani ) ; - - ast_log( AST_CONF_DEBUG, "CHANNEL CODECS, CHANNEL => %s, NATIVE => %d, READ => %d, WRITE => %d\n", - chan->name, chan->nativeformats, member->read_format, member->write_format ) ; - - if ( ast_set_read_format( chan, member->read_format ) < 0 ) - { - ast_log( LOG_ERROR, "unable to set read format to signed linear\n" ) ; - delete_member( member ) ; - return -1 ; - } - - // for right now, we'll send everything as slinear - if ( ast_set_write_format( chan, member->write_format ) < 0 ) // AST_FORMAT_SLINEAR, chan->nativeformats - { - ast_log( LOG_ERROR, "unable to set write format to signed linear\n" ) ; - delete_member( member ) ; - return -1 ; - } - - // - // setup a conference for the new member - // - - conf = start_conference( member ) ; - - if ( conf == NULL ) - { - ast_log( LOG_ERROR, "unable to setup member conference\n" ) ; - delete_member( member) ; - return -1 ; - } - -#ifdef DEBUG_OUTPUT_PCM - // !!! TESTING !!! - char* incoming_fn = malloc( 512 ) ; - snprintf( incoming_fn, 512, "/tmp/ac_%s_%ld.gsm", chan->dnid, fr_base.tv_usec ) ; - - // !!! TESTING !!! - member->incoming_fh = ( member->read_format == 2 ) - ? fopen( member->incoming_fn, "wb" ) - : NULL - ; - - // !!! TESTING !!! - if ( member->incoming_fh == NULL ) - { - ast_log( AST_CONF_DEBUG, "incoming_fh is null, incoming_fn => %s\n", incoming_fn ) ; - } - else - { - ast_log( AST_CONF_DEBUG, "incoming_fh is not null, incoming_fn => %s\n", incoming_fn ) ; - } - - // !!! TESTING !!! - free( incoming_fn ) ; -#endif - - // - // process loop for new member ( this runs in it's own thread - // - - ast_log( AST_CONF_DEBUG, "begin member event loop, channel => %s\n", chan->name ) ; - - // timer timestamps - struct timeval base, curr ; - gettimeofday( &base, NULL ) ; - - - - // tell conference_exec we're ready for frames - member->ready_for_outgoing = 1 ; - - int conf_count = 0 ; - int silent_entry = 0 ; - - // entry message for other members of the conference - membertest = conf->memberlist ; - conf_count = conf->membercount ; - - ast_log( LOG_NOTICE, "Conference Members: %d\n", conf_count ) ; - - if (member->quiet_entry_exit == -1) - { - silent_entry = 1 ; - } - ast_log( LOG_NOTICE, "Quiet debug %d - %d\n", member->quiet_entry_exit, silent_entry ) ; - - while (membertest != NULL) - { - if (silent_entry < 1) - { - if( (!strcmp(membertest->channel_name, member->channel_name)) && (conf_count < 2) ) - { - ast_log( LOG_NOTICE, "skipping entry message on %s\n", membertest->channel_name ) ; - - if (!basic_play_sound ( member->channel_name, "conf-onlyperson" )) - { - ast_log( LOG_ERROR, "playing conference welcome message FAILED\n" ) ; - } - } - else - { - if (!basic_play_sound ( membertest->channel_name, "enter" )) - { - ast_log( LOG_ERROR, "playing conference entry message FAILED on %s\n", membertest->channel_name ) ; - } - } - } - else - { - ast_log( LOG_NOTICE, "skipping all entry messages on %s\n", membertest->channel_name ) ; - } - - membertest = membertest->next; - } - - - - while ( 42 == 42 ) - { - // make sure we have a channel to process - if ( chan == NULL ) - { - ast_log( LOG_NOTICE, "member channel has closed\n" ) ; - break ; - } - - //-----------------// - // INCOMING FRAMES // - //-----------------// - - // wait for an event on this channel - left = ast_waitfor( chan, AST_CONF_WAITFOR_LATENCY ) ; - - // ast_log( AST_CONF_DEBUG, "received event on channel, name => %s, rest => %d\n", chan->name, rest ) ; - - if ( left < 0 ) - { - // an error occured - ast_log( - LOG_NOTICE, - "an error occured waiting for a frame, channel => %s, error => %d\n", - chan->name, left - ) ; - } - else if ( left == 0 ) - { - // no frame has arrived yet - // ast_log( LOG_NOTICE, "no frame available from channel, channel => %s\n", chan->name ) ; - } - else if ( left > 0 ) - { - // a frame has come in before the latency timeout - // was reached, so we process the frame - - f = ast_read( chan ) ; - - if ( f == NULL ) - { - ast_log( LOG_NOTICE, "unable to read from channel, channel => %s\n", chan->name ) ; - break ; - } - - // actually process the frame: break if we got hangup. - if(process_incoming(conf, member, f)) break; - - } - - //-----------------// - // OUTGOING FRAMES // - //-----------------// - - // update the current timestamps - gettimeofday( &curr, NULL ) ; - - process_outgoing(member); - - - // back to process incoming frames - continue ; - } - - ast_log( AST_CONF_DEBUG, "end member event loop, time_entered => %ld\n", member->time_entered.tv_sec ) ; - - // - // clean up - // - -#ifdef DEBUG_OUTPUT_PCM - // !!! TESTING !!! - if ( member->incoming_fh != NULL ) - fclose( member->incoming_fh ) ; -#endif - - if ( member != NULL ) member->remove_flag = 1 ; - -// gettimeofday( &end, NULL ) ; -// int expected_frames = ( int )( floor( (double)( usecdiff( &end, &start ) / AST_CONF_FRAME_INTERVAL ) ) ) ; -// ast_log( AST_CONF_DEBUG, "expected_frames => %d\n", expected_frames ) ; - - return -1 ; -} - -// basic sound playing function -int basic_play_sound ( char *channel, char *file ) -{ -// char *channel, *file; - struct ast_conf_member *play_member; - struct ast_conf_soundq *newsound; - struct ast_conf_soundq **q; - - play_member = find_member(channel, 1); - if(!play_member) { - ast_log( LOG_ERROR, "Member %s not found\n", channel) ; - return 0; - } - - newsound = calloc(1,sizeof(struct ast_conf_soundq)); - newsound->stream = ast_openstream(play_member->chan, file, NULL); - if(!newsound->stream) { - free(newsound); - ast_mutex_unlock(&play_member->lock); - ast_log( LOG_ERROR, "sound file not found\n" ) ; - } - play_member->chan->stream = NULL; - - ast_copy_string(newsound->name, file, sizeof(newsound->name)); - - // append sound to the end of the list. - for(q=&play_member->soundq; *q; q = &((*q)->next)) ;; - - *q = newsound; - - ast_mutex_unlock(&play_member->lock); - - ast_log( LOG_NOTICE, "playing conference message %s\n", file ) ; - return 1; -} - -// -// manange member functions -// - -struct ast_conf_member* create_member( struct ast_channel *chan, const char* data ) -{ - // - // check input - // - - if ( chan == NULL ) - { - ast_log( LOG_ERROR, "unable to create member with null channel\n" ) ; - return NULL ; - } - - if ( chan->name == NULL ) - { - ast_log( LOG_ERROR, "unable to create member with null channel name\n" ) ; - return NULL ; - } - - // - // allocate memory for new conference member - // - - struct ast_conf_member *member = calloc( 1, sizeof( struct ast_conf_member ) ) ; - - if ( member == NULL ) - { - ast_log( LOG_ERROR, "unable to malloc ast_conf_member\n" ) ; - return NULL ; - } - - // initialize mutex - ast_mutex_init( &member->lock ) ; - - // - // initialize member with passed data values - // - - char argstr[80] ; - char *stringp, *token ; - - // copy the passed data - strncpy( argstr, data, sizeof(argstr) - 1 ) ; - - // point to the copied data - stringp = argstr ; - - ast_log( AST_CONF_DEBUG, "attempting to parse passed params, stringp => %s\n", stringp ) ; - - // parse the id - if ( ( token = strsep( &stringp, "|" ) ) != NULL ) - { - member->id = malloc( strlen( token ) + 1 ) ; - strcpy( member->id, token ) ; - } - else - { - ast_log( LOG_ERROR, "unable to parse member id\n" ) ; - free( member ) ; - return NULL ; - } - - // parse the flags - if ( ( token = strsep( &stringp, "|" ) ) != NULL ) - { - member->flags = malloc( strlen( token ) + 1 ) ; - strcpy( member->flags, token ) ; - } - else - { - // make member->flags something - member->flags = malloc( sizeof( char ) ) ; - memset( member->flags, 0x0, sizeof( char ) ) ; - } - - // parse the priority - member->priority = ( token = strsep( &stringp, "|" ) ) != NULL - ? atoi( token ) - : 0 - ; - - // parse the vad_prob_start - member->vad_prob_start = ( token = strsep( &stringp, "|" ) ) != NULL - ? atof( token ) - : AST_CONF_PROB_START - ; - - // parse the vad_prob_continue - member->vad_prob_continue = ( token = strsep( &stringp, "|" ) ) != NULL - ? atof( token ) - : AST_CONF_PROB_CONTINUE - ; - - // parse the expected frame size, in samples. ?? - - - // debugging - ast_log( - AST_CONF_DEBUG, - "parsed data params, id => %s, flags => %s, priority => %d, vad_prob_start => %f, vad_prob_continue => %f\n", - member->id, member->flags, member->priority, member->vad_prob_start, member->vad_prob_continue - ) ; - - // - // initialize member with default values - // - - // keep pointer to member's channel - member->chan = chan ; - - // copy the channel name - member->channel_name = malloc( strlen( chan->name ) + 1 ) ; - strcpy( member->channel_name, chan->name ) ; - - // ( default can be overridden by passed flags ) -// member->type = 'L' ; - member->type = 'S' ; - - // ready flag - member->ready_for_outgoing = 0 ; - - // incoming frame queue - member->inFrames = NULL ; - member->inFramesTail = NULL ; - member->inFramesCount = 0 ; - - // last frame caching - member->inFramesRepeatLast = 0 ; - member->inFramesLast = NULL ; - member->okayToCacheLast = 0 ; - - // outgoing frame queue - member->outFrames = NULL ; - member->outFramesTail = NULL ; - member->outFramesCount = 0 ; - - member->outPacker = NULL; - - // ( not currently used ) - // member->samplesperframe = AST_CONF_BLOCK_SAMPLES ; - - // used for determining need to mix frames - // and for management interface notification - member->speaking_state_prev = 0 ; - member->speaking_state_notify = 0 ; - member->speaking_state = 0 ; - - // linked-list pointer - member->next = NULL ; - - // account data - member->frames_in = 0 ; - member->frames_in_dropped = 0 ; - member->frames_out = 0 ; - member->frames_out_dropped = 0 ; - - // for counting sequentially dropped frames - member->sequential_drops = 0 ; - member->since_dropped = 0 ; - - // flags - member->remove_flag = 0 ; - - // record start time - gettimeofday( &member->time_entered, NULL ) ; - - // init dropped frame timestamps - gettimeofday( &member->last_in_dropped, NULL ) ; - gettimeofday( &member->last_out_dropped, NULL ) ; - - // - // parse passed flags - // - - // silence detection flags w/ defaults - int vad_flag = 0 ; - int denoise_flag = 0 ; - int agc_flag = 0 ; - - // is this member using the telephone? - int via_telephone = 0 ; - - // temp pointer to flags string - // char* flags = member->flags ; - char* flags = member->flags ; - int i; - for ( i = 0 ; i < strlen( flags ) ; ++i ) - { - // allowed flags are M, L, S, V, D, A - switch ( flags[i] ) - { - // call via telephone - case 'T': - via_telephone = 1 ; - break ; - - // member types ( last flag wins ) - case 'M': - member->type = 'M' ; - break ; - case 'L': - member->type = 'L' ; - break ; - case 'S': - member->type = 'S' ; - break ; - - // speex preprocessing options - case 'V': - vad_flag = 1 ; - break ; - case 'D': - denoise_flag = 1 ; - break ; - case 'A': - agc_flag = 1 ; - break ; - - // additional features - case 'd': // Send DTMF manager events.. - member->send_dtmf = 1; - break; - case 'q': // Quiet entry and exit from conference - member->quiet_entry_exit = 1; - break; - case 'i': // use Inband DTMF broadcast - member->inband_dtmf = 1; - break; - case 't': // use RFC DTMF broadcast - member->rfc_dtmf = 1; - break; - - default: - ast_log( LOG_WARNING, "received invalid flag, chan => %s, flag => %c\n", - chan->name, flags[i] ) ; - break ; - } - } - - // set the dsp to null so silence detection is disabled by default - member->dsp = NULL ; - -#if ( SILDET == 2 ) - // - // configure silence detection and preprocessing - // if the user is coming in via the telephone, - // and is not listen-only - // - if ( - via_telephone == 1 - && member->type != 'L' - ) - { - // create a speex preprocessor - member->dsp = speex_preprocess_state_init( AST_CONF_BLOCK_SAMPLES, AST_CONF_SAMPLE_RATE ) ; - - if ( member->dsp == NULL ) - { - ast_log( LOG_WARNING, "unable to initialize member dsp, channel => %s\n", chan->name ) ; - } - else - { - ast_log( LOG_NOTICE, "member dsp initialized, channel => %s, v => %d, d => %d, a => %d\n", - chan->name, vad_flag, denoise_flag, agc_flag ) ; - - // set speex preprocessor options - speex_preprocess_ctl( member->dsp, SPEEX_PREPROCESS_SET_VAD, &vad_flag ) ; - speex_preprocess_ctl( member->dsp, SPEEX_PREPROCESS_SET_DENOISE, &denoise_flag ) ; - speex_preprocess_ctl( member->dsp, SPEEX_PREPROCESS_SET_AGC, &agc_flag ) ; - - speex_preprocess_ctl( member->dsp, SPEEX_PREPROCESS_SET_PROB_START, &member->vad_prob_start ) ; - speex_preprocess_ctl( member->dsp, SPEEX_PREPROCESS_SET_PROB_CONTINUE, &member->vad_prob_continue ) ; - - ast_log( AST_CONF_DEBUG, "speech_prob_start => %f, speech_prob_continue => %f\n", - member->dsp->speech_prob_start, member->dsp->speech_prob_continue ) ; - } - } -#endif - - // - // set connection type - // - - if ( via_telephone == 1 ) - { - member->connection_type = 'T' ; - } - else if ( strncmp( member->channel_name, "SIP", 3 ) == 0 ) - { - member->connection_type = 'S' ; - } - else // default to iax - { - member->connection_type = 'X' ; - } - - // - // read, write, and translation options - // - - // set member's audio formats, taking dsp preprocessing into account - // ( chan->nativeformats, AST_FORMAT_SLINEAR, AST_FORMAT_ULAW, AST_FORMAT_GSM ) - member->read_format = ( member->dsp == NULL ) ? chan->nativeformats : AST_FORMAT_SLINEAR ; - member->write_format = chan->nativeformats ; - - // translation paths ( ast_translator_build_path() returns null if formats match ) - member->to_slinear = ast_translator_build_path( AST_FORMAT_SLINEAR, member->read_format ) ; - member->from_slinear = ast_translator_build_path( member->write_format, AST_FORMAT_SLINEAR ) ; - - //ast_log( AST_CONF_DEBUG, "AST_FORMAT_SLINEAR => %d\n", AST_FORMAT_SLINEAR ) ; - - // index for converted_frames array - { - int format, index; - index=-1; - format = member->write_format; - while( format > 0){ - index++; - format = format >> 1; - } - member->write_format_index= index; - //ast_log( AST_CONF_DEBUG, "converted write_format [%d] to index[%d]\n", member->write_format, index ); - - index=-1; - format = member->read_format; - while( format > 0){ - index++; - format = format >> 1; - } - member->read_format_index=index; - //ast_log( AST_CONF_DEBUG, "converted read_format [%d] to index[%d]\n", member->read_format, index ); - } - - // smoother defaults. - member->smooth_multiple =1; - member->smooth_size_in = -1; - member->smooth_size_out = -1; - member->inSmoother= NULL; - member->outPacker= NULL; - - switch (member->read_format){ - /* these assumptions may be incorrect */ - case AST_FORMAT_ULAW: - case AST_FORMAT_ALAW: - /* - member->smooth_size_in = 160; //bytes - member->smooth_size_out = 160; //samples - */ - break; - case AST_FORMAT_GSM: - /* - member->smooth_size_in = 33; //bytes - member->smooth_size_out = 160;//samples - */ - break; - case AST_FORMAT_SPEEX: - /* this assumptions are wrong - member->smooth_multiple = 2 ; // for testing, force to dual frame - member->smooth_size_in = 39; // bytes - member->smooth_size_out = 160; // samples - */ - break; - case AST_FORMAT_SLINEAR: - /* - member->smooth_size_in = 320; //bytes - member->smooth_size_out = 160; //samples - */ - break; - default: - member->inSmoother = NULL; //don't use smoother for this type. - //ast_log( AST_CONF_DEBUG, "smoother is NULL for member->read_format => %d\n", member->read_format); - } - if (member->smooth_size_in > 0){ - member->inSmoother = ast_smoother_new(member->smooth_size_in); - //ast_log( AST_CONF_DEBUG, "created smoother(%d) for %d\n", member->smooth_size_in , member->read_format); - } - - - // - // finish up - // - - ast_log( AST_CONF_DEBUG, "created member, type => %c, priority => %d, readformat => %d\n", - member->type, member->priority, chan->readformat ) ; - - return member ; -} - -struct ast_conf_member* delete_member( struct ast_conf_member* member ) -{ - // !!! NO RETURN TEST !!! - // do { sleep(1) ; } while (1) ; - - // !!! CRASH TEST !!! - // *((int *)0) = 0; - - if ( member == NULL ) - { - ast_log( LOG_WARNING, "unable to the delete null member\n" ) ; - return NULL ; - } - - // - // clean up member flags - // - - if ( member->flags != NULL ) - { - // !!! DEBUGING !!! - ast_log( AST_CONF_DEBUG, "freeing member flags, name => %s\n", - member->channel_name ) ; - free( member->flags ) ; - } - - // - // delete the members frames - // - - conf_frame* cf ; - - // !!! DEBUGING !!! - ast_log( AST_CONF_DEBUG, "deleting member input frames, name => %s\n", - member->channel_name ) ; - - // incoming frames - cf = member->inFrames ; - - while ( cf != NULL ) - { - cf = delete_conf_frame( cf ) ; - } - if (member->inSmoother != NULL) - ast_smoother_free(member->inSmoother); - - // !!! DEBUGING !!! - ast_log( AST_CONF_DEBUG, "deleting member output frames, name => %s\n", - member->channel_name ) ; - - // outgoing frames - cf = member->outFrames ; - - while ( cf != NULL ) - { - cf = delete_conf_frame( cf ) ; - } - - if (member->outPacker != NULL) - ast_packer_free(member->outPacker); - - -#if ( SILDET == 2 ) - if ( member->dsp != NULL ) - { - // !!! DEBUGING !!! - ast_log( AST_CONF_DEBUG, "destroying member preprocessor, name => %s\n", - member->channel_name ) ; - speex_preprocess_state_destroy( member->dsp ) ; - } -#endif - - // !!! DEBUGING !!! - ast_log( AST_CONF_DEBUG, "freeing member translator paths, name => %s\n", - member->channel_name ) ; - - // free the mixing translators - ast_translator_free_path( member->to_slinear ) ; - ast_translator_free_path( member->from_slinear ) ; - - // get a pointer to the next - // member so we can return it - struct ast_conf_member* nm = member->next ; - - // !!! DEBUGING !!! - ast_log( AST_CONF_DEBUG, "freeing member channel name, name => %s\n", - member->channel_name ) ; - - // free the member's copy for the channel name - free( member->channel_name ) ; - - // !!! DEBUGING !!! - ast_log( AST_CONF_DEBUG, "freeing member\n" ) ; - - // free the member's memory - free( member ) ; - member = NULL ; - - return nm ; -} - -// -// incoming frame functions -// - -conf_frame* get_incoming_frame( struct ast_conf_member *member ) -{ - // - // sanity checks - // - - if ( member == NULL ) - { - ast_log( LOG_WARNING, "unable to get frame from null member\n" ) ; - return NULL ; - } - - // - // repeat last frame a couple times to smooth transition - // - -#ifdef AST_CONF_CACHE_LAST_FRAME - if ( member->inFramesCount == 0 ) - { - // nothing to do if there's no cached frame - if ( member->inFramesLast == NULL ) - return NULL ; - - // turn off 'okay to cache' flag - member->okayToCacheLast = 0 ; - - if ( member->inFramesRepeatLast >= AST_CONF_CACHE_LAST_FRAME ) - { - // already used this frame AST_CONF_CACHE_LAST_FRAME times - - // reset repeat count - member->inFramesRepeatLast = 0 ; - - // clear the cached frame - delete_conf_frame( member->inFramesLast ) ; - member->inFramesLast = NULL ; - - // return null - return NULL ; - } - else - { - ast_log( AST_CONF_DEBUG, "repeating cached frame, channel => %s, inFramesRepeatLast => %d\n", - member->channel_name, member->inFramesRepeatLast ) ; - - // increment counter - member->inFramesRepeatLast++ ; - - // return a copy of the cached frame - return copy_conf_frame( member->inFramesLast ) ; - } - } - else if ( member->okayToCacheLast == 0 && member->inFramesCount >= 3 ) - { - ast_log( AST_CONF_DEBUG, "enabling cached frame, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount ) ; - - // turn on 'okay to cache' flag - member->okayToCacheLast = 1 ; - } -#else - if ( member->inFramesCount == 0 ) - return NULL ; -#endif // AST_CONF_CACHE_LAST_FRAME - - // - // return the next frame in the queue - // - - conf_frame* cfr = NULL ; - - // get first frame in line - cfr = member->inFramesTail ; - - // if it's the only frame, reset the queue, - // else, move the second frame to the front - if ( member->inFramesTail == member->inFrames ) - { - member->inFramesTail = NULL ; - member->inFrames = NULL ; - } - else - { - // move the pointer to the next frame - member->inFramesTail = member->inFramesTail->prev ; - - // reset it's 'next' pointer - if ( member->inFramesTail != NULL ) - member->inFramesTail->next = NULL ; - } - - // separate the conf frame from the list - cfr->next = NULL ; - cfr->prev = NULL ; - - // decriment frame count - member->inFramesCount-- ; - -#ifdef AST_CONF_CACHE_LAST_FRAME - // copy frame if queue is now empty - if ( - member->inFramesCount == 0 - && member->okayToCacheLast == 1 - ) - { - // reset repeat count - member->inFramesRepeatLast = 0 ; - - // clear cached frame - if ( member->inFramesLast != NULL ) - { - delete_conf_frame( member->inFramesLast ) ; - member->inFramesLast = NULL ; - } - - // cache new frame - member->inFramesLast = copy_conf_frame( cfr ) ; - } -#endif // AST_CONF_CACHE_LAST_FRAME - - return cfr ; -} - -int queue_incoming_frame( struct ast_conf_member* member, struct ast_frame* fr ) -{ - // - // sanity checks - // - - // check on frame - if ( fr == NULL ) - { - ast_log( LOG_ERROR, "unable to queue null frame\n" ) ; - return -1 ; - } - - // check on member - if ( member == NULL ) - { - ast_log( LOG_ERROR, "unable to queue frame for null member\n" ) ; - return -1 ; - } - - // - // drop a frame if we've filled half the buffer - // ( no more than once per AST_CONF_QUEUE_DROP_TIME_LIMIT ms ) - // - - - /* -ast_log( - AST_CONF_DEBUG, - "queue frame on channel => %s, fr->subclass => %d, fr->datalen => %d, fr->samples => %d\n", - member->channel_name, fr->subclass, fr->datalen, fr->samples -) ; -*/ - - - if ( member->inFramesCount > member->inFramesNeeded ) - { - if ( member->inFramesCount > AST_CONF_QUEUE_DROP_THRESHOLD ) - { - struct timeval curr ; - gettimeofday( &curr, NULL ) ; - - // time since last dropped frame - long diff = usecdiff( &curr, &member->last_in_dropped ) ; - - // number of milliseconds which must pass between frame drops - // ( 15 frames => -100ms, 10 frames => 400ms, 5 frames => 900ms, 0 frames => 1400ms, etc. ) - long time_limit = 1000 - ( ( member->inFramesCount - AST_CONF_QUEUE_DROP_THRESHOLD ) * 100 ) ; - - if ( diff >= time_limit ) - { - // count sequential drops - member->sequential_drops++ ; - - // ast_log( - // AST_CONF_DEBUG, - // "dropping frame from input buffer, channel => %s, incoming => %d, outgoing => %d\n", - // member->channel_name, member->inFramesCount, member->outFramesCount - // ) ; - - // accounting: count dropped incoming frames - member->frames_in_dropped++ ; - - // reset frames since dropped - member->since_dropped = 0 ; - - // delete the frame - delete_conf_frame( get_incoming_frame( member ) ) ; - - gettimeofday( &member->last_in_dropped, NULL ) ; - } - else - { -/* - ast_log( - AST_CONF_DEBUG, - "input buffer larger than drop threshold, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount - ) ; -*/ - } - } - } - - // - // if we have to drop frames, we'll drop new frames - // because it's easier ( and doesn't matter much anyway ). - // - - if ( member->inFramesCount >= AST_CONF_MAX_QUEUE ) - { - // count sequential drops - member->sequential_drops++ ; - - ast_log( - AST_CONF_DEBUG, - "unable to queue incoming frame, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount - ) ; - - // accounting: count dropped incoming frames - member->frames_in_dropped++ ; - - // reset frames since dropped - member->since_dropped = 0 ; - - return -1 ; - } - - // reset sequential drops - member->sequential_drops = 0 ; - - // increment frames since dropped - member->since_dropped++ ; - - // - // create new conf frame from passed data frame - // - - // ( member->inFrames may be null at this point ) - if (member->inSmoother == NULL ){ - conf_frame* cfr = create_conf_frame( member, member->inFrames, fr ) ; - if ( cfr == NULL ) - { - ast_log( LOG_ERROR, "unable to malloc conf_frame\n" ) ; - return -1 ; - } - - // - // add new frame to speaking members incoming frame queue - // ( i.e. save this frame data, so we can distribute it in conference_exec later ) - // - - if ( member->inFrames == NULL ) { - member->inFramesTail = cfr ; - } - member->inFrames = cfr ; - member->inFramesCount++ ; - } else { - //feed frame(fr) into the smoother - - // smoother tmp frame - struct ast_frame *sfr; - int multiple = 1; - int i=0; - - if ( (member->smooth_size_in > 0 ) && (member->smooth_size_in * member->smooth_multiple != fr->datalen) ) - { - //ast_log(AST_CONF_DEBUG,"resetting smooth_size_in. old size=> %d, multiple =>%d, datalen=> %d\n", member->smooth_size_in, member->smooth_multiple, fr->datalen ); - if ( fr->datalen % member->smooth_multiple != 0) { - // if datalen not divisible by smooth_multiple, assume we're just getting normal encoding. - // ast_log(AST_CONF_DEBUG,"smooth_multiple does not divide datalen. changing smooth size from %d to %d, multiple => 1\n", member->smooth_size_in, fr->datalen); - member->smooth_size_in = fr->datalen; - member->smooth_multiple = 1; - } else { - // assume a fixed multiple, so divide into datalen. - int newsmooth = fr->datalen / member->smooth_multiple ; - // ast_log(AST_CONF_DEBUG,"datalen is divisible by smooth_multiple, changing smooth size from %d to %d\n", member->smooth_size_in, newsmooth); - member->smooth_size_in = newsmooth; - } - - //free input smoother. - if (member->inSmoother != NULL) - ast_smoother_free(member->inSmoother); - - //make new input smoother. - member->inSmoother = ast_smoother_new(member->smooth_size_in); - } - - ast_smoother_feed( member->inSmoother, fr ); -//ast_log (AST_CONF_DEBUG, "SMOOTH:Feeding frame into inSmoother, timestamp => %ld.%ld\n", fr->delivery.tv_sec, fr->delivery.tv_usec); - - if ( multiple > 1 ) - fr->samples /= multiple; - - // read smoothed version of frames, add to queue - while( ( sfr = ast_smoother_read( member->inSmoother ) ) ){ - - ++i; -//ast_log( AST_CONF_DEBUG , "\treading new frame [%d] from smoother, inFramesCount[%d], \n\tsfr->frametype -> %d , sfr->subclass -> %d , sfr->datalen => %d sfr->samples => %d\n", i , member->inFramesCount , sfr->frametype, sfr->subclass, sfr->datalen, sfr->samples); -//ast_log (AST_CONF_DEBUG, "SMOOTH:Reading frame from inSmoother, i=>%d, timestamp => %ld.%ld\n",i, sfr->delivery.tv_sec, sfr->delivery.tv_usec); - conf_frame* cfr = create_conf_frame( member, member->inFrames, sfr ) ; - if ( cfr == NULL ) - { - ast_log( LOG_ERROR, "unable to malloc conf_frame\n" ) ; - return -1 ; - } - - // - // add new frame to speaking members incoming frame queue - // ( i.e. save this frame data, so we can distribute it in conference_exec later ) - // - - if ( member->inFrames == NULL ) { - member->inFramesTail = cfr ; - } - member->inFrames = cfr ; - member->inFramesCount++ ; - } - } - - return 0 ; -} - -// -// outgoing frame functions -// - -conf_frame* get_outgoing_frame( struct ast_conf_member *member ) -{ - if ( member == NULL ) - { - ast_log( LOG_WARNING, "unable to get frame from null member\n" ) ; - return NULL ; - } - - conf_frame* cfr ; - - // ast_log( AST_CONF_DEBUG, "getting member frames, count => %d\n", member->outFramesCount ) ; - - if ( member->outFramesCount > AST_CONF_MIN_QUEUE ) - { - cfr = member->outFramesTail ; - - // if it's the only frame, reset the queu, - // else, move the second frame to the front - if ( member->outFramesTail == member->outFrames ) - { - member->outFrames = NULL ; - member->outFramesTail = NULL ; - } - else - { - // move the pointer to the next frame - member->outFramesTail = member->outFramesTail->prev ; - - // reset it's 'next' pointer - if ( member->outFramesTail != NULL ) - member->outFramesTail->next = NULL ; - } - - // separate the conf frame from the list - cfr->next = NULL ; - cfr->prev = NULL ; - - // decriment frame count - member->outFramesCount-- ; - - return cfr ; - } - - return NULL ; -} - -int __queue_outgoing_frame( struct ast_conf_member* member, const struct ast_frame* fr, struct timeval delivery ) -{ - // accounting: count the number of outgoing frames for this member - member->frames_out++ ; - -/* - // - // drop a frame if we've filled half the buffer - // - - if ( member->outFramesCount > AST_CONF_QUEUE_DROP_THRESHOLD ) - { - struct timeval curr ; - gettimeofday( &curr, NULL ) ; - - long diff = usecdiff( &curr, &member->last_out_dropped ) ; - - if ( diff >= AST_CONF_QUEUE_DROP_TIME_LIMIT ) - { - ast_log( - AST_CONF_DEBUG, - "dropping frame from output buffer, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount - ) ; - - // accounting: count dropped outgoing frames - member->frames_out_dropped++ ; - - // delete the frame - delete_conf_frame( get_outgoing_frame( member ) ) ; - - gettimeofday( &member->last_out_dropped, NULL ) ; - } - } -*/ - - // - // we have to drop frames, so we'll drop new frames - // because it's easier ( and doesn't matter much anyway ). - // - if ( member->outFramesCount >= AST_CONF_MAX_QUEUE ) - { - ast_log( - AST_CONF_DEBUG, - "unable to queue outgoing frame, channel => %s, incoming => %d, outgoing => %d\n", - member->channel_name, member->inFramesCount, member->outFramesCount - ) ; - - // accounting: count dropped outgoing frames - member->frames_out_dropped++ ; - - return -1 ; - } - - // - // create new conf frame from passed data frame - // - - conf_frame* cfr = create_conf_frame( member, member->outFrames, fr ) ; - - if ( cfr == NULL ) - { - ast_log( LOG_ERROR, "unable to create new conf frame\n" ) ; - - // accounting: count dropped outgoing frames - member->frames_out_dropped++ ; - - return -1 ; - } - - // set delivery timestamp - cfr->fr->delivery = delivery ; - - // - // add new frame to speaking members incoming frame queue - // ( i.e. save this frame data, so we can distribute it in conference_exec later ) - // - - if ( member->outFrames == NULL ) { - member->outFramesTail = cfr ; - } - member->outFrames = cfr ; - member->outFramesCount++ ; - - // return success - return 0 ; -} - -int queue_outgoing_frame( struct ast_conf_member* member, const struct ast_frame* fr, struct timeval delivery ) -{ - // check on frame - if ( fr == NULL ) - { - ast_log( LOG_ERROR, "unable to queue null frame\n" ) ; - return -1 ; - } - - // check on member - if ( member == NULL ) - { - ast_log( LOG_ERROR, "unable to queue frame for null member\n" ) ; - return -1 ; - } - - - if ( ( member->outPacker == NULL ) && ( member->smooth_multiple > 1 ) && ( member->smooth_size_out > 0 ) ){ - //ast_log (AST_CONF_DEBUG, "creating outPacker with size => %d \n\t( multiple => %d ) * ( size => %d )\n", member->smooth_multiple * member-> smooth_size_out, member->smooth_multiple , member->smooth_size_out); - member->outPacker = ast_packer_new( member->smooth_multiple * member->smooth_size_out); - } - - if (member->outPacker == NULL ){ - return __queue_outgoing_frame( member, fr, delivery ) ; - } - else - { - struct ast_frame *sfr; - int exitval = 0; -//ast_log (AST_CONF_DEBUG, "sending fr into outPacker, datalen=>%d, samples=>%d\n",fr->datalen, fr->samples); - ast_packer_feed( member->outPacker , fr ); - while( (sfr = ast_packer_read( member->outPacker ) ) ) - { -//ast_log (AST_CONF_DEBUG, "read sfr from outPacker, datalen=>%d, samples=>%d\n",sfr->datalen, sfr->samples); - if ( __queue_outgoing_frame( member, sfr, delivery ) == -1 ) { - exitval = -1; - } - } - return exitval; - } -} - -// -// manager functions -// - -void send_state_change_notifications( struct ast_conf_member* member ) -{ - // ast_log( AST_CONF_DEBUG, "sending state change notification\n" ) ; - - // loop through list of members, sending state changes - while ( member != NULL ) - { - // has the state changed since last time through this loop? - if ( member->speaking_state_notify != member->speaking_state_prev ) - { - manager_event( - EVENT_FLAG_CALL, - "ConferenceState", - "Channel: %s\r\n" - "State: %s\r\n", - member->channel_name, - ( ( member->speaking_state_notify == 1 ) ? "speaking" : "silent" ) - ) ; -#if 0 - ast_log( AST_CONF_DEBUG, "member state changed, channel => %s, state => %d, incoming => %d, outgoing => %d\n", - member->channel_name, member->speaking_state_notify, member->inFramesCount, member->outFramesCount ) ; -#endif - - // remember current state - member->speaking_state_prev = member->speaking_state_notify ; - - // we do not reset the speaking_state_notify flag here - } - - // reset notification flag so that - member->speaking_state_notify = 0 ; - - // move the pointer to the next member - member = member->next ; - } - - return ; -} - -// -// meta-info accessors functions -// - -short memberIsPhoneClient( struct ast_conf_member* member ) -{ - if ( member == NULL ) - return 0 ; - - return ( member->connection_type == 'T' ) ? 1 : 0 ; -} - -short memberIsIaxClient( struct ast_conf_member* member ) -{ - if ( member == NULL ) - return 0 ; - - return ( member->connection_type == 'X' ) ? 1 : 0 ; -} - -short memberIsSIPClient( struct ast_conf_member* member ) -{ - if ( member == NULL ) - return 0 ; - - return ( member->connection_type == 'S' ) ? 1 : 0 ; -} - -short memberIsModerator( struct ast_conf_member* member ) -{ - if ( member == NULL ) - return 0 ; - - return ( member->type == 'M' ) ? 1 : 0 ; -} - -short memberIsListener( struct ast_conf_member* member ) -{ - if ( member == NULL ) - return 0 ; - - return ( member->type == 'L' ) ? 1 : 0 ; -} - - -// -// ast_packer, adapted from ast_smoother -// pack multiple frames together into one packet on the wire. -// - -#define PACKER_SIZE 8000 -#define PACKER_QUEUE 10 // store at most 10 complete packets in the queue - -struct ast_packer { - int framesize; // number of frames per packet on the wire. - int size; - int packet_index; - int format; - int readdata; - int optimizablestream; - int flags; - float samplesperbyte; - struct ast_frame f; - struct timeval delivery; - char data[PACKER_SIZE]; - char framedata[PACKER_SIZE + AST_FRIENDLY_OFFSET]; - int samples; - int sample_queue[PACKER_QUEUE]; - int len_queue[PACKER_QUEUE]; - struct ast_frame *opt; - int len; -}; - -void ast_packer_reset(struct ast_packer *s, int framesize) -{ - memset(s, 0, sizeof(struct ast_packer)); - s->framesize = framesize; - s->packet_index=0; - s->len=0; -} - -struct ast_packer *ast_packer_new(int framesize) -{ - struct ast_packer *s; - if (framesize < 1) - return NULL; - s = malloc(sizeof(struct ast_packer)); - if (s) - ast_packer_reset(s, framesize); - return s; -} - -int ast_packer_get_flags(struct ast_packer *s) -{ - return s->flags; -} - -void ast_packer_set_flags(struct ast_packer *s, int flags) -{ - s->flags = flags; -} - -int ast_packer_feed(struct ast_packer *s, const struct ast_frame *f) -{ - if (f->frametype != AST_FRAME_VOICE) { - ast_log(LOG_WARNING, "Huh? Can't pack a non-voice frame!\n"); - return -1; - } - if (!s->format) { - s->format = f->subclass; - s->samples=0; - } else if (s->format != f->subclass) { - ast_log(LOG_WARNING, "Packer was working on %d format frames, now trying to feed %d?\n", s->format, f->subclass); - return -1; - } - if (s->len + f->datalen > PACKER_SIZE) { - ast_log(LOG_WARNING, "Out of packer space\n"); - return -1; - } - if (s->packet_index >= PACKER_QUEUE ){ - ast_log(LOG_WARNING, "Out of packer queue space\n"); - return -1; - } - - memcpy(s->data + s->len, f->data, f->datalen); - /* If either side is empty, reset the delivery time */ - if (!s->len || (!f->delivery.tv_sec && !f->delivery.tv_usec) || - (!s->delivery.tv_sec && !s->delivery.tv_usec)) - s->delivery = f->delivery; - s->len += f->datalen; -//packer stuff - s->len_queue[s->packet_index] += f->datalen; - s->sample_queue[s->packet_index] += f->samples; - s->samples += f->samples; - - if (s->samples > s->framesize ) - ++s->packet_index; - - return 0; -} - -struct ast_frame *ast_packer_read(struct ast_packer *s) -{ - struct ast_frame *opt; - int len; - /* IF we have an optimization frame, send it */ - if (s->opt) { - opt = s->opt; - s->opt = NULL; - return opt; - } - - /* Make sure we have enough data */ - if (s->samples < s->framesize ){ - return NULL; - } - len = s->len_queue[0]; - if (len > s->len) - len = s->len; - /* Make frame */ - s->f.frametype = AST_FRAME_VOICE; - s->f.subclass = s->format; - s->f.data = s->framedata + AST_FRIENDLY_OFFSET; - s->f.offset = AST_FRIENDLY_OFFSET; - s->f.datalen = len; - s->f.samples = s->sample_queue[0]; - s->f.delivery = s->delivery; - /* Fill Data */ - memcpy(s->f.data, s->data, len); - s->len -= len; - /* Move remaining data to the front if applicable */ - if (s->len) { - /* In principle this should all be fine because if we are sending - G.729 VAD, the next timestamp will take over anyawy */ - memmove(s->data, s->data + len, s->len); - if (s->delivery.tv_sec || s->delivery.tv_usec) { - /* If we have delivery time, increment it, otherwise, leave it at 0 */ - s->delivery.tv_sec += s->sample_queue[0] / 8000.0; - s->delivery.tv_usec += (((int)(s->sample_queue[0])) % 8000) * 125; - if (s->delivery.tv_usec > 1000000) { - s->delivery.tv_usec -= 1000000; - s->delivery.tv_sec += 1; - } - } - } - int j; - s->samples -= s->sample_queue[0]; - if( s->packet_index > 0 ){ - for (j=0; jpacket_index -1 ; j++){ - s->len_queue[j]=s->len_queue[j+1]; - s->sample_queue[j]=s->sample_queue[j+1]; - } - s->len_queue[s->packet_index]=0; - s->sample_queue[s->packet_index]=0; - s->packet_index--; - } else { - s->len_queue[0]=0; - s->sample_queue[0]=0; - } - - - /* Return frame */ - return &s->f; -} - -void ast_packer_free(struct ast_packer *s) -{ - free(s); -} diff --git a/app_conference/member.h b/app_conference/member.h deleted file mode 100644 index 3a1fa4bf..00000000 --- a/app_conference/member.h +++ /dev/null @@ -1,212 +0,0 @@ - -// $Id: member.h,v 1.7 2005/11/02 22:42:42 stevek Exp $ - -/* - * app_conference - * - * A channel independent conference application for Asterisk - * - * Copyright (C) 2002, 2003 Junghanns.NET GmbH - * Copyright (C) 2003-2005 HorizonLive.com, Inc. - * - * Klaus-Peter Junghanns - * Steve Kann - * - * This program may be modified and distributed under the - * terms of the GNU Public License. - * - */ - -#ifndef _APP_CONF_MEMBER_H -#define _APP_CONF_MEMBER_H - -// -// includes -// - -#include "app_conference.h" -#include "common.h" -#include "asterisk/app.h" - - -// -// struct declarations -// - -struct ast_conf_soundq -{ - char name[256]; - struct ast_filestream *stream; // the stream - int muted; // should incoming audio be muted while we play? - struct ast_conf_soundq *next; -}; - -struct ast_conf_member -{ - ast_mutex_t lock ; // member data mutex - - struct ast_channel* chan ; // member's channel - char* channel_name ; // member's channel name - - // values passed to create_member () via *data - int priority ; // highest priority gets the channel - char* flags ; // raw member-type flags - char type ; // L = ListenOnly, M = Moderator, S = Standard (Listen/Talk) - char* id ; // member id - - // determine by flags and channel name - char connection_type ; // T = telephone, X = iaxclient, S = sip - - // vad voice probability thresholds - float vad_prob_start ; - float vad_prob_continue ; - - // ready flag - short ready_for_outgoing ; - - // input frame queue - conf_frame* inFrames ; - conf_frame* inFramesTail ; - unsigned int inFramesCount ; - - // input/output smoother - struct ast_smoother *inSmoother; - struct ast_packer *outPacker; - int smooth_size_in; - int smooth_size_out; - int smooth_multiple; - - // frames needed by conference_exec - unsigned int inFramesNeeded ; - - // used when caching last frame - conf_frame* inFramesLast ; - unsigned int inFramesRepeatLast ; - unsigned short okayToCacheLast ; - - // output frame queue - conf_frame* outFrames ; - conf_frame* outFramesTail ; - unsigned int outFramesCount ; - - // time we last dropped a frame - struct timeval last_in_dropped ; - struct timeval last_out_dropped ; - - // ( not currently used ) - // int samplesperframe ; - - // used for determining need to mix frames - // and for management interface notification - short speaking_state_prev ; - short speaking_state_notify ; - short speaking_state ; - - // pointer to next member in single-linked list - struct ast_conf_member* next ; - - // accounting values - unsigned long frames_in ; - unsigned long frames_in_dropped ; - unsigned long frames_out ; - unsigned long frames_out_dropped ; - - // for counting sequentially dropped frames - unsigned int sequential_drops ; - unsigned long since_dropped ; - - // start time - struct timeval time_entered ; - struct timeval lastsent_timeval ; - - // flag indicating we should remove this member - short remove_flag ; - -#if ( SILDET == 2 ) - // pointer to speex preprocessor dsp - SpeexPreprocessState *dsp ; - // number of frames to ignore speex_preprocess() - int ignore_speex_count; -#else - // placeholder when preprocessing is not enabled - void* dsp ; -#endif - - // audio format this member is using - int write_format ; - int read_format ; - - int write_format_index ; - int read_format_index ; - - // member frame translators - struct ast_trans_pvt* to_slinear ; - struct ast_trans_pvt* from_slinear ; - - // For playing sounds - struct ast_conf_soundq *soundq; - -#ifdef DEBUG_OUTPUT_PCM - FILE *incoming_fh; -#endif - - int send_dtmf:1; - int quiet_entry_exit:1; - int inband_dtmf:1; - int rfc_dtmf:1; -} ; - -struct conf_member -{ - struct ast_conf_member* realmember ; - struct conf_member* next ; -} ; - -// -// function declarations -// - -int member_exec( struct ast_channel* chan, void* data ) ; - -int basic_play_sound ( char *channel, char *file ) ; - -struct ast_conf_member* create_member( struct ast_channel* chan, const char* data ) ; -struct ast_conf_member* delete_member( struct ast_conf_member* member ) ; - -// incoming queue -int queue_incoming_frame( struct ast_conf_member* member, struct ast_frame* fr ) ; -conf_frame* get_incoming_frame( struct ast_conf_member* member ) ; - -// outgoing queue -int queue_outgoing_frame( struct ast_conf_member* member, const struct ast_frame* fr, struct timeval delivery ) ; -int __queue_outgoing_frame( struct ast_conf_member* member, const struct ast_frame* fr, struct timeval delivery ) ; -conf_frame* get_outgoing_frame( struct ast_conf_member* member ) ; - -void send_state_change_notifications( struct ast_conf_member* member ) ; - -// -// meta-info accessors functions -// - -short memberIsPhoneClient( struct ast_conf_member* member ) ; -short memberIsIaxClient( struct ast_conf_member* member ) ; -short memberIsSIPClient( struct ast_conf_member* member ) ; - -short memberIsModerator( struct ast_conf_member* member ) ; -short memberIsListener( struct ast_conf_member* member ) ; - -// -// packer functions -// - -struct ast_packer; - -extern struct ast_packer *ast_packer_new(int bytes); -extern void ast_packer_set_flags(struct ast_packer *packer, int flags); -extern int ast_packer_get_flags(struct ast_packer *packer); -extern void ast_packer_free(struct ast_packer *s); -extern void ast_packer_reset(struct ast_packer *s, int bytes); -extern int ast_packer_feed(struct ast_packer *s, const struct ast_frame *f); -extern struct ast_frame *ast_packer_read(struct ast_packer *s); - -#endif diff --git a/app_conference/star.gsm b/app_conference/star.gsm deleted file mode 100644 index 5ec8908e..00000000 --- a/app_conference/star.gsm +++ /dev/null @@ -1,2 +0,0 @@ -:nPSat֪j*PR6۞D IDCtb LICENSE: GPLv2 -# -# CHANGES -# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.11.20';} - -$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$inbound_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $inbound_to_print) - { - $row=mysql_fetch_row($rslt); - $inbound[$i] =$row[0]; - $fullnum[$i] =$row[1]; - $inbname[$i] =$row[2]; - $i++; - } -?> - - - - - -\n"; -#echo"\n"; -echo "ASTERISK: Inbound Calls Stats\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A NUMBER AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "ASTERISK: Inbound Calls Stats                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
-if (eregi("\*",$group))
-	{$extenSQL = "and extension LIKE \"%$group\"";}
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls That came into this number:       $TOTALcalls\n";
-echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-if ($row[0])
-	{
-	$average_hold_seconds = ($row[1] / $row[0]);
-	$average_hold_seconds = round($average_hold_seconds, 0);
-	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-	}
-else {$DROPpercent=0;   $average_hold_seconds=0;}
-echo "Total DROP Calls:   (less than 10 seconds)    $DROPcalls  $DROPpercent%\n";
-echo "Average Call Length(seconds) for DROP Calls:  $average_hold_seconds\n";
-
-
-##############################
-#########  CALLS STATS
-
-echo "\n";
-echo "---------- CALL LISTINGS\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-echo "| CALLERID             | CALLERIDNAME         | LENGTH | DATE TIME           |\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$CID =			sprintf("%-20s", $row[0]);
-	$CIDname =		sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$datetime =		sprintf("%-19s", $row[3]);
-	$USERavgTALK =	$row[2];
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
-
-	$i++;
-	}
-
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-##############################
-#########  TIME STATS
-
-if ($output == 'FULL')
-	{
-
-	echo "\n";
-	echo "---------- TIME STATS\n";
-
-	echo "\n";
-
-	$hi_hour_count=0;
-	$last_full_record=0;
-	$i=0;
-	$h=0;
-	while ($i <= 96)
-		{
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-		$h++;
-		}
-
-	$hour_multiplier = (100 / $hi_hour_count);
-	#$hour_multiplier = round($hour_multiplier, 0);
-
-	echo "\n";
-	echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS\n";
-
-	$k=1;
-	$Mk=0;
-	$call_scale = '0';
-	while ($k <= 102) 
-		{
-		if ($Mk >= 5) 
-			{
-			$Mk=0;
-			$scale_num=($k / $hour_multiplier);
-			$scale_num = round($scale_num, 0);
-			$LENscale_num = (strlen($scale_num));
-			$k = ($k + $LENscale_num);
-			$call_scale .= "$scale_num";
-			}
-		else
-			{
-			$call_scale .= " ";
-			$k++;   $Mk++;
-			}
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-	#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP                                  | DROPS | TOTAL |\n";
-	echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-	$ZZ = '00';
-	$i=0;
-	$h=4;
-	$hour= -1;
-	$no_lines_yet=1;
-
-	while ($i <= 96)
-		{
-		$char_counter=0;
-		$time = '      ';
-		if ($h >= 4) 
-			{
-			$hour++;
-			$h=0;
-			if ($hour < 10) {$hour = "0$hour";}
-			$time = "+$hour$ZZ+";
-			}
-		if ($h == 1) {$time = "   15 ";}
-		if ($h == 2) {$time = "   30 ";}
-		if ($h == 3) {$time = "   45 ";}
-		$Ghour_count = $hour_count[$i];
-		if ($Ghour_count < 1) 
-			{
-			if ( ($no_lines_yet) or ($i > $last_full_record) )
-				{
-				$do_nothing=1;
-				}
-			else
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				echo "|$time|";
-				$k=0;   while ($k <= 102) {echo " ";   $k++;}
-				echo "| $hour_count[$i] |\n";
-				}
-			}
-		else
-			{
-			$no_lines_yet=0;
-			$Xhour_count = ($Ghour_count * $hour_multiplier);
-			$Yhour_count = (99 - $Xhour_count);
-
-			$Gdrop_count = $drop_count[$i];
-			if ($Gdrop_count < 1) 
-				{
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "*X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 101) {echo " ";   $char_counter++;}
-				echo "| 0     | $hour_count[$i] |\n";
-
-				}
-			else
-				{
-				$Xdrop_count = ($Gdrop_count * $hour_multiplier);
-
-			#	if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
-
-				$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
-
-				$hour_count[$i] =	sprintf("%-5s", $hour_count[$i]);
-				$drop_count[$i] =	sprintf("%-5s", $drop_count[$i]);
-
-				echo "|$time|";
-				$k=0;   while ($k <= $Xdrop_count) {echo ">";   $k++;   $char_counter++;}
-				echo "D";   $char_counter++;
-				$k=0;   while ($k <= $XXhour_count) {echo "*";   $k++;   $char_counter++;}
-				echo "X";   $char_counter++;
-				$k=0;   while ($k <= $Yhour_count) {echo " ";   $k++;   $char_counter++;}
-					while ($char_counter <= 102) {echo " ";   $char_counter++;}
-				echo "| $drop_count[$i] | $hour_count[$i] |\n";
-				}
-			}
-		
-		
-		$i++;
-		$h++;
-		}
-
-
-	echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
-
-
-	}
-
-
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/astguiclient_web/admin.php b/astguiclient_web/admin.php deleted file mode 100644 index 75f407c7..00000000 --- a/astguiclient_web/admin.php +++ /dev/null @@ -1,1824 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI database administration -# -# CHANGES -# 50913-1118 - Added outbound_cid for web-client calls -# 50926-1356 - Modified to allow for language translation -# 50926-1613 - Added WeBRooTWritablE write controls -# 51128-1254 - Modified to allow PHP global vars off -# 51208-2120 - Added option to login with vicidial_user login if allowed -# 51213-1650 - Added option to delete phones if allowed by vicidial_users -# 60421-1430 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60427-1137 - Fixed phone search bug -# 60620-1243 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '1.1.12'; -$build = '60620-1243'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["pass"])) {$pass=$_GET["pass"];} - elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["server_id"])) {$server_id=$_GET["server_id"];} - elseif (isset($_POST["server_id"])) {$server_id=$_POST["server_id"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["dialplan_number"])) {$dialplan_number=$_GET["dialplan_number"];} - elseif (isset($_POST["dialplan_number"])) {$dialplan_number=$_POST["dialplan_number"];} -if (isset($_GET["voicemail_id"])) {$voicemail_id=$_GET["voicemail_id"];} - elseif (isset($_POST["voicemail_id"])) {$voicemail_id=$_POST["voicemail_id"];} -if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} - elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} -if (isset($_GET["computer_ip"])) {$computer_ip=$_GET["computer_ip"];} - elseif (isset($_POST["computer_ip"])) {$computer_ip=$_POST["computer_ip"];} -if (isset($_GET["login"])) {$login=$_GET["login"];} - elseif (isset($_POST["login"])) {$login=$_POST["login"];} -if (isset($_GET["active"])) {$active=$_GET["active"];} - elseif (isset($_POST["active"])) {$active=$_POST["active"];} -if (isset($_GET["phone_type"])) {$phone_type=$_GET["phone_type"];} - elseif (isset($_POST["phone_type"])) {$phone_type=$_POST["phone_type"];} -if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} - elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} -if (isset($_GET["company"])) {$company=$_GET["company"];} - elseif (isset($_POST["company"])) {$company=$_POST["company"];} -if (isset($_GET["picture"])) {$picture=$_GET["picture"];} - elseif (isset($_POST["picture"])) {$picture=$_POST["picture"];} -if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} - elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} -if (isset($_GET["local_gmt"])) {$local_gmt=$_GET["local_gmt"];} - elseif (isset($_POST["local_gmt"])) {$local_gmt=$_POST["local_gmt"];} -if (isset($_GET["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_GET["ASTmgrUSERNAME"];} - elseif (isset($_POST["ASTmgrUSERNAME"])) {$ASTmgrUSERNAME=$_POST["ASTmgrUSERNAME"];} -if (isset($_GET["ASTmgrSECRET"])) {$ASTmgrSECRET=$_GET["ASTmgrSECRET"];} - elseif (isset($_POST["ASTmgrSECRET"])) {$ASTmgrSECRET=$_POST["ASTmgrSECRET"];} -if (isset($_GET["login_user"])) {$login_user=$_GET["login_user"];} - elseif (isset($_POST["login_user"])) {$login_user=$_POST["login_user"];} -if (isset($_GET["login_pass"])) {$login_pass=$_GET["login_pass"];} - elseif (isset($_POST["login_pass"])) {$login_pass=$_POST["login_pass"];} -if (isset($_GET["login_campaign"])) {$login_campaign=$_GET["login_campaign"];} - elseif (isset($_POST["login_campaign"])) {$login_campaign=$_POST["login_campaign"];} -if (isset($_GET["park_on_extension"])) {$park_on_extension=$_GET["park_on_extension"];} - elseif (isset($_POST["park_on_extension"])) {$park_on_extension=$_POST["park_on_extension"];} -if (isset($_GET["conf_on_extension"])) {$conf_on_extension=$_GET["conf_on_extension"];} - elseif (isset($_POST["conf_on_extension"])) {$conf_on_extension=$_POST["conf_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_GET["VICIDIAL_park_on_extension"];} - elseif (isset($_POST["VICIDIAL_park_on_extension"])) {$VICIDIAL_park_on_extension=$_POST["VICIDIAL_park_on_extension"];} -if (isset($_GET["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_GET["VICIDIAL_park_on_filename"];} - elseif (isset($_POST["VICIDIAL_park_on_filename"])) {$VICIDIAL_park_on_filename=$_POST["VICIDIAL_park_on_filename"];} -if (isset($_GET["monitor_prefix"])) {$monitor_prefix=$_GET["monitor_prefix"];} - elseif (isset($_POST["monitor_prefix"])) {$monitor_prefix=$_POST["monitor_prefix"];} -if (isset($_GET["recording_exten"])) {$recording_exten=$_GET["recording_exten"];} - elseif (isset($_POST["recording_exten"])) {$recording_exten=$_POST["recording_exten"];} -if (isset($_GET["voicemail_exten"])) {$voicemail_exten=$_GET["voicemail_exten"];} - elseif (isset($_POST["voicemail_exten"])) {$voicemail_exten=$_POST["voicemail_exten"];} -if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} - elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} -if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} - elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} -if (isset($_GET["dtmf_send_extension"])) {$dtmf_send_extension=$_GET["dtmf_send_extension"];} - elseif (isset($_POST["dtmf_send_extension"])) {$dtmf_send_extension=$_POST["dtmf_send_extension"];} -if (isset($_GET["call_out_number_group"])) {$call_out_number_group=$_GET["call_out_number_group"];} - elseif (isset($_POST["call_out_number_group"])) {$call_out_number_group=$_POST["call_out_number_group"];} -if (isset($_GET["client_browser"])) {$client_browser=$_GET["client_browser"];} - elseif (isset($_POST["client_browser"])) {$client_browser=$_POST["client_browser"];} -if (isset($_GET["install_directory"])) {$install_directory=$_GET["install_directory"];} - elseif (isset($_POST["install_directory"])) {$install_directory=$_POST["install_directory"];} -if (isset($_GET["local_web_callerID_URL"])) {$local_web_callerID_URL=$_GET["local_web_callerID_URL"];} - elseif (isset($_POST["local_web_callerID_URL"])) {$local_web_callerID_URL=$_POST["local_web_callerID_URL"];} -if (isset($_GET["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_GET["VICIDIAL_web_URL"];} - elseif (isset($_POST["VICIDIAL_web_URL"])) {$VICIDIAL_web_URL=$_POST["VICIDIAL_web_URL"];} -if (isset($_GET["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_GET["AGI_call_logging_enabled"];} - elseif (isset($_POST["AGI_call_logging_enabled"])) {$AGI_call_logging_enabled=$_POST["AGI_call_logging_enabled"];} -if (isset($_GET["user_switching_enabled"])) {$user_switching_enabled=$_GET["user_switching_enabled"];} - elseif (isset($_POST["user_switching_enabled"])) {$user_switching_enabled=$_POST["user_switching_enabled"];} -if (isset($_GET["conferencing_enabled"])) {$conferencing_enabled=$_GET["conferencing_enabled"];} - elseif (isset($_POST["conferencing_enabled"])) {$conferencing_enabled=$_POST["conferencing_enabled"];} -if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} - elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} -if (isset($_GET["admin_hijack_enabled"])) {$admin_hijack_enabled=$_GET["admin_hijack_enabled"];} - elseif (isset($_POST["admin_hijack_enabled"])) {$admin_hijack_enabled=$_POST["admin_hijack_enabled"];} -if (isset($_GET["admin_monitor_enabled"])) {$admin_monitor_enabled=$_GET["admin_monitor_enabled"];} - elseif (isset($_POST["admin_monitor_enabled"])) {$admin_monitor_enabled=$_POST["admin_monitor_enabled"];} -if (isset($_GET["call_parking_enabled"])) {$call_parking_enabled=$_GET["call_parking_enabled"];} - elseif (isset($_POST["call_parking_enabled"])) {$call_parking_enabled=$_POST["call_parking_enabled"];} -if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["updater_check_enabled"];} - elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];} -if (isset($_GET["AFLogging_enabled"])) {$AFLogging_enabled=$_GET["AFLogging_enabled"];} - elseif (isset($_POST["AFLogging_enabled"])) {$AFLogging_enabled=$_POST["AFLogging_enabled"];} -if (isset($_GET["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_GET["QUEUE_ACTION_enabled"];} - elseif (isset($_POST["QUEUE_ACTION_enabled"])) {$QUEUE_ACTION_enabled=$_POST["QUEUE_ACTION_enabled"];} -if (isset($_GET["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_GET["CallerID_popup_enabled"];} - elseif (isset($_POST["CallerID_popup_enabled"])) {$CallerID_popup_enabled=$_POST["CallerID_popup_enabled"];} -if (isset($_GET["voicemail_button_enabled"])) {$voicemail_button_enabled=$_GET["voicemail_button_enabled"];} - elseif (isset($_POST["voicemail_button_enabled"])) {$voicemail_button_enabled=$_POST["voicemail_button_enabled"];} -if (isset($_GET["enable_fast_refresh"])) {$enable_fast_refresh=$_GET["enable_fast_refresh"];} - elseif (isset($_POST["enable_fast_refresh"])) {$enable_fast_refresh=$_POST["enable_fast_refresh"];} -if (isset($_GET["fast_refresh_rate"])) {$fast_refresh_rate=$_GET["fast_refresh_rate"];} - elseif (isset($_POST["fast_refresh_rate"])) {$fast_refresh_rate=$_POST["fast_refresh_rate"];} -if (isset($_GET["enable_persistant_mysql"])) {$enable_persistant_mysql=$_GET["enable_persistant_mysql"];} - elseif (isset($_POST["enable_persistant_mysql"])) {$enable_persistant_mysql=$_POST["enable_persistant_mysql"];} -if (isset($_GET["auto_dial_next_number"])) {$auto_dial_next_number=$_GET["auto_dial_next_number"];} - elseif (isset($_POST["auto_dial_next_number"])) {$auto_dial_next_number=$_POST["auto_dial_next_number"];} -if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} - elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -if (isset($_GET["DBX_server"])) {$DBX_server=$_GET["DBX_server"];} - elseif (isset($_POST["DBX_server"])) {$DBX_server=$_POST["DBX_server"];} -if (isset($_GET["DBX_database"])) {$DBX_database=$_GET["DBX_database"];} - elseif (isset($_POST["DBX_database"])) {$DBX_database=$_POST["DBX_database"];} -if (isset($_GET["DBX_user"])) {$DBX_user=$_GET["DBX_user"];} - elseif (isset($_POST["DBX_user"])) {$DBX_user=$_POST["DBX_user"];} -if (isset($_GET["DBX_pass"])) {$DBX_pass=$_GET["DBX_pass"];} - elseif (isset($_POST["DBX_pass"])) {$DBX_pass=$_POST["DBX_pass"];} -if (isset($_GET["DBX_port"])) {$DBX_port=$_GET["DBX_port"];} - elseif (isset($_POST["DBX_port"])) {$DBX_port=$_POST["DBX_port"];} -if (isset($_GET["DBY_server"])) {$DBY_server=$_GET["DBY_server"];} - elseif (isset($_POST["DBY_server"])) {$DBY_server=$_POST["DBY_server"];} -if (isset($_GET["DBY_database"])) {$DBY_database=$_GET["DBY_database"];} - elseif (isset($_POST["DBY_database"])) {$DBY_database=$_POST["DBY_database"];} -if (isset($_GET["DBY_user"])) {$DBY_user=$_GET["DBY_user"];} - elseif (isset($_POST["DBY_user"])) {$DBY_user=$_POST["DBY_user"];} -if (isset($_GET["DBY_pass"])) {$DBY_pass=$_GET["DBY_pass"];} - elseif (isset($_POST["DBY_pass"])) {$DBY_pass=$_POST["DBY_pass"];} -if (isset($_GET["DBY_port"])) {$DBY_port=$_GET["DBY_port"];} - elseif (isset($_POST["DBY_port"])) {$DBY_port=$_POST["DBY_port"];} -if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} - elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} -if (isset($_GET["old_extension"])) {$old_extension=$_GET["old_extension"];} - elseif (isset($_POST["old_extension"])) {$old_extension=$_POST["old_extension"];} -if (isset($_GET["old_server_ip"])) {$old_server_ip=$_GET["old_server_ip"];} - elseif (isset($_POST["old_server_ip"])) {$old_server_ip=$_POST["old_server_ip"];} -if (isset($_GET["old_server_id"])) {$old_server_id=$_GET["old_server_id"];} - elseif (isset($_POST["old_server_id"])) {$old_server_id=$_POST["old_server_id"];} -if (isset($_GET["server_description"])) {$server_description=$_GET["server_description"];} - elseif (isset($_POST["server_description"])) {$server_description=$_POST["server_description"];} -if (isset($_GET["asterisk_version"])) {$asterisk_version=$_GET["asterisk_version"];} - elseif (isset($_POST["asterisk_version"])) {$asterisk_version=$_POST["asterisk_version"];} -if (isset($_GET["max_vicidial_trunks"])) {$max_vicidial_trunks=$_GET["max_vicidial_trunks"];} - elseif (isset($_POST["max_vicidial_trunks"])) {$max_vicidial_trunks=$_POST["max_vicidial_trunks"];} -if (isset($_GET["telnet_host"])) {$telnet_host=$_GET["telnet_host"];} - elseif (isset($_POST["telnet_host"])) {$telnet_host=$_POST["telnet_host"];} -if (isset($_GET["telnet_port"])) {$telnet_port=$_GET["telnet_port"];} - elseif (isset($_POST["telnet_port"])) {$telnet_port=$_POST["telnet_port"];} -if (isset($_GET["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_GET["ASTmgrUSERNAMEupdate"];} - elseif (isset($_POST["ASTmgrUSERNAMEupdate"])) {$ASTmgrUSERNAMEupdate=$_POST["ASTmgrUSERNAMEupdate"];} -if (isset($_GET["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_GET["ASTmgrUSERNAMElisten"];} - elseif (isset($_POST["ASTmgrUSERNAMElisten"])) {$ASTmgrUSERNAMElisten=$_POST["ASTmgrUSERNAMElisten"];} -if (isset($_GET["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_GET["ASTmgrUSERNAMEsend"];} - elseif (isset($_POST["ASTmgrUSERNAMEsend"])) {$ASTmgrUSERNAMEsend=$_POST["ASTmgrUSERNAMEsend"];} -if (isset($_GET["answer_transfer_agent"])) {$answer_transfer_agent=$_GET["answer_transfer_agent"];} - elseif (isset($_POST["answer_transfer_agent"])) {$answer_transfer_agent=$_POST["answer_transfer_agent"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["old_conf_exten"])) {$old_conf_exten=$_GET["old_conf_exten"];} - elseif (isset($_POST["old_conf_exten"])) {$old_conf_exten=$_POST["old_conf_exten"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} -if (isset($_GET["CoNfIrM"])) {$CoNfIrM=$_GET["CoNfIrM"];} - elseif (isset($_POST["CoNfIrM"])) {$CoNfIrM=$_POST["CoNfIrM"];} - -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### - -### DIGITS and Dots -$phone_ip = ereg_replace("[^\.0-9]","",$phone_ip); -$server_ip = ereg_replace("[^\.0-9]","",$server_ip); -$old_server_ip = ereg_replace("[^\.0-9]","",$old_server_ip); -$computer_ip = ereg_replace("[^\.0-9]","",$computer_ip); - -### Y or N ONLY ### -$active = ereg_replace("[^NY]","",$active); - -### DIGITS ONLY ### -$dialplan_number = ereg_replace("[^0-9]","",$dialplan_number); -$voicemail_id = ereg_replace("[^0-9]","",$voicemail_id); -$outbound_cid = ereg_replace("[^0-9]","",$outbound_cid); -$VICIDIAL_park_on_extension = ereg_replace("[^0-9]","",$VICIDIAL_park_on_extension); -$park_on_extension = ereg_replace("[^0-9]","",$park_on_extension); -$conf_on_extension = ereg_replace("[^0-9]","",$conf_on_extension); -$conf_exten = ereg_replace("[^0-9]","",$conf_exten); -$old_conf_exten = ereg_replace("[^0-9]","",$old_conf_exten); -$voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); -$voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); -$recording_exten = ereg_replace("[^0-9]","",$recording_exten); -$monitor_prefix = ereg_replace("[^0-9]","",$monitor_prefix); -$answer_transfer_agent = ereg_replace("[^0-9]","",$answer_transfer_agent); -$DBX_port = ereg_replace("[^0-9]","",$DBX_port); -$DBY_port = ereg_replace("[^0-9]","",$DBY_port); -$telnet_port = ereg_replace("[^0-9]","",$telnet_port); -$max_vicidial_trunks = ereg_replace("[^0-9]","",$max_vicidial_trunks); -$auto_dial_next_number = ereg_replace("[^0-9]","",$auto_dial_next_number); -$VDstop_rec_after_each_call = ereg_replace("[^0-9]","",$VDstop_rec_after_each_call); -$enable_persistant_mysql = ereg_replace("[^0-9]","",$enable_persistant_mysql); -$enable_fast_refresh = ereg_replace("[^0-9]","",$enable_fast_refresh); -$user_switching_enabled = ereg_replace("[^0-9]","",$user_switching_enabled); -$updater_check_enabled = ereg_replace("[^0-9]","",$updater_check_enabled); -$QUEUE_ACTION_enabled = ereg_replace("[^0-9]","",$QUEUE_ACTION_enabled); -$conferencing_enabled = ereg_replace("[^0-9]","",$conferencing_enabled); -$voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); -$CallerID_popup_enabled = ereg_replace("[^0-9]","",$CallerID_popup_enabled); -$call_parking_enabled = ereg_replace("[^0-9]","",$call_parking_enabled); -$AGI_call_logging_enabled = ereg_replace("[^0-9]","",$AGI_call_logging_enabled); -$AFLogging_enabled = ereg_replace("[^0-9]","",$AFLogging_enabled); -$admin_monitor_enabled = ereg_replace("[^0-9]","",$admin_monitor_enabled); -$admin_hijack_enabled = ereg_replace("[^0-9]","",$admin_hijack_enabled); -$admin_hangup_enabled = ereg_replace("[^0-9]","",$admin_hangup_enabled); -$fast_refresh_rate = ereg_replace("[^0-9]","",$fast_refresh_rate); -$ADD = ereg_replace("[^0-9]","",$ADD); - -### ALPHA-NUMERIC and underscore and dash and slash and at and dot -$extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); -$old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); -$install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); -$client_browser = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$client_browser); -$dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); -$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); -$telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); -$DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); -$DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); - -### ALPHA-NUMERIC (and underscore and dash) -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$login = ereg_replace("[^-\_0-9a-zA-Z]","",$login); -$user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); -$pass = ereg_replace("[^-\_0-9a-zA-Z]","",$pass); -$status = ereg_replace("[^-\_0-9a-zA-Z]","",$status); -$protocol = ereg_replace("[^-\_0-9a-zA-Z]","",$protocol); -$ASTmgrUSERNAMEupdate = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEupdate); -$ASTmgrUSERNAMEsend = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMEsend); -$ASTmgrUSERNAMElisten = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAMElisten); -$ASTmgrUSERNAME = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrUSERNAME); -$ASTmgrSECRET = ereg_replace("[^-\_0-9a-zA-Z]","",$ASTmgrSECRET); -$login_user = ereg_replace("[^-\_0-9a-zA-Z]","",$login_user); -$login_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$login_pass); -$login_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$login_campaign); -$DBX_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_user); -$DBY_user = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_user); -$DBX_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_pass); -$DBY_pass = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_pass); -$DBX_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBX_database); -$DBY_database = ereg_replace("[^-\_0-9a-zA-Z]","",$DBY_database); -$VICIDIAL_park_on_filename = ereg_replace("[^-\_0-9a-zA-Z]","",$VICIDIAL_park_on_filename); -$server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$server_id); -$old_server_id = ereg_replace("[^-\_0-9a-zA-Z]","",$old_server_id); -$ext_context = ereg_replace("[^-\_0-9a-zA-Z]","",$ext_context); -$CoNfIrM = ereg_replace("[^-\_0-9a-zA-Z]","",$CoNfIrM); - -### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores -$phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); -$full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); -$fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); -$company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); -$picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); -$local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); -$server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); -$asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - -### VARIABLES TO BE mysql_real_escape_string ### -# $VICIDIAL_web_URL = -# $local_web_callerID_URL = - -##### END VARIABLE FILTERING FOR SECURITY ##### - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -if (!isset($ADD)) {$ADD=0;} - -$STARTtime = date("U"); -$STARTdate = date("Y-m-d H:i:s"); - -if ($ADD==1) {$process = 'ADD NEW PHONE';} -if ($ADD==11) {$process = 'ADD NEW SERVER';} -if ($ADD==111) {$process = 'ADD NEW CONFERENCE';} -if ($ADD==2) {$process = 'ADDING NEW PHONE';} -if ($ADD==21) {$process = 'ADDING NEW SERVER';} -if ($ADD==211) {$process = 'ADDING NEW CONFERENCE';} -if ($ADD==3) {$process = 'MODIFY PHONE';} -if ($ADD==31) {$process = 'MODIFY SERVER';} -if ($ADD==311) {$process = 'MODIFY CONFERENCE';} -if ($ADD==4) {$process = 'MODIFYING PHONE';} -if ($ADD==41) {$process = 'MODIFYING SERVER';} -if ($ADD==411) {$process = 'MODIFYING CONFERENCE';} -if ($ADD==5) {$process = 'DELETE PHONE';} -if ($ADD==6) {$process = 'DELETE PHONE';} -if ($ADD==55) {$process = 'SEARCH PHONES';} -if ($ADD==66) {$process = 'SEARCH PHONES RESULTS';} -if ($ADD==0) {$process = 'PHONE LIST';} -if ($ADD==10) {$process = 'SERVER LIST';} -if ($ADD==100) {$process = 'CONFERENCE LIST';} -if ($ADD==99999) {$process = 'HELP';} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if ($auth<1) - { - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > '6' and ast_admin_access='1';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[3]; - $LOGdelete_phones =$row[17]; - } - } - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - echo "|$stmt|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - if (strlen($LOGfullname) < 1) - { - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - } - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rsltx=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rsltx); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rsltx); - $servers_list .= "\n"; - $o++; - } - - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -header ("Content-type: text/html; charset=utf-8"); - -$NWB = "   \"HELP\""; -###################### -# ADD=99999 display the HELP SCREENS -###################### - -if ($ADD==99999) -{ -echo "\n"; -echo "\n"; -echo "ASTERISK ADMIN: Administration - $process \n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
ASTERISK ADMIN: HELP


\n"; - -?> -PHONES TABLE

- -
-Phone extension - This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones make sure you use the full phones name: IAX2/IAXphone1@IAXphone1 would be IAXphone1@IAXphone1. For Zap phones make sure you put the full channel: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol below correctly for your type of phone. - -
-
-
-Dialplan number - This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server - -
-
-
-Voicemail Box - This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app. - -
-
-
-Outbound CallerID - This field is where you would enter the callerID number that you would like to appear on outbound calls placed form the astguiclient web-client. This does not work on RBS, non-PRI, T1/E1s. - -
-
-
-Phone IP address - This field is for the phone's IP address if it is a VOIP phone. This is an optional field - -
-
-
-Computer IP address - This field is for the user's computer IP address. This is an optional field - -
-
-
-Server IP - This menu is where you select which server the phone is active on. - -
-
-
-Login - The login used for the phone user to login to the client applications. - -
-
-
-Password - The password used for the phone user to login to the client applications. - -
-
-
-Status - The status of the phone in the system, ACTIVE and ADMIN allow for GUI clients to work. ADMIN allows access to this administrative web site. All other statuses do not allow GUI or Admin web access. - -
-
-
-Active Account - Whether the phone is active to put it in the list in the GUI client. - -
-
-
-Phone Type - Purely for administrative notes. - -
-
-
-Full Name - Used by the GUIclient in the list of active phones. - -
-
-
-Company - Purely for administrative notes. - -
-
-
-Picture - Not yet Implemented. - -
-
-
-New Messages - Number of new voicemail messages for this phone on the Asterisk server. - -
-
-
-Old Messages - Number of old voicemail messages for this phone on the Asterisk server. - -
-
-
-Client Protocol - The protocol that the phone uses to connect to the Asterisk server: SIP, IAX2, Zap . Also, there is EXTERNAL for remote dial numbers or speed dial numbers that you want to list as phones. - -
-
-
-Local GMT - The difference from Greenwich Mean time, or ZULU time where the phone is located. DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. This is used by the VICIDIAL campaign to accurately display the time and customer time. - -
-
-
-Manager Login - This is the login that the GUI clients for this phone will use to access the Database where the server data resides. - -
-
-
-Manager Secret - This is the password that the GUI clients for this phone will use to access the Database where the server data resides. - -
-
-
-VICIDIAL Default User - This is to place a default value in the VICIDIAL user field whenever this phone user opens the astVICIDIAL client app. Leave blank for no user. - -
-
-
-VICIDIAL Default Pass - This is to place a default value in the VICIDIAL password field whenever this phone user opens the astVICIDIAL client app. Leave blank for no pass. - -
-
-
-VICIDIAL Default Campaign - This is to place a default value in the VICIDIAL campaign field whenever this phone user opens the astVICIDIAL client app. Leave blank for no campaign. - -
-
-
-Park Exten - This is the default Parking extension for the client apps. Verify that a different one works before you change this. - -
-
-
-Conf Exten - This is the default Conference park extension for the client apps. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park Exten - This is the default Parking extension for VICIDIAL client app. Verify that a different one works before you change this. - -
-
-
-VICIDIAL Park File - This is the default VICIDIAL park extension file name for the client apps. Verify that a different one works before you change this. limited to 10 characters. - -
-
-
-Monitor Prefix - This is the dialplan prefix for monitoring of Zap channels automatically within the astGUIclient app. Only change according to the extensions.conf ZapBarge extensions records. - -
-
-
-Recording Exten - This is the dialplan extension for the recording extension that is used to drop into meetme conferences to record them. It usually lasts upto one hour if not stopped. verify with extensions.conf file before changing. - -
-
-
-VMAIL Main Exten - This is the dialplan extension going to check your voicemail. verify with extensions.conf file before changing. - -
-
-
-VMAIL Dump Exten - This is the dialplan prefix used to send calls directly to a user's voicemail from a live call in the astGUIclient app. verify with extensions.conf file before changing. - -
-
-
-Exten Context - This is the dialplan context that this phone primarily uses. It is assumed that all numbers dialed by the client apps are using this context so it is a good idea to make sure this is the most wide context possible. verify with extensions.conf file before changing. - -
-
-
-DTMF send Channel - This is the channel string used to send DTMF sounds into meetme conferences from the client apps. Verify the exten and context with the extensions.conf file. - -
-
-
-Outbound Call Group - This is the channel group that outbound calls from this phone are placed out of. There are a couple routines in the client apps that use this. For Zap channels you want to use something like Zap/g2 , for IAX2 trunks you would want to use the full IAX prefix like IAX2/VICItest1:secret@10.10.10.15:4569. Verify the trunks with the extensions.conf file, it is usually what you have defined as the TRUNK global variable at the top of the file. - -
-
-
-Browser Location - This is applicable to only UNIX/LINUX clients, the absolute path to Mozilla or Firefox browser on the machine. verify this by launching it manually. - -
-
-
-Install Directory - This is the place where the astGUIclient and astVICIDIAL scripts are located on your machine. For Win32 it should be something like C:\AST_VICI and for UNIX it should be something like /usr/local/perl_TK. verify this manually. - -
-
-
-CallerID URL - This is the web address of the page used to do custom callerID lookups. default testing address is: http://astguiclient.sf.net/test_callerid_output.php - -
-
-
-VICIDIAL Default URL - This is the web address of the page used to do custom VICIDIAL Web Form queries. default testing address is: http://astguiclient.sf.net/test_VICIDIAL_output.php - -
-
-
-Call Logging - This is set to true if the call_log.agi file is in place in the extensions.conf file for all outbound and hangup 'h' extensions to log all calls. This should always be 1 because it is manditory for many astGUIclient and VICIDIAL features to work properly. - -
-
-
-User Switching - Set to true to allow user to switch to another user account. NOTE: If user switches they can initiate recording on the new user's phone conversation - -
-
-
-Conferencing - Set to true to allow user to start conference calls with upto six external lines. - -
-
-
-Admin Hangup - Set to true to allow user to be able to hangup any line at will through astGUIclient. Good idea only to enable this for Admin users. - -
-
-
-Admin Hijack - Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers. - -
-
-
-Admin Monitor - Set to true to allow user to be able to grab and redirect to their extension any line at will through astGUIclient. Good idea only to enable this for Admin users. But is very useful for Managers and as a training tool. - -
-
-
-Call Park - Set to true to allow user to be able to park calls on astGUIclient hold to be picked up by any other astGUIclient user on the system. Calls stay on hold for upto a half hour then hangup. Usually enabled for all. - -
-
-
-Updater Check - Set to true to display a popup warning that the updater time has not changed in 20 seconds. Useful for Admin users. - -
-
-
-AF Logging - Set to true to log many actions of astGUIclient usage to a text file on the user's computer. - -
-
-
-Queue Enabled - Set to true to have client apps use the Asterisk Central Queue system. Required for VICIDIAL and recommended for all users. - -
-
-
-CallerID Popup - Set to true to allow for numbers defined in the extensions.conf file to send CallerID popup screens to astGUIclient users. - -
-
-
-VMail Button - Set to true to display the VOICEMAIL button and the messages count display on astGUIclient. - -
-
-
-Fast Refresh - Set to true to enable a new rate of refresh of call information for the astGUIclient. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number. - -
-
-
-Fast Refresh Rate - in milliseconds. Only used if Fast Refresh is enabled. Default disabled rate is 1000 ms ,1 second. Can increase system load if you lower this number. - -
-
-
-Persistant MySQL - If enabled the astGUIclient connection will remain connected instead of connecting every second. Useful if you have a fast refresh rate set. It will increase the number of connections on your MySQL machine. - -
-
-
-Auto Dial Next Number - If enabled the VICIDIAL client will dial the next number on the list automatically upon disposition of a call unless they selected to "Stop Dialing" on the disposition screen. - -
-
-
-Stop Rec after each call - If enabled the VICIDIAL client will stop whatever recording is going on after each call has been dispositioned. Useful if you are doing a lot of recording or you are using a web form to trigger recording. - -
-
-
-DBX Server - The MySQL database server that this user should be connecting to. - -
-
-
-DBX Database - The MySQL database that this user should be connecting to. Default is asterisk. - -
-
-
-DBX User - The MySQL user login that this user should be using when connecting. Default is cron. - -
-
-
-DBX Pass - The MySQL user password that this user should be using when connecting. Default is 1234. - -
-
-
-DBX Port - The MySQL TCP port that this user should be using when connecting. Default is 3306. - -
-
-
-DBY Server - The MySQL database server that this user should be connecting to. Secondary server, not used currently. - -
-
-
-DBY Database - The MySQL database that this user should be connecting to. Default is asterisk. Secondary server, not used currently. - -
-
-
-DBY User - The MySQL user login that this user should be using when connecting. Default is cron. Secondary server, not used currently. - -
-
-
-DBY Pass - The MySQL user password that this user should be using when connecting. Default is 1234. Secondary server, not used currently. - -
-
-
-DBY Port - The MySQL TCP port that this user should be using when connecting. Default is 3306. Secondary server, not used currently. - - -



- -SERVERS TABLE

-
-
-Server ID - This field is where you put the Asterisk servers name, doesnt have to be an official domain sub, just a nickname to identify the server to Admin users. - -
-
-
-Server Description - The field where you use a small phrase to describe the Asterisk server. - -
-
-
-Server IP Address - The field where you put the Network IP address of the Asterisk server. - -
-
-
-Active - Set whether the Asterisk server is active or inactive. - -
-
-
-Asterisk Version - Set the version of Asterisk that you have installed on this server. Examples: '1.2', '1.0.8', '1.0.7', 'CVS_HEAD', 'REALLY OLD', etc... This is used because versions 1.0.8 and 1.0.9 have a different method of dealing with Local/ channels, a bug that has been fixed in CVS v1.0, and need to be treated differently when handling their Local/ channels. Also, current CVS_HEAD and the 1.2 release tree uses different manager and command output so it must be treated differently as well. - -
-
-
-Max VICIDIAL Trunks - This field will determine the maximum number of lines that the VICIDIAL auto-dialer will attempt to call on this server. If you want to dedicate two full PRI T1s to VICIDIALing on a server then you would set this to 46. Default is 96. - -
-
-
-Telnet Host - This is the address or name of the Asterisk server and is how the manager applications connect to it from where they are running. If they are running on the Asterisk server, then the default of 'localhost' is fine. - -
-
-
-Telnet Port - This is the port of the Asterisk server Manager connection and is how the manager applications connect to it from where they are running. The default of '5038' is fine for a standard install. - -
-
-
-Manager User - The username or login used to connect genericly to the Asterisk server manager. Default is 'cron' - -
-
-
-Manager Secret - The secret or password used to connect genericly to the Asterisk server manager. Default is '1234' - -
-
-
-Manager Update User - The username or login used to connect to the Asterisk server manager optimized for the Update scripts. Default is 'updatecron' and assumes the same secret as the generic user. - -
-
-
-Manager Listen User - The username or login used to connect to the Asterisk server manager optimized for scripts that only listen for output. Default is 'listencron' and assumes the same secret as the generic user. - -
-
-
-Manager Send User - The username or login used to connect to the Asterisk server manager optimized for scripts that only send Actions to the manager. Default is 'sendcron' and assumes the same secret as the generic user. - -
-
-
-Server GMT offset - The difference in hours from GMT time not adjusted for Daylight-Savings-Time of the server. Default is '-5' - -
-
-
-VMail Dump Exten - The extension prefix used on this server to send calls directly through agc to a specific voicemail box. Default is '85026666666666' - -
-
-
-VICIDIAL AD extension - The default extension if none is present in the campaign to send calls to for VICIDIAL auto dialing. Default is '8365' - -
-
-
-Default Context - The default dialplan context used for scripts that operate for this server. Default is 'default' - - -



- -CONFERENCES TABLE

-
-
-Conference Number - This field is where you put the meetme conference dialpna number. It is also recommended that the meetme number in meetme.conf matches this number for each entry. This is for the conferences in astGUIclient and is used for leave-3way-call functionality in VICIDIAL. - -
-
-
-Server IP - The menu where you select the Asterisk server that this conference will be on. - - - - - - -







-







-THE END -
- - - -ASTERISK ADMIN: Administration - <? echo $process ?> - - - -
- - - - - - -
  ASTERISK ADMIN - Logout  
  LIST ALL PHONES | ADD A NEW PHONE | SEARCH FOR A PHONE | ADD A SERVER | LIST ALL SERVERS
  SHOW ALL CONFERENCES | ADD A NEW CONFERENCE
-"; - -echo "
ADD A NEW PHONE
\n"; -echo "\n"; -echo "
\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\n"; - -} - - -###################### -# ADD=11 display the ADD NEW SERVERS FORM SCREEN -###################### - -if ($ADD==11) -{ -echo ""; - -echo "
ADD A NEW SERVER\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
\n"; - -} - - -###################### -# ADD=111 display the ADD NEW CONFERENCES FORM SCREEN -###################### - -if ($ADD==111) -{ -echo ""; - -echo "
ADD A NEW CONFERENCE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\n"; - -} - - -###################### -# ADD=2 adds the new phone to the system -###################### - -if ($ADD==2) -{ - echo ""; - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
PHONE NOT ADDED - there is already a Phone in the system with this extension/server\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
PHONE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
PHONE ADDED\n"; - - $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=3; -} - -###################### -# ADD=21 adds the new server to the system -###################### - -if ($ADD==21) -{ - echo ""; - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
SERVER NOT ADDED - there is already a server in the system with this ID\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVER NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
SERVER ADDED\n"; - - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=31; -} - - -###################### -# ADD=211 adds the new conference to the system -###################### - -if ($ADD==211) -{ - echo ""; - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
CONFERENCE NOT ADDED - there is already a conference in the system with this ID and server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCE NOT ADDED - Please go back and look at the data you entered\n";} - else - { - echo "
CONFERENCE ADDED\n"; - - $stmt="INSERT INTO conferences (conf_exten,server_ip) values('$conf_exten','$server_ip');"; - $rslt=mysql_query($stmt, $link); - } - } -$ADD=100; -} - - -###################################################################################################### -###################################################################################################### -####### 5 series, delete records confirmation -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=5 confirmation before deletion of phone -###################### - -if ($ADD==5) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($LOGdelete_phones < 1) ) - { - echo "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - echo "
PHONE DELETION CONFIRMATION: $extension - $server_ip\n"; - echo "

Click here to delete phone $extension - $server_ip


\n"; - } - -$ADD='3'; # go to phone modification below -} - - - - -###################################################################################################### -###################################################################################################### -####### 6 series, delete records -###################################################################################################### -###################################################################################################### - - -###################### -# ADD=6 delete phone record -###################### - -if ($ADD==6) -{ - echo ""; - - if ( (strlen($extension) < 2) or (strlen($server_ip) < 7) or ($CoNfIrM != 'YES') or ($LOGdelete_phones < 1) ) - { - echo "
PHONE NOT DELETED - Please go back and look at the data you entered\n"; - echo "
Extension be at least 2 characters in length\n"; - echo "
Server IP be at least 7 characters in length\n"; - } - else - { - $stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;"; - $rslt=mysql_query($stmt, $link); - - ### LOG CHANGES TO LOG FILE ### - if ($WeBRooTWritablE > 0) - { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|!!!DELETING PHONE!!!|$PHP_AUTH_USER|$ip|extension='$extension'|server_ip='$server_ip'|\n"); - fclose($fp); - } - echo "
PHONE DELETION COMPLETED: $extension - $server_ip\n"; - echo "

\n"; - } - -$ADD='0'; # go to phone list -} - - - - - - -###################### -# ADD=3 modify phone info in the system -###################### - -if ($ADD==3) -{ - echo ""; - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A PHONE RECORD: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
Old Messages: $row[15]$NWB#phones-old_messages$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
Manager Login: $NWB#phones-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Default User: $NWB#phones-login_user$NWE
VICIDIAL Default Pass: $NWB#phones-login_pass$NWE
VICIDIAL Default Campaign: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park File: $NWB#phones-VICIDIAL_park_on_filename$NWE
Monitor Prefix: $NWB#phones-monitor_prefix$NWE
Recording Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Context: $NWB#phones-ext_context$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
Browser Location: $NWB#phones-client_browser$NWE
Install Directory: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Default URL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
User Switching: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hangup: $NWB#phones-admin_hangup_enabled$NWE
Admin Hijack: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Call Park: $NWB#phones-call_parking_enabled$NWE
Updater Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Queue Enabled: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Button: $NWB#phones-voicemail_button_enabled$NWE
Fast Refresh: $NWB#phones-enable_fast_refresh$NWE
Fast Refresh Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Dial Next Number: $NWB#phones-auto_dial_next_number$NWE
Stop Rec after each call: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Server: (Primary DB Server)$NWB#phones-DBX_server$NWE
DBX Database: (Primary Server Database)$NWB#phones-DBX_database$NWE
DBX User: (Primary DB Login)$NWB#phones-DBX_user$NWE
DBX Pass: (Primary DB Secret)$NWB#phones-DBX_pass$NWE
DBX Port: (Primary DB Port)$NWB#phones-DBX_port$NWE
DBY Server: (Secondary DB Server)$NWB#phones-DBY_server$NWE
DBY Database: (Secondary Server Database)$NWB#phones-DBY_database$NWE
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Click here for phone stats\n"; - -if ($LOGdelete_phones > 0) - { - echo "

DELETE THIS PHONE\n"; - } - -} - - -###################### -# ADD=31 modify server info in the system -###################### - -if ($ADD==31) -{ - echo ""; - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A SERVER RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Max VICIDIAL Trunks: $NWB#servers-max_vicidial_trunks$NWE
Telnet Host: $NWB#servers-telnet_host$NWE
Telnet Port: $NWB#servers-telnet_port$NWE
Manager User: $NWB#servers-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#servers-ASTmgrSECRET$NWE
Manager Update User: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Listen User: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Send User: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL AD extension: $NWB#servers-answer_transfer_agent$NWE
Default Context: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
PHONES WITHIN THIS SERVER:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
EXTENSIONNAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This server has $active_lists active phones and $inactive_lists inactive phones

\n"; -echo "
\n"; -} - - -###################### -# ADD=311 modify conference info in the system -###################### - -if ($ADD==311) -{ - echo ""; - - $stmt="SELECT * from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A CONFERENCE RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; - -echo "
\n"; - -} - - - -###################### -# ADD=4 submit phone modifications to the system -###################### - -if ($ADD==4) -{ - echo ""; - - $stmt="SELECT count(*) from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($extension != $old_extension) or ($server_ip != $old_server_ip) ) ) - {echo "
PHONE NOT MODIFIED - there is already a Phone in the system with this extension/server\n";} - else - { - if ( (strlen($extension) < 1) or (strlen($server_ip) < 7) or (strlen($dialplan_number) < 1) or (strlen($voicemail_id) < 1) or (strlen($login) < 1) or (strlen($pass) < 1)) - {echo "
PHONE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
PHONE MODIFIED: $extension\n"; - - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid' where extension='$old_extension' and server_ip='$old_server_ip';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from phones where extension='$extension' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A PHONE RECORD: $row[1]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone extension: $NWB#phones-extension$NWE
Dialplan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
New Messages: $row[14]$NWB#phones-messages$NWE
Old Messages: $row[15]$NWB#phones-old_messages$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
Manager Login: $NWB#phones-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#phones-ASTmgrSECRET$NWE
VICIDIAL Default User: $NWB#phones-login_user$NWE
VICIDIAL Default Pass: $NWB#phones-login_pass$NWE
VICIDIAL Default Campaign: $NWB#phones-login_campaign$NWE
Park Exten: $NWB#phones-park_on_extension$NWE
Conf Exten: $NWB#phones-conf_on_extension$NWE
VICIDIAL Park Exten: $NWB#phones-VICIDIAL_park_on_extension$NWE
VICIDIAL Park File: $NWB#phones-VICIDIAL_park_on_filename$NWE
Monitor Prefix: $NWB#phones-monitor_prefix$NWE
Recording Exten: $NWB#phones-recording_exten$NWE
VMailMain Exten: $NWB#phones-voicemail_exten$NWE
VMailDump Exten: $NWB#phones-voicemail_dump_exten$NWE
Exten Context: $NWB#phones-ext_context$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
Browser Location: $NWB#phones-client_browser$NWE
Install Directory: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Default URL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
User Switching: $NWB#phones-user_switching_enabled$NWE
Conferencing: $NWB#phones-conferencing_enabled$NWE
Admin Hangup: $NWB#phones-admin_hangup_enabled$NWE
Admin Hijack: $NWB#phones-admin_hijack_enabled$NWE
Admin Monitor: $NWB#phones-admin_monitor_enabled$NWE
Call Park: $NWB#phones-call_parking_enabled$NWE
Updater Check: $NWB#phones-updater_check_enabled$NWE
AF Logging: $NWB#phones-AFLogging_enabled$NWE
Queue Enabled: $NWB#phones-QUEUE_ACTION_enabled$NWE
CallerID Popup: $NWB#phones-CallerID_popup_enabled$NWE
VMail Button: $NWB#phones-voicemail_button_enabled$NWE
Fast Refresh: $NWB#phones-enable_fast_refresh$NWE
Fast Refresh Rate: (in ms)$NWB#phones-fast_refresh_rate$NWE
Persistant MySQL: $NWB#phones-enable_persistant_mysql$NWE
Auto Dial Next Number: $NWB#phones-auto_dial_next_number$NWE
Stop Rec after each call: $NWB#phones-VDstop_rec_after_each_call$NWE
DBX Server: (Primary DB Server)$NWB#phones-DBX_server$NWE
DBX Database: (Primary Server Database)$NWB#phones-DBX_database$NWE
DBX User: (Primary DB Login)$NWB#phones-DBX_user$NWE
DBX Pass: (Primary DB Secret)$NWB#phones-DBX_pass$NWE
DBX Port: (Primary DB Port)$NWB#phones-DBX_port$NWE
DBY Server: (Secondary DB Server)$NWB#phones-DBY_server$NWE
DBY Database: (Secondary Server Database)$NWB#phones-DBY_database$NWE
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
\n"; - -echo "

Click here for phone stats\n"; - -if ($LOGdelete_phones > 0) - { - echo "

DELETE THIS PHONE\n"; - } - -} - -###################### -# ADD=41 submit server modifications to the system -###################### - -if ($ADD==41) -{ - echo ""; - - $stmt="SELECT count(*) from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_id != $old_server_id) ) - {echo "
SERVER NOT MODIFIED - there is already a server in the system with this server_id\n";} - else - { - $stmt="SELECT count(*) from servers where server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ($server_ip != $old_server_ip) ) - {echo "
SERVER NOT MODIFIED - there is already a server in the system with this server_ip\n";} - else - { - if ( (strlen($server_id) < 1) or (strlen($server_ip) < 7) ) - {echo "
SERVER NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
SERVER MODIFIED: $server_ip\n"; - - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context' where server_id='$old_server_id';"; - $rslt=mysql_query($stmt, $link); - } - } - } - - $stmt="SELECT * from servers where server_id='$server_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A SERVER RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
Max VICIDIAL Trunks: $NWB#servers-max_vicidial_trunks$NWE
Telnet Host: $NWB#servers-telnet_host$NWE
Telnet Port: $NWB#servers-telnet_port$NWE
Manager User: $NWB#servers-ASTmgrUSERNAME$NWE
Manager Secret: $NWB#servers-ASTmgrSECRET$NWE
Manager Update User: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Manager Listen User: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Manager Send User: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#servers-local_gmt$NWE
VMail Dump Exten: $NWB#servers-voicemail_dump_exten$NWE
VICIDIAL AD extension: $NWB#servers-answer_transfer_agent$NWE
Default Context: $NWB#servers-ext_context$NWE
\n"; - -echo "
\n"; -echo "
PHONES WITHIN THIS SERVER:
\n"; -echo "\n"; -echo "\n"; - - $active_lists = 0; - $inactive_lists = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; - - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";} - if (ereg("N", $rowx[1])) {$inactive_lists++;} - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - - } - -echo "
EXTENSIONNAMEACTIVE
$rowx[0]$rowx[2]$rowx[1]

\n"; -echo "
\n"; - - $camp_lists = eregi_replace(".$","",$camp_lists); -echo "This server has $active_lists active phones and $inactive_lists inactive phones

\n"; -echo "
\n"; - -} - -###################### -# ADD=411 submit conference modifications to the system -###################### - -if ($ADD==411) -{ - echo ""; - - $stmt="SELECT count(*) from conferences where conf_exten='$conf_exten' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ( ($row[0] > 0) && ( ($conf_exten != $old_conf_exten) or ($server_ip != $old_server_ip) ) ) - {echo "
CONFERENCE NOT MODIFIED - there is already a Conference in the system with this extension-server\n";} - else - { - if ( (strlen($conf_exten) < 1) or (strlen($server_ip) < 7) ) - {echo "
CONFERENCE NOT MODIFIED - Please go back and look at the data you entered\n";} - else - { - echo "
CONFERENCE MODIFIED: $conf_exten\n"; - - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; - $rslt=mysql_query($stmt, $link); - } - } - - $stmt="SELECT * from conferences where conf_exten='$conf_exten';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - -echo "
MODIFY A CONFERENCE RECORD: $row[0]\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conference: $NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
Current Extension:
\n"; - -echo "
\n"; - -} - - - - - - - -###################### -# ADD=55 search form -###################### - -if ($ADD==55) -{ -echo ""; - -echo "
SEARCH FOR A PHONE\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
extension:
Full Name:
Phone type:
\n"; - -} - -###################### -# ADD=66 phone search results -###################### - -if ($ADD==66) -{ - echo ""; - - $SQL = ''; - if ($extension) {$SQL .= "extension LIKE \"%$extension%\" and";} - if ($fullname) {$SQL .= "fullname LIKE \"%$fullname%\" and";} - if ($phone_type) {$SQL .= "phone_type LIKE \"%$phone_type%\" and";} - $SQL = eregi_replace(" and$", "", $SQL); - if (strlen($SQL)>5) {$SQL = "where $SQL";} - - $stmt="SELECT * from phones $SQL order by extension,server_ip;"; -# echo "\n|$stmt|\n"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
SEARCH RESULTS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFY | STATS
\n"; - -} - - - -###################### -# ADD=0 display all active phones -###################### -if ($ADD==0) -{ - echo ""; - - $stmt="SELECT * from phones order by extension,server_ip"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
PHONE LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[16]$row[5]$row[1]$row[2]$row[8]$row[11]$row[14]$row[15]MODIFY | STATS
\n"; -} - -###################### -# ADD=10 display all servers -###################### -if ($ADD==10) -{ - echo ""; - - $stmt="SELECT * from servers order by server_id"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
SERVER LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0]$row[1] $row[2] $row[4] $row[3]  MODIFY
\n"; -} - - -###################### -# ADD=100 display all conferences -###################### -if ($ADD==100) -{ - echo ""; - - $stmt="SELECT * from conferences order by conf_exten"; - $rslt=mysql_query($stmt, $link); - $phones_to_print = mysql_num_rows($rslt); - -echo "
CONFERENCE LISTINGS:\n"; -echo "
\n"; - - $o=0; - while ($phones_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } - -echo "
$row[0] $row[1] $row[2]$row[4]  MODIFY
\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; -echo "             VERSION: $version"; -echo "             BUILD: $build
\n"; - - -?> - - -
- - - - - - - - - diff --git a/astguiclient_web/dbconnect.php b/astguiclient_web/dbconnect.php deleted file mode 100644 index f1998407..00000000 --- a/astguiclient_web/dbconnect.php +++ /dev/null @@ -1,14 +0,0 @@ - LICENSE: GPLv2 -# - -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); - -#$WeBServeRRooT = '/home/www/htdocs'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -$WeBRooTWritablE = '1'; - -?> \ No newline at end of file diff --git a/astguiclient_web/help.gif b/astguiclient_web/help.gif deleted file mode 100644 index 5575d7c8..00000000 Binary files a/astguiclient_web/help.gif and /dev/null differ diff --git a/astguiclient_web/inbound_popup.php b/astguiclient_web/inbound_popup.php deleted file mode 100644 index 6f451656..00000000 --- a/astguiclient_web/inbound_popup.php +++ /dev/null @@ -1,228 +0,0 @@ - LICENSE: GPLv2 -### -# this is the inbound popup of a specific call that grabs the call and allows you to go and fetch info on that caller in the local CRM system. -# -# changes: -# 60620-1329 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} - elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} -if (isset($_GET["phone"])) {$phone=$_GET["phone"];} - elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} -if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} - elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} -if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} - elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} -if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} - elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} -if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} - elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} -if (isset($_GET["end_call"])) {$end_call=$_GET["end_call"];} - elseif (isset($_POST["end_call"])) {$end_call=$_POST["end_call"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} - elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} -if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} - elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} - elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["channel"])) {$channel=$_GET["channel"];} - elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} -if (isset($_GET["call_began"])) {$call_began=$_GET["call_began"];} - elseif (isset($_POST["call_began"])) {$call_began=$_POST["call_began"];} -if (isset($_GET["parked_time"])) {$parked_time=$_GET["parked_time"];} - elseif (isset($_POST["parked_time"])) {$parked_time=$_POST["parked_time"];} -if (isset($_GET["tsr"])) {$tsr=$_GET["tsr"];} - elseif (isset($_POST["tsr"])) {$tsr=$_POST["tsr"];} -if (isset($_GET["address1"])) {$address1=$_GET["address1"];} - elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} -if (isset($_GET["address2"])) {$address2=$_GET["address2"];} - elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} -if (isset($_GET["address3"])) {$address3=$_GET["address3"];} - elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} -if (isset($_GET["city"])) {$city=$_GET["city"];} - elseif (isset($_POST["city"])) {$city=$_POST["city"];} -if (isset($_GET["state"])) {$state=$_GET["state"];} - elseif (isset($_POST["state"])) {$state=$_POST["state"];} -if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} - elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} -if (isset($_GET["province"])) {$province=$_GET["province"];} - elseif (isset($_POST["province"])) {$province=$_POST["province"];} -if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} - elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} -if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} - elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} -if (isset($_GET["email"])) {$email=$_GET["email"];} - elseif (isset($_POST["email"])) {$email=$_POST["email"];} -if (isset($_GET["security"])) {$security=$_GET["security"];} - elseif (isset($_POST["security"])) {$security=$_POST["security"];} -if (isset($_GET["comments"])) {$comments=$_GET["comments"];} - elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK REMOTE INBOUND: Popup - - -
- - 0) -{ - - $stmt="DELETE from parked_channels where server_ip='$user_server_ip' and parked_time='" . mysql_real_escape_string($parked_time) . "' and channel='" . mysql_real_escape_string($channel) . "' LIMIT 1"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; - - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$user_server_ip','','Redirect','$DTqueryCID','Exten: $dialplan_number','Channel: " . mysql_real_escape_string($channel) . "','Context: $ext_context','Priority: 1','Callerid: $DTqueryCID','','','','','')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for channel $channel       $NOW_TIME\n

\n"; - - - $url = 'https://10.10.10.15/internal/back_end_systems/cust_serv/index.php?Search=SEARCH&'; - $Suser = 'username='; - $Spass = '&passwd='; - $Sphone = '&phone='; - - $newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW$Sphone$phone"; - if ( ($phone == 'unknown') or (strlen($phone)<9) ) - {$newurl = "$url$Suser$PHP_AUTH_USER$Spass$PHP_AUTH_PW";} - - echo "Look up this customer in Customer Service System\n

\n"; - - echo "Close this window\n

\n"; -} -else -{ - echo "Redirect command FAILED for channel $channel       $NOW_TIME\n

\n"; - echo "Close this window\n

\n"; -} - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/astguiclient_web/phone_stats.php b/astguiclient_web/phone_stats.php deleted file mode 100644 index e1ff62d0..00000000 --- a/astguiclient_web/phone_stats.php +++ /dev/null @@ -1,244 +0,0 @@ - LICENSE: GPLv2 -# -# -# changes: -# 60620-1333 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} -if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} - elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["extension"])) {$extension=$_GET["extension"];} - elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["full_name"])) {$full_name=$_GET["full_name"];} - elseif (isset($_POST["full_name"])) {$full_name=$_POST["full_name"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$admin_page = './admin.php'; - -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status='ADMIN';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname from phones where server_ip='$server_ip' and extension='$extension'"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $row[0]; - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -?> - - -ASTERISK ADMIN: Phone Stats - - -
-
- - - - - - -\n"; -echo "
  ASTERISK ADMIN: Administration  
  LIST ALL PHONES | ADD A NEW PHONE | SEARCH FOR A PHONE | ADD A SERVER | LIST ALL SERVERS
  SHOW ALL CONFERENCES | ADD A NEW CONFERENCE
  \n"; - -echo "\n"; -echo "\n"; -echo "\n"; -echo " to \n"; -echo "  \n"; -echo "\n"; - - -echo "           $user - $full_name\n"; - -echo "
\n"; - - - $stmt="SELECT count(*),channel_group, sum(length_in_sec) from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by channel_group order by channel_group"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - -echo "
\n"; - -echo "CALL TIME AND CHANNELS:\n"; - -echo "
\n"; -echo "\n"; - - $total_calls=0; - $o=0; - while ($statuses_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_seconds = $row[2]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} - - echo ""; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $row[0]); - - $call_seconds=0; - $o++; - } - - $stmt="SELECT sum(length_in_sec) from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; - $rslt=mysql_query($stmt, $link); - $counts_to_print = mysql_num_rows($rslt); - $row=mysql_fetch_row($rslt); - $call_seconds = $row[0]; - $call_hours = ($call_seconds / 3600); - $call_hours = round($call_hours, 2); - $call_hours_int = intval("$call_hours"); - $call_minutes = ($call_hours - $call_hours_int); - $call_minutes = ($call_minutes * 60); - $call_minutes_int = round($call_minutes, 0); - if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";} -# echo "|$stmt|\n"; - -echo "\n"; -echo "
CHANNEL GROUP COUNT HOURS:MINUTES
$row[1] $row[0] $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
\n"; -echo "

\n"; - -echo "
\n"; - -echo "LAST 1000 CALLS FOR DATE RANGE:\n"; -echo "\n"; -echo "\n"; - - $stmt="SELECT number_dialed,channel_group,start_time,length_in_min from call_log where extension='" . mysql_real_escape_string($extension) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' LIMIT 1000"; - $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); -# echo "|$stmt|\n"; - - $total_calls=0; - $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - - - $call_seconds=0; - $o++; - } - - -echo "
NUMBER CHANNEL GROUP DATE LENGTH(MIN.)
$row[0] $row[1] $row[2] $row[3]
\n"; - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/astguiclient_web/remote_inbound.php b/astguiclient_web/remote_inbound.php deleted file mode 100644 index 605fe83a..00000000 --- a/astguiclient_web/remote_inbound.php +++ /dev/null @@ -1,169 +0,0 @@ - LICENSE: GPLv2 -### -# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) -# -# changes: -# 60620-1343 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$popup_page = './inbound_popup.php'; - - $stmt="SELECT count(*) from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and active = 'Y' and status IN('ACTIVE','ADMIN');"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT fullname,dialplan_number from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - ##### get server listing for dynamic pulldown - $stmt="SELECT fullname,dialplan_number,server_ip from phones where login='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - if ($DB) {echo "$stmt\n";} - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $fullname = $rowx[0]; - $dialplan_number = $rowx[1]; - $user_server_ip = $rowx[2]; - if ($DB) {echo "|$rowx[0]|$rowx[1]|$rowx[2]|\n";} - } - else - { - fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - - echo"\n"; - echo"ASTERISK REMOTE INBOUND: Main\n"; - echo"\n"; - echo"\n"; - echo"\n"; - -?> - - -
- -
\n"; - -echo "Click on the channel below that you would like to have directed to your phone

\n"; - -echo "
\n";
-echo "CHANNEL    SERVER        CHANNEL_GROUP   EXTENSION    PARKED_BY            PARKED_TIME        \n";
-echo "----------------------------------------------------------------------------------------------\n";
-
-
-
-
-
-$stmt="SELECT count(*) from parked_channels where server_ip='$user_server_ip' order by parked_time";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$parked_count = $row[0];
-	if ($parked_count > 0)
-	{
-	$stmt="SELECT * from parked_channels where server_ip='$user_server_ip' and channel_group LIKE \"IN_%\" order by parked_time";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$parked_to_print = mysql_num_rows($rslt);
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		$channel =			sprintf("%-11s", $row[0]);
-		$server =			sprintf("%-14s", $row[1]);
-		$channel_group =	sprintf("%-16s", $row[2]);
-		$extension =		sprintf("%-13s", $row[3]);
-		$parked_by =		sprintf("%-21s", $row[4]);
-		$parked_time =		sprintf("%-19s", $row[5]);
-
-		echo "$channel$server$channel_group$extension$parked_by$parked_time\n";
-
-		$i++;
-		}
-
-	}
-	else
-	{
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "*************************************** NO PARKED CALLS **************************************\n";
-	echo "**********************************************************************************************\n";
-	echo "**********************************************************************************************\n";
-	}
-
-
-$ENDtime = date("U");
-
-$RUNtime = ($ENDtime - $STARTtime);
-
-echo "
\n\n\n


\n\n"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/astguiclient_web/test.php b/astguiclient_web/test.php deleted file mode 100644 index 62f8277b..00000000 --- a/astguiclient_web/test.php +++ /dev/null @@ -1,30 +0,0 @@ - LICENSE: GPLv2 -### - -$STARTtime = date("U"); -$STARTdate = date("Y-m-d H:i:s"); - - -$link=mysql_connect("localhost", "cron", "1234"); -mysql_select_db("asterisk"); - - $stmt="SELECT * from phones;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - print "|$auth|\n"; - -exit; - - - -?> - - - - - diff --git a/libs/AST_VICI_conf.pl.bak b/libs/AST_VICI_conf.pl.bak deleted file mode 100644 index c4039f2b..00000000 --- a/libs/AST_VICI_conf.pl.bak +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/perl - -### AST_VICI_conf.pl -### -### Copyright (C) 2006 Matt Florell LICENSE: GPLv2 -### - -### Customized Variables -$SIP_user = 'SIP/cc100'; # your phone id -$server_ip = '10.10.10.15'; # Asterisk server IP -$DB_server = '10.10.10.15'; # MySQL server IP -$DB_database = 'asterisk'; # MySQL database name -$DB_user = 'idcheck'; # MySQL user -$DB_pass = '1234'; # MySQL pass -$DB_port = '3306'; # MySQL connection port - -### Constants -$record_channel=''; -$filename=''; -$recording_id=''; -$US = '_'; -$MT[0] = ''; - -return 1; - - -# this subroutine is to be used with the callerID function to customize the -# variables that are passed in the URL string and the way that they are passed, -# these are the variables you have to work with: -# $callerID_areacode -# $callerID_prefix -# $callerID_last4 -# $callerID_Time -# $callerID_Channel -# $callerID_uniqueID -# $callerID_phone_ext -# $callerID_server_ip -# $callerID_extension -# $callerID_inbound_number -# $callerID_comment_a -# $callerID_comment_b -# $callerID_comment_c -# $callerID_comment_d -# $callerID_comment_e - -sub create_callerID_local_query_string -{ -$local_web_callerID_QUERY_STRING =''; -$local_web_callerID_QUERY_STRING.="?callerID_areacode=$callerID_areacode"; -$local_web_callerID_QUERY_STRING.="&callerID_prefix=$callerID_prefix"; -$local_web_callerID_QUERY_STRING.="&callerID_last4=$callerID_last4"; -$local_web_callerID_QUERY_STRING.="&callerID_Time=$callerID_Time"; -$local_web_callerID_QUERY_STRING.="&callerID_Channel=$callerID_Channel"; -$local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$callerID_uniqueID"; -$local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$callerID_phone_ext"; -$local_web_callerID_QUERY_STRING.="&callerID_server_ip=$callerID_server_ip"; -$local_web_callerID_QUERY_STRING.="&callerID_extension=$callerID_extension"; -$local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$callerID_inbound_number"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_a=$callerID_comment_a"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_b=$callerID_comment_b"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_c=$callerID_comment_c"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_d=$callerID_comment_d"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_e=$callerID_comment_e"; -} - -# $lead_id -# $vendor_id -# $list_id -# $phone_code -# $phone_number -# $title -# $first_name -# $middle_initial -# $last_name -# $address1 -# $address2 -# $address3 -# $city -# $state -# $province -# $postal_code -# $country_code -# $gender -# $date_of_birth -# $alt_phone -# $email -# $security -# $comments -# $user -# $pass -# $fronter -# $closer -# $campaign -# $group -# $SQLdate -# $epoch -# $uniqueid -# $customer_zap_channel -# $server_ip -# $SIPexten - -sub create_VICIDIAL_query_string -{ -$VICIDIAL_web_QUERY_STRING =''; -$VICIDIAL_web_QUERY_STRING.="?lead_id=$lead_id"; -$VICIDIAL_web_QUERY_STRING.="&vendor_id=$vendor_id"; -$VICIDIAL_web_QUERY_STRING.="&list_id=$list_id"; -$VICIDIAL_web_QUERY_STRING.="&phone_code=$phone_code"; -$VICIDIAL_web_QUERY_STRING.="&phone_number=$phone_number"; -$VICIDIAL_web_QUERY_STRING.="&title=$title"; -$VICIDIAL_web_QUERY_STRING.="&first_name=$first_name"; -$VICIDIAL_web_QUERY_STRING.="&middle_initial=$middle_initial"; -$VICIDIAL_web_QUERY_STRING.="&last_name=$last_name"; -$VICIDIAL_web_QUERY_STRING.="&address1=$address1"; -$VICIDIAL_web_QUERY_STRING.="&address2=$address2"; -$VICIDIAL_web_QUERY_STRING.="&address3=$address3"; -$VICIDIAL_web_QUERY_STRING.="&city=$city"; -$VICIDIAL_web_QUERY_STRING.="&state=$state"; -$VICIDIAL_web_QUERY_STRING.="&province=$province"; -$VICIDIAL_web_QUERY_STRING.="&postal_code=$postal_code"; -$VICIDIAL_web_QUERY_STRING.="&country_code=$country_code"; -$VICIDIAL_web_QUERY_STRING.="&gender=$gender"; -$VICIDIAL_web_QUERY_STRING.="&date_of_birth=$date_of_birth"; -$VICIDIAL_web_QUERY_STRING.="&alt_phone=$alt_phone"; -$VICIDIAL_web_QUERY_STRING.="&email=$email"; -$VICIDIAL_web_QUERY_STRING.="&security=$security"; -$VICIDIAL_web_QUERY_STRING.="&comments=$comments"; -$VICIDIAL_web_QUERY_STRING.="&user=$user"; -$VICIDIAL_web_QUERY_STRING.="&pass=$userpass"; -$VICIDIAL_web_QUERY_STRING.="&fronter=$fronter"; -$VICIDIAL_web_QUERY_STRING.="&closer=$user"; -$VICIDIAL_web_QUERY_STRING.="&campaign=$campaign"; -$VICIDIAL_web_QUERY_STRING.="&group=$group"; -$VICIDIAL_web_QUERY_STRING.="&channel_group=$channel_group"; -$VICIDIAL_web_QUERY_STRING.="&SQLdate=$SQLdate"; -$VICIDIAL_web_QUERY_STRING.="&epoch=$secX"; -$VICIDIAL_web_QUERY_STRING.="&uniqueid=$uniqueid"; -$VICIDIAL_web_QUERY_STRING.="&customer_zap_channel=$customer_zap_channel"; -$VICIDIAL_web_QUERY_STRING.="&server_ip=$server_ip"; -$VICIDIAL_web_QUERY_STRING.="&SIPexten=$SIPexten"; -$VICIDIAL_web_QUERY_STRING.="&session_id=$session_id"; -$VICIDIAL_web_QUERY_STRING.="&phone=$phone_number"; -$VICIDIAL_web_QUERY_STRING.="&parked_by=$lead_id"; -$VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; -$VICIDIAL_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; -} \ No newline at end of file diff --git a/libs/AUS_zipcode_ranges.txt b/libs/AUS_zipcode_ranges.txt deleted file mode 100644 index af434eb0..00000000 --- a/libs/AUS_zipcode_ranges.txt +++ /dev/null @@ -1,14 +0,0 @@ -ACT|0200|0399 -NT|0800|0999 -NSW|1000|2599 -ACT|2600|2618 -NSW|2619|2899 -ACT|2900|2920 -NSW|2921|2999 -VIC|3000|3999 -QLD|4000|4999 -SA|5000|5999 -WA|6000|6999 -TAS|7000|7999 -VIC|8000|8999 -QLD|9000|9999 \ No newline at end of file diff --git a/libs/Asterisk.pm b/libs/Asterisk.pm deleted file mode 100644 index 15ecd4a8..00000000 --- a/libs/Asterisk.pm +++ /dev/null @@ -1,20 +0,0 @@ -package Asterisk; - -require 5.004; - -$VERSION = '0.08'; - -sub version { $VERSION; } - -sub new { - my ($class, %args) = @_; - my $self = {}; - $self->{configfile} = undef; - $self->{config} = {}; - bless $self, ref $class || $class; - return $self; -} - -sub DESTROY { } - -1; diff --git a/libs/Asterisk/AGI.pm b/libs/Asterisk/AGI.pm deleted file mode 100644 index b1680ea6..00000000 --- a/libs/Asterisk/AGI.pm +++ /dev/null @@ -1,685 +0,0 @@ -package Asterisk::AGI; - -require 5.004; - -use Asterisk; - -@ISA = ( 'Asterisk' ); - -=head1 NAME - -Asterisk::AGI - Simple Asterisk Gateway Interface Class - -=head1 SYNOPSIS - -use Asterisk::AGI; - -$AGI = new Asterisk::AGI; - -# pull AGI variables into %input - - %input = $AGI->ReadParse(); - -# say the number 1984 - - $AGI->say_number(1984); - -=head1 DESCRIPTION - -This module should make it easier to write scripts that interact with the -asterisk open source pbx via AGI (asterisk gateway interface) - -=head1 AGI COMMANDS - -=cut - -sub new { - my ($class, %args) = @_; - my $self = {}; - $self->{'callback'} = undef; - $self->{'status'} = undef; - $self->{'lastresponse'} = undef; - bless $self, ref $class || $class; - return $self; -} - -sub ReadParse { - my ($self, $fh) = @_; - - my %input = (); - - $fh = \*STDIN if (!$fh); - - while (<$fh>) { - chomp; - last unless length($_); - if (/^agi_(\w+)\:\s+(.*)$/) { - $input{$1} = $2; - } - } - - - if (defined($DEBUG)&&($DEBUG>0)) { - print STDERR "AGI Environment Dump:\n"; - foreach $i (sort keys %input) { - print STDERR " -- $i = $input{$i}\n"; - } - } - - return %input; -} - -sub setcallback { - my ($self, $function) = @_; - - if (defined($function) && ref($function) eq 'CODE') { - $self->{'callback'} = $function; - } -} - -sub callback { - my ($self, $result) = @_; - - if (defined($self->{'callback'}) && ref($self->{'callback'}) eq 'CODE') { - &{$self->{'callback'}}($result); - } -} - -sub execute { - my ($self, $command) = @_; - - $self->_execcommand($command); - my $res = $self->_readresponse(); - - return $self->_checkresult($res); -} - -sub _execcommand { - my ($self, $command, $fh) = @_; - - $fh = \*STDOUT if (!$fh); - - select ((select ($fh), $| = 1)[0]); - - return -1 if (!defined($command)); - - return print $fh "$command\n"; -} - -sub _readresponse { - my ($self, $fh) = @_; - - my $response = undef; - $fh = \*STDIN if (!$fh); - $response = <$fh> || return '200 result=-1 (noresponse)'; - chomp($response); - return $response; -} - -sub _checkresult { - my ($self, $response) = @_; - - return undef if (!defined($response)); - my $result = undef; - - $self->_lastresponse($response); - if ($response =~ /^200/) { - if ($response =~ /result=(-?[\d*#]+)/) { - $result = $1; - } - } elsif ($response =~ /\(noresponse\)/) { - $self->_status('noresponse'); - } else { - print STDERR "Unexpected result '$response'\n" if (defined($DEBUG) && $DEBUG); - } - print STDERR "_checkresult($response) = $result\n" if (defined($DEBUG) && $DEBUG>3); - - return $result; -} - -sub _status { - my ($self, $status) = @_; - - if (defined($status)) { - $self->{'status'} = $status; - } else { - return $self->{'status'}; - } -} - -sub _lastresponse { - my ($self, $response) = @_; - - if (defined($response)) { - $self->{'lastresponse'} = $response; - } else { - return $self->{'lastresponse'}; - } -} - -=over 4 - -=item $AGI->stream_file($filename, $digits) - -Executes AGI Command "STREAM FILE $filename $digits" - -This command instructs Asterisk to play the given sound file and listen for the given dtmf digits. The -fileextension must not be used in the filename because Asterisk will find the most appropriate file -type. - -Example: $AGI->stream_file('demo-echotest', '0123'); - -Returns: -1 on error or hangup, -0 if playback completes without a digit being pressed, -or the ASCII numerical value of the digit if a digit was pressed - -=cut - -sub stream_file { - my ($self, $filename, $digits) = @_; - - my $ret = 0; - - $digits = '""' if (!defined($digits)); - - return -1 if (!defined($filename)); - $ret = $self->execute("STREAM FILE $filename $digits"); - - $self->callback($ret) if ($ret == -1); - - return $ret; -} - -=item $AGI->send_text($text) - -Executes AGI Command "SEND TEXT "$text" - -Sends the given text on a channel. Most channels do not support the transmission of text. - -Example: $AGI->send_text('You've got mail!'); - -Returns: -1 on error or hangup, -0 if the text was sent or if the channel does not support text transmission. - -=cut - -sub send_text { - my ($self, $text) = @_; - - my $ret = 0; - - return $ret if (!defined($text)); - $ret = $self->execute("SEND TEXT \"$text\""); - $self->callback($ret) if ($ret == -1); - - return $ret; -} - -=item $AGI->send_image($image) - -Executes AGI Command "SEND IMAGE $image - -Sends the given image on a channel. Most channels do not support the transmission of images. - -Example: $AGI->send_image('image.png'); - -Returns: -1 on error or hangup, -0 if the image was sent or if the channel does not support image transmission. - -=cut - -sub send_image { - my ($self, $image) = @_; - - my $ret = 0; - return -1 if (!defined($image)); - - $ret = $self->execute("SEND IMAGE $image"); - $self->callback($ret) if ($ret == -1); - - return $ret; -} - -=item $AGI->say_number($number, $digits) - -Executes AGI Command "SAY NUMBER $number $digits" - -Says the given $number, returning early if any of the $digits are received. - -Example: $AGI->say_number('98765'); - -Returns: -1 on error or hangup, -0 if playback completes without a digit being pressed, -or the ASCII numerical value of the digit of one was pressed. - -=cut - -sub say_number { - my ($self, $number, $digits) = @_; - - my $ret = 0; - - $digits = '""' if (!defined($digits)); - - return -1 if (!defined($number)); - $number =~ s/\D//g; - $ret = $self->execute("SAY NUMBER $number $digits"); - - $self->callback($ret) if ($ret == -1); - - return $ret; -} - -=item $AGI->say_digits($number, $digits) - -Executes AGI Command "SAY DIGITS $number $digits" - -Says the given digit string $number, returning early if any of the $digits are received. - -Example: $AGI->say_digits('8675309'); - -Returns: -1 on error or hangup, -0 if playback completes without a digit being pressed, -or the ASCII numerical value of the digit of one was pressed. - -=cut - -sub say_digits { - my ($self, $number, $digits) = @_; - - my $ret = 0; - $digits = '""' if (!defined($digits)); - - return -1 if (!defined($number)); - $number =~ s/\D//g; - $ret = $self->execute("SAY DIGITS $number $digits"); - $self->callback($ret) if ($ret == -1); - - return $ret; -} - -=item $AGI->answer() - -Executes AGI Command "ANSWER" - -Answers channel if not already in answer state - -Example: $AGI->answer(); - -Returns: -1 on channel failure, or -0 if successful - -=cut - -sub answer { - my ($self) = @_; - - my $ret = 0; - $ret = $self->execute('ANSWER'); - $self->callback($ret) if ($ret == -1); - - return $ret; - -} - -=item $AGI->get_data($filename, $timeout, $maxdigits) - -Executes AGI Command "GET DATA $filename $timeout $maxdigits" - -Streams $filename and returns when $maxdigits have been received or -when $timeout has been reached. Timeout is specified in ms - -Example: $AGI->get_data('demo-welcome', 15000, 5); - -=cut - -sub get_data { - my ($self, $filename, $timeout, $maxdigits) = @_; - - my $ret = undef; - - return -1 if (!defined($filename)); - $ret = $self->execute("GET DATA $filename $timeout $maxdigits"); - $self->callback($ret) if ($ret == -1); - - return $ret; -} - -=item $AGI->set_callerid($number) - -Executes AGI Command "SET CALLERID $number" - -Changes the callerid of the current channel to - -Example: $AGI->set_callerid('9995551212'); - -Returns: Always returns 1 - -=cut - -sub set_callerid { - my ($self, $number) = @_; - - return if (!defined($number)); - return $self->execute("SET CALLERID $number"); -} - -=item $AGI->set_context($context) - -Executes AGI Command "SET CONTEXT $context" - -Changes the context for continuation upon exiting the agi application - -Example: $AGI->set_context('dialout'); - -Returns: Always returns 0 - -=cut - -sub set_context { - my ($self, $context) = @_; - - return -1 if (!defined($context)); - return $self->execute("SET CONTEXT $context"); -} - -=item $AGI->set_extension($extension) - -Executes AGI Command "SET EXTENSION $extension" - -Changes the extension for continuation upon exiting the agi application - -Example: $AGI->set_extension('7'); - -Returns: Always returns 0 - -=cut - -sub set_extension { - my ($self, $extension) = @_; - - return -1 if (!defined($extension)); - return $self->execute("SET EXTENSION $extension"); -} - -=item $AGI->set_priority($priority) - -Executes AGI Command "SET PRIORITY $priority" - -Changes the priority for continuation upon exiting the agi application - -Example: $AGI->set_priority(1); - -Returns: Always returns 0 - -=cut - -sub set_priority { - my ($self, $priority) = @_; - - return -1 if (!defined($priority)); - return $self->execute("SET PRIORITY $priority"); -} - -sub receive_char { - my ($self, $timeout) = @_; - - my $ret = 0; -#wait forever if timeout is not set. is this the prefered default? - $timeout = 0 if (!defined($timeout)); - $ret = $self->execute("RECEIVE CHAR $timeout"); - $self->callback($ret) if ($ret == -1); - - return $ret; - -} - -sub tdd_mode { - my ($self, $mode) = @_; - - return 0 if (!defined($mode)); - return $self->execute("TDD MODE $mode"); -} - - -sub wait_for_digit { - my ($self, $timeout) = @_; - - my $ret = 0; - $timeout = -1 if (!defined($timeout)); - $ret = $self->execute("WAIT FOR DIGIT $timeout"); - - $self->callback($ret) if ($ret == -1); - - return $ret; -} - -sub record_file { - my ($self, $filename, $format, $digits, $timeout, $beep) = @_; - - my $ret = 0; - - return -1 if (!defined($filename)); - $digits = '""' if (!defined($digits)); - $ret = $self->execute("RECORD FILE $filename $format $digits $timeout"); - - $self->callback($ret) if ($ret == -1); - - return $ret; -} - -sub set_autohangup { - my ($self, $time) = @_; - - $time = 0 if (!defined($time)); - return $self->execute("SET AUTOHANGUP $time"); -} - -=item $AGI->hangup($channel) - -Executes AGI Command "HANGUP $channel" - -Hangs up the passed $channel, or the current channel if $channel is not passed. -It is left to the AGI script to exit properly, otherwise you could end up with zombies. - -Example: $AGI->hangup(); - -Returns: Always returns 1 - -=cut - -sub hangup { - my ($self, $channel) = @_; - - if ($channel) { - return $self->execute("HANGUP $channel"); - } else { - return $self->execute("HANGUP"); - } -} - -=item $AGI->exec($app, $options) - -Executes AGI Command "EXEC $app $options" - -The most powerful AGI command. Executes the given application passing the given options. - -Example: $AGI->exec('Dial', 'Zap/g2/8005551212'); - -Returns: -2 on failure to find application, or -whatever the given application returns - -=cut - -sub exec { - my ($self, $app, $options) = @_; - return -1 if (!defined($app)); - $options = '""' if (!defined($options)); - return $self->execute("EXEC $app $options"); -} - -sub channel_status { - my ($self, $channel) = @_; - - return $self->execute("CHANNEL STATUS $channel"); -} - -=item $AGI->set_variable($variable, $value) - -Executes AGI Command "SET VARIABLE $variable $value" - -Sets the channel variable to - -Example: $AGI->set_variable('status', 'authorized'); - -Returns: Always returns 1 - -=cut - -sub set_variable { - my ($self, $variable, $value) = @_; - - return $self->execute("SET VARIABLE $variable $value"); -} - -=item $AGI->get_variable($variable) - -Executes AGI Command "GET VARIABLE $variablename" - -Gets the channel variable - -Example: $AGI->get_variable('status'); - -Returns: The value of the variable, or undef if variable does not exist - -=cut - -sub get_variable { - my ($self, $variable) = @_; - - my $result = undef; - - if ($self->execute("GET VARIABLE $variable")) { - my $tempresult = $self->_lastresponse(); - if ($tempresult =~ /\((.*)\)/) { - $result = $1; - } - } - return $result; -} - -=item $AGI->verbose($message, $level) - -Executes AGI Command "VERBOSE $message $level" - -Logs $message with verboselevel $level - -Example: $AGI->verbose("System Crashed\n", 1); - -Returns: Always returns 1 - -=cut - - -sub verbose { - my ($self, $message, $level) = @_; - - return $self->execute("VERBOSE \"$message\" $level"); -} - -=item $AGI->database_get($family, $key) - -Executes AGI Command "DATABASE GET $family $key" - -Example: $var = $AGI->database_get('test', 'status'); - -Returns: The value of the variable, or undef if variable does not exist - -=cut - -sub database_get { - my ($self, $family, $key) = @_; - - my $result = undef; - - if ($self->execute("DATABASE GET $family $key")) { - my $tempresult = $self->_lastresponse(); - if ($tempresult =~ /\((.*)\)/) { - $result = $1; - } - } - return $result; -} - -=item $AGI->database_put($family, $key, $value) - -Executes AGI Command "DATABASE PUT $family $key $value" - -Set/modifes database entry / to - -Example: $AGI->database_put('test', 'status', 'authorized'); - -Returns: 1 on success, 0 otherwise - -=cut - -sub database_put { - my ($self, $family, $key, $value) = @_; - - return $self->execute("DATABASE PUT $family $key $value"); -} - -=item $AGI->database_del($family, $key) - -Executes AGI Command "DATABASE DEL $family $key" - -Removes database entry / - -Example: $AGI->database_del('test', 'status'); - -Returns: 1 on success, 0 otherwise - -=cut - -sub database_del { - my ($self, $family, $key) = @_; - - return $self->execute("DATABASE DEL $family $key"); -} - -=item $AGI->database_deltree($family, $key) - -Executes AGI Command "DATABASE DELTREE $family $key" - -Deletes a family or specific keytree within a family in the Asterisk database - -Example: $AGI->database_deltree('test', 'status'); -Example: $AGI->database_deltree('test'); - -Returns: 1 on success, 0 otherwise - -=cut - -sub database_deltree { - my ($self, $family, $key) = @_; - - return $self->execute("DATABASE DELTREE $family $key"); -} - -sub noop { - my ($self) = @_; - - return $self->execute("NOOP"); -} - -sub set_music { - my ($self, $mode, $class) = @_; - - return $self->execute("SET MUSIC $mode $class"); -} - -1; - -__END__ - -=back diff --git a/libs/Asterisk/DONOTUSE_AST_VICI_conf.pl b/libs/Asterisk/DONOTUSE_AST_VICI_conf.pl deleted file mode 100644 index c4039f2b..00000000 --- a/libs/Asterisk/DONOTUSE_AST_VICI_conf.pl +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/perl - -### AST_VICI_conf.pl -### -### Copyright (C) 2006 Matt Florell LICENSE: GPLv2 -### - -### Customized Variables -$SIP_user = 'SIP/cc100'; # your phone id -$server_ip = '10.10.10.15'; # Asterisk server IP -$DB_server = '10.10.10.15'; # MySQL server IP -$DB_database = 'asterisk'; # MySQL database name -$DB_user = 'idcheck'; # MySQL user -$DB_pass = '1234'; # MySQL pass -$DB_port = '3306'; # MySQL connection port - -### Constants -$record_channel=''; -$filename=''; -$recording_id=''; -$US = '_'; -$MT[0] = ''; - -return 1; - - -# this subroutine is to be used with the callerID function to customize the -# variables that are passed in the URL string and the way that they are passed, -# these are the variables you have to work with: -# $callerID_areacode -# $callerID_prefix -# $callerID_last4 -# $callerID_Time -# $callerID_Channel -# $callerID_uniqueID -# $callerID_phone_ext -# $callerID_server_ip -# $callerID_extension -# $callerID_inbound_number -# $callerID_comment_a -# $callerID_comment_b -# $callerID_comment_c -# $callerID_comment_d -# $callerID_comment_e - -sub create_callerID_local_query_string -{ -$local_web_callerID_QUERY_STRING =''; -$local_web_callerID_QUERY_STRING.="?callerID_areacode=$callerID_areacode"; -$local_web_callerID_QUERY_STRING.="&callerID_prefix=$callerID_prefix"; -$local_web_callerID_QUERY_STRING.="&callerID_last4=$callerID_last4"; -$local_web_callerID_QUERY_STRING.="&callerID_Time=$callerID_Time"; -$local_web_callerID_QUERY_STRING.="&callerID_Channel=$callerID_Channel"; -$local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$callerID_uniqueID"; -$local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$callerID_phone_ext"; -$local_web_callerID_QUERY_STRING.="&callerID_server_ip=$callerID_server_ip"; -$local_web_callerID_QUERY_STRING.="&callerID_extension=$callerID_extension"; -$local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$callerID_inbound_number"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_a=$callerID_comment_a"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_b=$callerID_comment_b"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_c=$callerID_comment_c"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_d=$callerID_comment_d"; -$local_web_callerID_QUERY_STRING.="&callerID_comment_e=$callerID_comment_e"; -} - -# $lead_id -# $vendor_id -# $list_id -# $phone_code -# $phone_number -# $title -# $first_name -# $middle_initial -# $last_name -# $address1 -# $address2 -# $address3 -# $city -# $state -# $province -# $postal_code -# $country_code -# $gender -# $date_of_birth -# $alt_phone -# $email -# $security -# $comments -# $user -# $pass -# $fronter -# $closer -# $campaign -# $group -# $SQLdate -# $epoch -# $uniqueid -# $customer_zap_channel -# $server_ip -# $SIPexten - -sub create_VICIDIAL_query_string -{ -$VICIDIAL_web_QUERY_STRING =''; -$VICIDIAL_web_QUERY_STRING.="?lead_id=$lead_id"; -$VICIDIAL_web_QUERY_STRING.="&vendor_id=$vendor_id"; -$VICIDIAL_web_QUERY_STRING.="&list_id=$list_id"; -$VICIDIAL_web_QUERY_STRING.="&phone_code=$phone_code"; -$VICIDIAL_web_QUERY_STRING.="&phone_number=$phone_number"; -$VICIDIAL_web_QUERY_STRING.="&title=$title"; -$VICIDIAL_web_QUERY_STRING.="&first_name=$first_name"; -$VICIDIAL_web_QUERY_STRING.="&middle_initial=$middle_initial"; -$VICIDIAL_web_QUERY_STRING.="&last_name=$last_name"; -$VICIDIAL_web_QUERY_STRING.="&address1=$address1"; -$VICIDIAL_web_QUERY_STRING.="&address2=$address2"; -$VICIDIAL_web_QUERY_STRING.="&address3=$address3"; -$VICIDIAL_web_QUERY_STRING.="&city=$city"; -$VICIDIAL_web_QUERY_STRING.="&state=$state"; -$VICIDIAL_web_QUERY_STRING.="&province=$province"; -$VICIDIAL_web_QUERY_STRING.="&postal_code=$postal_code"; -$VICIDIAL_web_QUERY_STRING.="&country_code=$country_code"; -$VICIDIAL_web_QUERY_STRING.="&gender=$gender"; -$VICIDIAL_web_QUERY_STRING.="&date_of_birth=$date_of_birth"; -$VICIDIAL_web_QUERY_STRING.="&alt_phone=$alt_phone"; -$VICIDIAL_web_QUERY_STRING.="&email=$email"; -$VICIDIAL_web_QUERY_STRING.="&security=$security"; -$VICIDIAL_web_QUERY_STRING.="&comments=$comments"; -$VICIDIAL_web_QUERY_STRING.="&user=$user"; -$VICIDIAL_web_QUERY_STRING.="&pass=$userpass"; -$VICIDIAL_web_QUERY_STRING.="&fronter=$fronter"; -$VICIDIAL_web_QUERY_STRING.="&closer=$user"; -$VICIDIAL_web_QUERY_STRING.="&campaign=$campaign"; -$VICIDIAL_web_QUERY_STRING.="&group=$group"; -$VICIDIAL_web_QUERY_STRING.="&channel_group=$channel_group"; -$VICIDIAL_web_QUERY_STRING.="&SQLdate=$SQLdate"; -$VICIDIAL_web_QUERY_STRING.="&epoch=$secX"; -$VICIDIAL_web_QUERY_STRING.="&uniqueid=$uniqueid"; -$VICIDIAL_web_QUERY_STRING.="&customer_zap_channel=$customer_zap_channel"; -$VICIDIAL_web_QUERY_STRING.="&server_ip=$server_ip"; -$VICIDIAL_web_QUERY_STRING.="&SIPexten=$SIPexten"; -$VICIDIAL_web_QUERY_STRING.="&session_id=$session_id"; -$VICIDIAL_web_QUERY_STRING.="&phone=$phone_number"; -$VICIDIAL_web_QUERY_STRING.="&parked_by=$lead_id"; -$VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; -$VICIDIAL_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; -} \ No newline at end of file diff --git a/libs/Asterisk/Manager.pm b/libs/Asterisk/Manager.pm deleted file mode 100644 index 69d860a1..00000000 --- a/libs/Asterisk/Manager.pm +++ /dev/null @@ -1,412 +0,0 @@ -package Asterisk::Manager; - -require 5.004; - -use Asterisk; -use IO::Socket; -use Digest::MD5; - -#use strict; -#use warnings; - -=head1 NAME - -Asterisk::Manager - Asterisk Manager Interface - -=head1 SYNOPSIS - -use Asterisk::Manager; - -my $astman = new Asterisk::Manager; - -$astman->user('username'); - -$astman->secret('test'); - -$astman->host('localhost'); - -$astman->connect || die "Could not connect to " . $astman->host . "!\n"; - -$astman->disconnect; - -=head1 DESCRIPTION - -This module provides a simple interface to the asterisk manager interface. - -=cut - -my $EOL = "\r\n"; -my $BLANK = $EOL x 2; - -my $VERSION = '0.01'; - -sub version { $VERSION; } - -sub new { - my ($class, %args) = @_; - - my $self = {}; - $self->{_CONNFD} = undef; - $self->{_PROTOVERS} = undef; - $self->{_ERRORSTR} = undef; - $self->{_HOST} = 'localhost'; - $self->{_PORT} = 5038; - $self->{_USER} = undef; - $self->{_SECRET} = undef; - $self->{_EVENTCB} = {}; - $self->{_DEBUG} = 0; - $self->{_CONNECTED} = 0; - bless $self, ref $class || $class; - return $self; -} - -sub DESTROY { } - -sub user { - my ($self, $user) = @_; - - if ($user) { - $self->{_USER} = $user; - } - - return $self->{_USER}; -} - -sub secret { - my ($self, $secret) = @_; - - if ($secret) { - $self->{_SECRET} = $secret; - } - - return $self->{_SECRET}; -} - -sub host { - my ($self, $host) = @_; - - if ($host) { - $self->{_HOST} = $host; - } - - return $self->{_HOST}; -} - -sub port { - my ($self, $port) = @_; - - if ($port) { - $self->{_PORT} = $port; - } - - return $self->{_PORT}; -} - -sub connected { - my ($self, $connected) = @_; - - if (defined($connected)) { - $self->{_CONNECTED} = $connected; - } - - return $self->{_CONNECTED}; -} - -sub error { - my ($self, $error) = @_; - - if ($error) { - $self->{_ERRORSTR} = $error; - } - - return $self->{_ERRORSTR}; -} - -sub debug { - my ($self, $debug) = @_; - - if ($debug) { - $self->{_DEBUG} = $debug; - } - - return $self->{_DEBUG}; -} - -sub connfd { - my ($self, $connfd) = @_; - - if ($connfd) { - $self->{_CONNFD} = $connfd; - } - - return $self->{_CONNFD}; -} - -sub read_response { - my ($self, $connfd) = @_; - - my @response; - - if (!$connfd) { - $connfd = $self->connfd; - } - - while (my $line = <$connfd>) { - last if ($line eq $EOL); - - if (wantarray) { - $line =~ s/$EOL//g; - push(@response, $line) if $line; - } else { - $response[0] .= $line; - } - - } - - return wantarray ? @response : $response[0]; -} - -sub connect { - my ($self) = @_; - - my $host = $self->host; - my $port = $self->port; - my $user = $self->user; - my $secret = $self->secret; - my %resp; - - my $conn = new IO::Socket::INET( Proto => 'tcp', - PeerAddr => $host, - PeerPort => $port - ); - if (!$conn) { - $self->error("Connection refused ($host:$port)\n"); - return undef; - } - - $conn->autoflush(1); - - my $input = <$conn>; - $input =~ s/$EOL//g; - - my ($manager, $version) = split('/', $input); - - if ($manager !~ /Asterisk Call Manager/) { - return $self->error("Unknown Protocol\n"); - } - - $self->{_PROTOVERS} = $version; - $self->connfd($conn); - - # check if the remote host supports MD5 Challenge authentication - my %authresp = $self->sendcommand( Action => 'Challenge', - AuthType => 'MD5' - ); - - if (($authresp{Response} eq 'Success')) { - # do md5 login - my $md5 = new Digest::MD5; - $md5->add($authresp{Challenge}); - $md5->add($secret); - my $digest = $md5->hexdigest; - %resp = $self->sendcommand( Action => 'Login', - AuthType => 'MD5', - Username => $user, - Key => $digest - ); - } else { - # do plain text login - %resp = $self->sendcommand( Action => 'Login', - Username => $user, - Secret => $secret - ); - - } - - if ( ($resp{Response} ne 'Success') && ($resp{Message} ne 'Authentication accepted') ) { - $self->error("Authentication failed for user $user\n"); - return undef; - } - - $self->connected(1); - - return $conn; -} - -sub astman_h2s { - my ($self, %thash) = @_; - - my $tstring = ''; - - foreach my $key (keys %thash) { - $tstring .= $key . ': ' . $thash{$key} . ${EOL}; - } - - return $tstring; -} - -sub astman_s2h { - my ($self, $tstring) = @_; - - my %thash; - - foreach my $line (split(/$EOL/, $tstring)) { - if ($line =~ /(\w*):\s*(\w*)/) { - $thash{$1} = $2; - } - } - - return %thash; -} - -#$want is how you want the data returned -#$want = 0 (default) returns the results in a hash -#$want = 1 returns the results in a large string -#$want = 2 returns the results in an array -sub sendcommand { - my ($self, %command, $want) = @_; - - if (!defined($want)) { - $want = 0; - } - - my $conn = $self->connfd || return; - my $cstring = $self->astman_h2s(%command); - - $conn->send("$cstring$EOL"); - - if ($want == 1) { - my $response = $self->read_response($conn); - return $response; - } - - my @resp = $self->read_response($conn); - - if ($want == 2) { - return @resp; - } else { - return map { split(': ', $_) } @resp; - } -} - -sub setcallback { - my ($self, $event, $function) = @_; - - if (defined($function) && ref($function) eq 'CODE') { - $self->{_EVENTCB}{$event} = $function; - } -} - -sub eventcallback { - my ($self, %resp) = @_; - - my $callback; - my $event = $resp{Event}; - - return if (!$event); - - if (defined($self->{_EVENTCB}{$event})) { - $callback = $self->{_EVENTCB}{$event}; - } elsif (defined($self->{_EVENTCB}{DEFAULT})) { - $callback = $self->{_EVENTCB}{DEFAULT}; - } else { - return; - } - - return &{$callback}(%resp); -} - -sub eventloop { - my ($self) = @_; - - while (1) { - $self->handleevent; - } -} - -sub handleevent { - my ($self) = @_; - - my %resp = map { split(': ', $_); } $self->read_response; - $self->eventcallback(%resp); - - return %resp; -} - -sub action { - my ($self, $command, $wanthash) = @_; - - return if (!$command); - - my $conn = $self->connfd || return; - - print $conn "Action: $command" . $BLANK; - my @resp = $self->read_response($conn); - - if ($wanthash) { - return map { split(': ', $_) } @resp; - } elsif (wantarray) { - return @resp; - } else { - return $resp[0]; - } -} - -sub command { - my ($self, $command) = @_; - - return if (!$command); - - return $self->sendcommand('Action' => 'Command', - 'Command' => $command, 1 ); -} - -sub monitor { - my ($self, $channel, $file) = @_; - - return if (!$channel); - - return $self->sendcommand('Action' => 'Monitor', - 'Channel' => $channel, - 'File' => $file, 1 ); -} - -sub changemonitor { - my ($self, $channel, $file) = @_; - - return if (!$channel); - - return $self->sendcommand('Action' => 'ChangeMonitor', - 'Channel' => $channel, - 'File' => $file, 1 ); -} - -sub stopmonitor { - my ($self, $channel, $file) = @_; - - return if (!$channel); - - return $self->sendcommand('Action' => 'StopMonitor', - 'Channel' => $channel, - 'File' => $file, 1 ); -} - - -sub disconnect { - my ($self) = @_; - - my $conn = $self->connfd; - - my %resp = $self->sendcommand('Action' => 'Logoff'); - - - if ($resp{Response} eq 'Goodbye') { - $self->{_CONNFD} = undef; - $self->connected(0); - return 1; - } - - return 0; -} - -1; diff --git a/libs/Asterisk/Outgoing.pm b/libs/Asterisk/Outgoing.pm deleted file mode 100644 index 6e128332..00000000 --- a/libs/Asterisk/Outgoing.pm +++ /dev/null @@ -1,110 +0,0 @@ -package Asterisk::Outgoing; - -=head1 NAME - -Asterisk::Outgoing - Create outgoing call queue file - -=head1 SYNOPSIS - -use Asterisk::Outgoing; - -my $out = new Asterisk::Outgoing; - -$out->setvariable('Channel', 'Zap/1/'); - -$out->setvariable('MaxRetries', 0); - -$out->setvariable('RetryTime', 60); - -$out->setvariable('WaitTime', 60); - -$out->setvariable('Application', 'Playback'); - -$out->setvariable('Data', 'beep'); - -$out->create_outgoing; - -=cut - -require 5.004; - -use Fcntl ':flock'; -use Asterisk; -@ISA = ('Asterisk'); - -$VERSION = '0.01'; - -sub new { - my ($class, %args) = @_; - my $self = {}; - $self->{OUTDIR} = '/var/spool/asterisk/outgoing'; - $self->{OUTTIME} = undef; - $self->{OUTVARS} = {}; - $self->{ALLOWEDVARS} = [ 'channel', 'maxretries', 'retrytime', 'waittime', 'context', 'extension', 'priority', 'application', 'data', 'callerid' ]; - bless $self, ref $class || $class; - return $self; -} - -sub outdir { - my ($self, $dir) = @_; - - if (defined($dir)) { - $self->{OUTDIR} = $dir; - } - - return $self->{OUTDIR}; -} - -sub outtime { - my ($self, $time) = @_; - - if (defined($time)) { - $self->{OUTTIME} = $time; - } elsif (!defined($self->{OUTTIME})) { - $self->{OUTTIME} = time(); - } - - return $self->{OUTTIME}; -} - -sub checkvariable { - my ($self, $var) = @_; - - my $ret = 0; - - foreach $allowed (@{$self->{ALLOWEDVARS}}) { - if ($allowed =~ /$var/i) { - $ret = 1; - } - } - return $ret; -} - -sub setvariable { - my ($self, $var, $value) = @_; - - if ($self->checkvariable($var)) { - $self->{OUTVARS}{$var} = $value; - } -} - -sub create_outgoing { - my ($self) = @_; - - my $time = $self->outtime(); - - my $outdir = $self->outdir(); - my $filename = $outdir . '/' . $time . '.outgoing'; - open(OUTFILE, ">$filename") || return 0; - flock(OUTFILE, LOCK_EX); - utime($time, $time, $filename); - foreach my $var (keys %{$self->{OUTVARS}}) { - print OUTFILE "$var: " . $self->{OUTVARS}{$var} . "\n"; - } - flock(OUTFILE, LOCK_UN); - close(OUTFILE); - utime($time, $time, $filename); - return 1; -} - -1; diff --git a/libs/Asterisk/QCall.pm b/libs/Asterisk/QCall.pm deleted file mode 100644 index 25f75a9c..00000000 --- a/libs/Asterisk/QCall.pm +++ /dev/null @@ -1,61 +0,0 @@ -package Asterisk::QCall; - -require 5.004; - -use Fcntl ':flock'; -use Asterisk; - -$VERSION = '0.01'; - -sub version { $VERSION; } - -sub new { - my ($class, %args) = @_; - my $self = {}; - $self->{QUEUEDIR} = '/var/spool/asterisk/qcall'; - $self->{QUEUETIME} = undef; - bless $self, ref $class || $class; - return $self; -} - -sub DESTROY { } - -sub queuedir { - my ($self, $dir) = @_; - - if (defined($dir)) { - $self->{QUEUEDIR} = $dir; - } - - return $self->{QUEUEDIR}; -} - -sub queuetime { - my ($self, $time) = @_; - - if (defined($time)) { - $self->{QUEUETIME} = $time; - } elsif (!defined($self->{QUEUETIME})) { - $self->{QUEUETIME} = time(); - } - - return $self->{QUEUETIME}; -} - -sub create_qcall { - my ($self, $dialstring, $callerid, $extension, $maxsecs, $identifier, $response) = @_; - - my $time = $self->queuetime(); - - my $queuedir = $self->queuedir(); - my $filename = $queuedir . '/' . $time . '.queue'; - open(QFILE, ">$filename") || return 0; - flock(QFILE, LOCK_EX); - print QFILE "$dialstring $callerid $extension $maxsecs $identifier $response"; - flock(QFILE, LOCK_UN); - close(QFILE); - my $ret = utime($time, $time, $filename); - return 1; -} - -1; diff --git a/libs/Asterisk/Voicemail.pm b/libs/Asterisk/Voicemail.pm deleted file mode 100644 index 780cef56..00000000 --- a/libs/Asterisk/Voicemail.pm +++ /dev/null @@ -1,261 +0,0 @@ -package Asterisk::Voicemail; - -require 5.004; - -=head1 NAME - -Asterisk::Voicemail - Stuff to deal with asterisk voicemail - -=head1 SYNOPSIS - -This is not completed yet - -=head1 DESCRIPTION - -description - -=cut - -use Asterisk; - -@ISA = ( 'Asterisk' ); - -$VERSION = '0.01'; - -$DEBUG = 5; - -sub version { $VERSION; } - -sub new { - my ($class, %args) = @_; - my $self = {}; - bless $self, ref $class || $class; -# while (my ($key,$value) = each %args) { $self->set($key,$value); } - return $self; -} - -sub DESTROY { } - -sub spooldirectory { - my ($self, $directory) = @_; - - if (defined($directory)) { - $self->{'spooldirectory'} = $directory; - } else { - $self->{'spooldirectory'} = '/var/spool/asterisk/vm' if (!defined($self->{'spooldirectory'})); - } - - return $self->{'spooldirectory'}; -} - -sub sounddirectory { - my ($self, $directory) = @_; - - if (defined($directory)) { - $self->{'sounddirectory'} = $directory; - } else { - $self->{'sounddirectory'} = '/var/lib/asterisk/sounds' if (!defined($self->{'sounddirectory'})); - } - - return $self->{'sounddirectory'}; -} - -sub serveremail { - my ($self, $email) = @_; - - $self->{'serveremail'} = $email if (defined($email)); - - return $self->{'serveremail'}; -} - -sub format { - my ($self, @formats) = @_; - - if (@formats) { - $self->{'formats'} = @formats; - } - - return $self->{'formats'}; -} - -sub vmbox { - my ($self, $vmbox, $vmpass, $vmfn, $vmemail) = @_; - - if (defined($vmbox) && (defined($vmpass) || defined($vmfn) || defined($vmemail)) ) { - $self->{'vmbox'}{$vmbox}{'pass'} = $vmpass if (defined($vmpass)); - $self->{'vmbox'}{$vmbox}{'fn'} = $vmfn if (defined($vmfn)); - $self->{'vmbox'}{$vmbox}{'email'} = $vmemail if (defined($vmemail)); - } elsif (defined($vmbox)) { - return ($self->{'vmbox'}{$vmbox}{'pass'}, - $self->{'vmbox'}{$vmbox}{'fn'}, - $self->{'vmbox'}{$vmbox}{'email'} ); - } - -} - -sub getfolders { - my ($self, $vmbox) = @_; - - my @folders = (); - - my $spool = $self->spooldirectory(); - - foreach $file (<$spool/$vmbox/*>) { - if ( -d $file ) { - $file =~ s/$spool\/$vmbox\///; - push(@folders, $file); - } - } - return @folders; -} - -sub configfile { - my ($self, $configfile) = @_; - - if (defined($configfile)) { - $self->{'configfile'} = $configfile; - } else { - $self->{'configfile'} = '/etc/asterisk/voicemail.conf' if (!defined($self->{'configfile'})); - } - - return $self->{'configfile'}; -} - -sub readconfig { - my ($self) = @_; - - my $context = ''; - my $line = ''; - - my $configfile = $self->configfile(); - - open(CF, "<$configfile") || die "Error loading $configfile: $!\n"; - while ($line = ) { - chop($line); - - $line =~ s/;.*$//; - $line =~ s/\s*$//; - - if ($line =~ /^;/) { - next; - } elsif ($line =~ /^\s*$/) { - next; - } elsif ($line =~ /^\[(\w+)\]$/) { - $context = $1; - print STDERR "Context: $context\n" if ($DEBUG>3); - } elsif ($line =~ /^format\s*[=>]+\s*(.*)/) { - my $formats = $1; - $self->format(split(/|/, $formats)); - } elsif ($line =~ /^serveremail\s*[=>]+\s*(.*)/) { - $self->serveremail($1); - } elsif ($line =~ /^(\d+)\s*[=>]+\s*(.*)/) { - my $vmbox = $1; - my $vmstr = $2; - my ($vmpass, $vmfn, $vmemail) = split(/,/, $vmstr); - print STDERR "VM BOX ($vmbox)\n" if ($DEBUG>3); - $self->vmbox($vmbox, $vmpass, $vmfn, $vmstr); - } else { - print STDERR "Unknown line: $line\n" if ($DEBUG); - } - } - - close(CF); -} - -sub appendsoundfile { - my ($self, $source, $dest) = @_; - - open(IN, "<$source") || return 0; - open(OUT, ">>$dest") || return 0; - while () { - print OUT $_; - } - close(IN); - close(OUT); - return 1; -} - -sub validmailbox { - my ($self, $vmbox) = @_; - - return 1 if ($self->vmbox($vmbox)); - return 0; -} - -sub msgcount { - my ($self, $vmbox, $folder) = @_; - - my $count = 0; - - return $count if (!defined($vmbox) || !defined($folder)); - - my $spool = $self->spooldirectory() . '/' . $vmbox . '/' . $folder; - - if (opendir(DIR, $spool)) { - my @msgs = grep(/^msg.*\.txt$/, readdir(DIR)); - $count = $#msgs+1; - closedir(DIR); - } - return $count; -} - -sub msgcountstr { - my ($self, $vmbox, $folder) = @_; - - my $count = $self->msgcount($vmbox, $folder); - - if ($count > 1) { - return "$count messages"; - } elsif ($count > 0) { - return "$count message"; - } else { - return "no messages"; - } -} - -sub createdefaultmailbox { - my ($self, $vmbox) = @_; - - my $spool = $self->spooldirectory(); - my $sounddir = $self->sounddirectory(); - - my $vmdir = "$spool/$vmbox"; - - - if ( -d $vmdir ) { - print STDERR "Directory already exists: $vmdir\n" if ($DEBUG); - } else { - mkdir($vmdir, 0755) || return 0; - mkdir("$vmdir/INBOX", 0755) || return 0; - } - - $self->appendsoundfile("$sounddir/vm-theperson.gsm", "$vmdir/unavail.gsm"); - $self->appendsoundfile("$sounddir/vm-theperson.gsm", "$vmdir/busy.gsm"); - $self->appendsoundfile("$sounddir/vm-extension.gsm", "$vmdir/greet.gsm"); - - foreach $chr (split(//, $vmbox)) { - $self->appendsoundfile("$sounddir/digits/$chr.gsm", "$vmdir/unavail.gsm"); - $self->appendsoundfile("$sounddir/digits/$chr.gsm", "$vmdir/busy.gsm"); - $self->appendsoundfile("$sounddir/digits/$chr.gsm", "$vmdir/greet.gsm"); - } - - $self->appendsoundfile("$sounddir/vm-isunavail.gsm", "$vmdir/unavail.gsm"); - $self->appendsoundfile("$sounddir/vm-isonphone.gsm", "$vmdir/busy.gsm"); - - return 1; -} - -sub messages { - my ($self, $messages, $folder) = @_; - - my $path = $self->spooldirectory() . '/' . $mailbox . '/' . $folder; - if (opendir(DIR, $path)) { - my @msgs = sort grep(/^msg....\.txt$/, readdir(DIR)); - closedir(DIR); - return map { s/^msg(....)\.txt$/$1/; $_ } @msgs; - } - return (); -} - -1; - diff --git a/libs/Asterisk/buttons.gif b/libs/Asterisk/buttons.gif deleted file mode 100644 index 6de93e84..00000000 Binary files a/libs/Asterisk/buttons.gif and /dev/null differ diff --git a/libs/Asterisk/vm_indicator_anim.gif b/libs/Asterisk/vm_indicator_anim.gif deleted file mode 100644 index 9445e76f..00000000 Binary files a/libs/Asterisk/vm_indicator_anim.gif and /dev/null differ diff --git a/libs/Asterisk/voicemail_digits.gif b/libs/Asterisk/voicemail_digits.gif deleted file mode 100644 index 4ed7026f..00000000 Binary files a/libs/Asterisk/voicemail_digits.gif and /dev/null differ diff --git a/libs/Asterisk/voicemail_new.gif b/libs/Asterisk/voicemail_new.gif deleted file mode 100644 index 240d4ef8..00000000 Binary files a/libs/Asterisk/voicemail_new.gif and /dev/null differ diff --git a/libs/Asterisk/voicemail_old.gif b/libs/Asterisk/voicemail_old.gif deleted file mode 100644 index a9bbc75e..00000000 Binary files a/libs/Asterisk/voicemail_old.gif and /dev/null differ diff --git a/libs/Asterisk/voicemail_up.gif b/libs/Asterisk/voicemail_up.gif deleted file mode 100644 index 8e6fda81..00000000 Binary files a/libs/Asterisk/voicemail_up.gif and /dev/null differ diff --git a/libs/MySQL.pm b/libs/MySQL.pm deleted file mode 100644 index e6a92c80..00000000 --- a/libs/MySQL.pm +++ /dev/null @@ -1,1015 +0,0 @@ -package Net::MySQL; - -use 5.004; -use IO::Socket; -use Carp; -use vars qw($VERSION $DEBUG); -use strict; -$VERSION = '0.08'; - -use constant COMMAND_SLEEP => "\x00"; -use constant COMMAND_QUIT => "\x01"; -use constant COMMAND_INIT_DB => "\x02"; -use constant COMMAND_QUERY => "\x03"; -use constant COMMAND_FIELD_LIST => "\x04"; -use constant COMMAND_CREATE_DB => "\x05"; -use constant COMMAND_DROP_DB => "\x06"; -use constant COMMAND_REFRESH => "\x07"; -use constant COMMAND_SHUTDOWN => "\x08"; -use constant COMMAND_STATISTICS => "\x09"; -use constant COMMAND_PROCESS_INFO => "\x0A"; -use constant COMMAND_CONNECT => "\x0B"; -use constant COMMAND_PROCESS_KILL => "\x0C"; -use constant COMMAND_DEBUG => "\x0D"; -use constant COMMAND_PING => "\x0E"; -use constant COMMAND_TIME => "\x0F"; -use constant COMMAND_DELAYED_INSERT => "\x10"; -use constant COMMAND_CHANGE_USER => "\x11"; -use constant COMMAND_BINLOG_DUMP => "\x12"; -use constant COMMAND_TABLE_DUMP => "\x13"; -use constant COMMAND_CONNECT_OUT => "\x14"; - -use constant DEFAULT_PORT_NUMBER => 3306; -use constant BUFFER_LENGTH => 1460; -use constant DEFAULT_UNIX_SOCKET => '/tmp/mysql.sock'; - - -sub new -{ - my $class = shift; - my %args = @_; - - my $self = bless { - hostname => $args{hostname}, - unixsocket => $args{unixsocket} || DEFAULT_UNIX_SOCKET, - port => $args{port} || DEFAULT_PORT_NUMBER, - database => $args{database}, - user => $args{user}, - password => $args{password}, - timeout => $args{timeout} || 60, - socket => undef, - salt => '', - protocol_version => undef, - client_capabilities => 0, - affected_rows_length => 0, - }, $class; - $self->debug($args{debug}); - $self->_initialize; - return $self; -} - - -sub query -{ - my $self = shift; - my $sql = join '', @_; - my $mysql = $self->{socket}; - - return $self->_execute_command(COMMAND_QUERY, $sql); -} - - -sub create_database -{ - my $self = shift; - my $db_name = shift; - my $mysql = $self->{socket}; - - return $self->_execute_command(COMMAND_CREATE_DB, $db_name); -} - - -sub drop_database -{ - my $self = shift; - my $db_name = shift; - my $mysql = $self->{socket}; - - return $self->_execute_command(COMMAND_DROP_DB, $db_name); -} - - -sub close -{ - my $self = shift; - my $mysql = $self->{socket}; - return unless $mysql->can('send'); - - my $quit_message = - chr(length(COMMAND_QUIT)). "\x00\x00\x00". COMMAND_QUIT; - $mysql->send($quit_message, 0); - $self->_dump_packet($quit_message) if Net::MySQL->debug; - $mysql->close; -} - - -sub get_affected_rows_length -{ - my $self = shift; - $self->{affected_rows_length}; -} - - -sub get_insert_id -{ - my $self = shift; - $self->{insert_id}; -} - - -sub create_record_iterator -{ - my $self = shift; - return undef unless $self->has_selected_record; - - my $record = Net::MySQL::RecordIterator->new( - $self->{selected_record} - ); - $self->{selected_record} = undef; - $record->parse; - return $record; -} - - -sub has_selected_record -{ - my $self = shift; - $self->{selected_record} ? 1 : undef; -} - - -sub is_error -{ - my $self = shift; - $self->{error_code} ? 1 : undef; -} - - -sub get_error_code -{ - my $self = shift; - $self->{error_code}; -} - - -sub get_error_message -{ - my $self = shift; - $self->{server_message}; -} - - -sub debug -{ - my $class = shift; - $DEBUG = shift if @_; - $DEBUG; -} - - -sub _connect -{ - my $self = shift; - - my $mysql; - if ($self->{hostname}) { - printf "Use INET Socket: %s %d/tcp\n", $self->{hostname}, $self->{port} - if $self->debug; - $mysql = IO::Socket::INET->new( - PeerAddr => $self->{hostname}, - PeerPort => $self->{port}, - Proto => 'tcp', - Timeout => $self->{timeout} || 60, - ) or croak "Couldn't connect to $self->{hostname}:$self->{port}/tcp: $@"; - } - else { - printf "Use UNIX Socket: %s\n", $self->{unixsocket} if $self->debug; - $mysql = IO::Socket::UNIX->new( - Type => SOCK_STREAM, - Peer => $self->{unixsocket}, - ) or croak "Couldn't connect to $self->{unixsocket}: $@"; - } - $mysql->autoflush(1); - $self->{socket} = $mysql; -} - - -sub _get_server_information -{ - my $self = shift; - my $mysql = $self->{socket}; - - my $message; - $mysql->recv($message, BUFFER_LENGTH, 0); - $self->_dump_packet($message) - if Net::MySQL->debug; - my $i = 0; - my $packet_length = ord substr $message, $i, 1; - $i += 4; - $self->{protocol_version} = ord substr $message, $i, 1; - printf "Protocol Version: %d\n", $self->{protocol_version} - if Net::MySQL->debug; - if ($self->{protocol_version} == 10) { - $self->{client_capabilities} = 1; - } - - ++$i; - my $string_end = index($message, "\0", $i) - $i; - $self->{server_version} = substr $message, $i, $string_end; - printf "Server Version: %s\n", $self->{server_version} - if Net::MySQL->debug; - - $i += $string_end + 1; - $self->{server_thread_id} = unpack 'v', substr $message, $i, 2; - $i += 4; - $self->{salt} = substr $message, $i, 8; - printf "Salt: %s\n", $self->{salt} if Net::MySQL->debug; -} - - -sub _request_authentication -{ - my $self = shift; - my $mysql = $self->{socket}; - $self->_send_login_message(); - - my $auth_result; - $mysql->recv($auth_result, BUFFER_LENGTH, 0); - $self->_dump_packet($auth_result) if Net::MySQL->debug; - if ($self->_is_error($auth_result)) { - $mysql->close; - if (length $auth_result < 7) { - croak "Timeout of authentication"; - } - croak substr $auth_result, 7; - } - print "connect database\n" if Net::MySQL->debug; -} - - -sub _send_login_message -{ - my $self = shift; - my $mysql = $self->{socket}; - - my $body = "\0\0\x01\x8d\x00\00\00\00". join "\0", - $self->{user}, - Net::MySQL::Password->scramble( - $self->{password}, $self->{salt}, $self->{client_capabilities} - ), - $self->{database}; - my $login_message = chr(length($body)-3). $body; - $mysql->send($login_message, 0); - $self->_dump_packet($login_message) if Net::MySQL->debug; -} - - - -sub _execute_command -{ - my $self = shift; - my $command = shift; - my $sql = shift; - my $mysql = $self->{socket}; - - my $message = pack('V', length($sql) + 1). $command. $sql; - - $mysql->send($message, 0); - $self->_dump_packet($message) if Net::MySQL->debug; - - my $result; - $mysql->recv($result, BUFFER_LENGTH, 0); - $self->_dump_packet($result) if Net::MySQL->debug; - $self->_reset_status; - - if ($self->_is_error($result)) { - return $self->_set_error_by_packet($result); - } - elsif ($self->_is_select_query_result($result)) { - return $self->_get_record_by_server($result); - } - elsif ($self->_is_update_query_result($result)){ - return $self->_get_affected_rows_information_by_packet($result); - } - else { - croak 'Unknown Result: '. $self->_get_result_length($result). 'byte'; - } -} - - -sub _initialize -{ - my $self = shift; - $self->_connect; - $self->_get_server_information; - $self->_request_authentication; -} - - -sub _set_error_by_packet -{ - my $self = shift; - my $packet = shift; - - my $error_message = $self->_get_server_message($packet); - $self->{server_message} = $error_message; - $self->{error_code} = $self->_get_error_code($packet); - return undef; -} - - -sub _get_record_by_server -{ - my $self = shift; - my $packet = shift; - my $mysql = $self->{socket}; - - $self->_get_column_length($packet); - while ($self->_has_next_packet($packet)) { - my $next_result; - $mysql->recv($next_result, BUFFER_LENGTH, 0); - $packet .= $next_result; - $self->_dump_packet($next_result) if Net::MySQL->debug; - } - $self->{selected_record} = $packet; -} - - -sub _get_affected_rows_information_by_packet -{ - my $self = shift; - my $packet = shift; - - $self->{affected_rows_length} = $self->_get_affected_rows_length($packet); - $self->{insert_id} = $self->_get_insert_id($packet); - $self->{server_message} = $self->_get_server_message($packet); - return $self->{affected_rows_length}; -} - - -sub _is_error -{ - my $self = shift; - my $packet = shift; - return 1 if length $packet < 4; - ord(substr $packet, 4) == 255; -} - - -sub _is_select_query_result -{ - my $self = shift; - my $packet = shift; - return undef if $self->_is_error($packet); - ord(substr $packet, 4) >= 1; -} - - -sub _is_update_query_result -{ - my $self = shift; - my $packet = shift; - return undef if $self->_is_error($packet); - ord(substr $packet, 4) == 0; -} - - -sub _get_result_length -{ - my $self = shift; - my $packet = shift; - ord(substr $packet, 0, 1) -} - - -sub _get_column_length -{ - my $self = shift; - my $packet = shift; - ord(substr $packet, 4); -} - - -sub _get_affected_rows_length -{ - my $self = shift; - my $packet = shift; - ord(substr $packet, 5, 1); -} - - -sub _get_insert_id -{ - my $self = shift; - my $packet = shift; - return ord(substr $packet, 6, 1) if ord(substr $packet, 6, 1) != 0xfc; - unpack 'v', substr $packet, 7, 2; -} - - -sub _get_server_message -{ - my $self = shift; - my $packet = shift; - return '' if length $packet < 7; - substr $packet, 7; -} - - -sub _get_error_code -{ - my $self = shift; - my $packet = shift; - $self->_is_error($packet) - or croak "_get_error_code(): Is not error packet"; - unpack 'v', substr $packet, 5, 2; -} - - -sub _reset_status -{ - my $self = shift; - $self->{insert_id} = 0; - $self->{server_message} = ''; - $self->{error_code} = undef; - $self->{selected_record} = undef; -} - - -sub _has_next_packet -{ - my $self = shift; - substr($_[0], -1) ne "\xfe"; -} - - -sub _dump_packet -{ - my $self = shift; - my $packet = shift; - - my ($method_name) = (caller(1))[3]; - printf "%s():\n%s\n", - $method_name, - join ' ', map { sprintf "%02x", ord $_ } split //, $packet; - printf "%s():\n%s\n", - $method_name, - join ' ', map { m/[\d \w\._]/ ? $_ : '.' } split //, $packet; - print "--\n"; -} - - - -package Net::MySQL::RecordIterator; -use strict; - -use constant NULL_COLUMN => 251; -use constant UNSIGNED_CHAR_COLUMN => 251; -use constant UNSIGNED_SHORT_COLUMN => 252; -use constant UNSIGNED_INT24_COLUMN => 253; -use constant UNSIGNED_INT32_COLUMN => 254; -use constant UNSIGNED_CHAR_LENGTH => 1; -use constant UNSIGNED_SHORT_LENGTH => 2; -use constant UNSIGNED_INT24_LENGTH => 3; -use constant UNSIGNED_INT32_LENGTH => 4; -use constant UNSIGNED_INT32_PAD_LENGTH => 4; - - -sub new -{ - my $class = shift; - my $packet = shift; - bless { - packet => $packet, - position => 0, - column => [], - }, $class; -} - - -sub parse -{ - my $self = shift; - $self->_get_column_length; - $self->_get_column_name; -} - - -sub each -{ - my $self = shift; - my @result; - return undef if $self->is_end_of_packet; - - for (1..$self->{column_length}) { - push @result, $self->_get_string_and_seek_position; - } - $self->{position} += 4; - return \@result; -} - - -sub is_end_of_packet -{ - my $self = shift; - length $self->{packet} <= $self->{position} + 1; -} - - -sub get_field_length -{ - my $self = shift; - $self->{column_length}; -} - - -sub get_field_names -{ - my $self = shift; - map { $_->{column} } @{$self->{column}}; -} - - -sub _get_column_length -{ - my $self = shift; - $self->{position} += 4; - $self->{column_length} = ord substr $self->{packet}, $self->{position}, 1; - $self->{position} += 5; - printf "Column Length: %d\n", $self->{column_length} - if Net::MySQL->debug; -} - - -sub _get_column_name -{ - my $self = shift; - for my $i (1.. $self->{column_length}) { - push @{$self->{column}}, { - table => $self->_get_string_and_seek_position, - column => $self->_get_string_and_seek_position, - }; - $self->{position} += 14; - } - $self->{position} += 5; - - printf "Column name: %s\n", - join ", ", map { $_->{column} } @{$self->{column}} - if Net::MySQL->debug; -} - - -sub _get_string_and_seek_position -{ - my $self = shift; - - my $length = $self->_get_field_length(); - return undef unless defined $length; - - my $string = substr $self->{packet}, $self->{position}, $length; - $self->{position} += $length; - return $string; -} - - -sub _get_field_length -{ - my $self = shift; - - my $head = ord substr( - $self->{packet}, - $self->{position}, - UNSIGNED_CHAR_LENGTH - ); - $self->{position} += UNSIGNED_CHAR_LENGTH; - - return undef if $head == NULL_COLUMN; - if ($head < UNSIGNED_CHAR_COLUMN) { - return $head; - } - elsif ($head == UNSIGNED_SHORT_COLUMN) { - warn "in short"; - my $length = unpack 'v', substr( - $self->{packet}, - $self->{position}, - UNSIGNED_SHORT_LENGTH - ); - $self->{position} += UNSIGNED_SHORT_LENGTH; - return $length; - } - elsif ($head == UNSIGNED_INT24_COLUMN) { - warn "in int23"; - my $int24 = substr( - $self->{packet}, $self->{position}, - UNSIGNED_INT24_LENGTH - ); - my $length = unpack('C', substr($int24, 0, 1)) - + (unpack('C', substr($int24, 1, 1)) << 8) - + (unpack('C', substr($int24, 2, 1)) << 16); - $self->{position} += UNSIGNED_INT24_LENGTH; - return $length; - } - else { - warn "in int32"; - my $int32 = substr( - $self->{packet}, $self->{position}, - UNSIGNED_INT32_LENGTH - ); - my $length = unpack('C', substr($int32, 0, 1)) - + (unpack('C', substr($int32, 1, 1)) << 8) - + (unpack('C', substr($int32, 2, 1)) << 16) - + (unpack('C', substr($int32, 3, 1)) << 24); - $self->{position} += UNSIGNED_INT32_LENGTH; - $self->{position} += UNSIGNED_INT32_PAD_LENGTH; - return $length; - } -} - - -package Net::MySQL::Password; -use strict; - -sub scramble -{ - my $class = shift; - my $password = shift; - my $hash_seed = shift; - my $client_capabilities = shift; - - return '' unless $password; - return '' if length $password == 0; - - my $hsl = length $hash_seed; - my @out; - my @hash_pass = _get_hash($password); - my @hash_mess = _get_hash($hash_seed); - - my ($max_value, $seed, $seed2); - my ($dRes, $dSeed, $dMax); - if ($client_capabilities < 1) { - $max_value = 0x01FFFFFF; - $seed = _xor_by_long($hash_pass[0], $hash_mess[0]) % $max_value; - $seed2 = int($seed / 2); - } else { - $max_value= 0x3FFFFFFF; - $seed = _xor_by_long($hash_pass[0], $hash_mess[0]) % $max_value; - $seed2 = _xor_by_long($hash_pass[1], $hash_mess[1]) % $max_value; - } - $dMax = $max_value; - - for (my $i=0; $i < $hsl; $i++) { - $seed = int(($seed * 3 + $seed2) % $max_value); - $seed2 = int(($seed + $seed2 + 33) % $max_value); - $dSeed = $seed; - $dRes = $dSeed / $dMax; - push @out, int($dRes * 31) + 64; - } - - if ($client_capabilities == 1) { - # Make it harder to break - $seed = ($seed * 3 + $seed2 ) % $max_value; - $seed2 = ($seed + $seed2 + 33 ) % $max_value; - $dSeed = $seed; - - $dRes = $dSeed / $dMax; - my $e = int($dRes * 31); - for (my $i=0; $i < $hsl ; $i++) { - $out[$i] ^= $e; - } - } - return join '', map { chr $_ } @out; -} - - -sub _get_hash -{ - my $password = shift; - - my $nr = 1345345333; - my $add = 7; - my $nr2 = 0x12345671; - my $tmp; - my $pwlen = length $password; - my $c; - - for (my $i=0; $i < $pwlen; $i++) { - my $c = substr $password, $i, 1; - next if $c eq ' ' || $c eq "\t"; - my $tmp = ord $c; - my $value = ((_and_by_char($nr, 63) + $add) * $tmp) + $nr * 256; - $nr = _xor_by_long($nr, $value); - $nr2 += _xor_by_long(($nr2 * 256), $nr); - $add += $tmp; - } - return (_and_by_long($nr, 0x7fffffff), _and_by_long($nr2, 0x7fffffff)); -} - - -sub _and_by_char -{ - my $source = shift; - my $mask = shift; - - return $source & $mask; -} - - -sub _and_by_long -{ - my $source = shift; - my $mask = shift || 0xFFFFFFFF; - - return _cut_off_to_long($source) & _cut_off_to_long($mask); -} - - -sub _xor_by_long -{ - my $source = shift; - my $mask = shift || 0; - - return _cut_off_to_long($source) ^ _cut_off_to_long($mask); -} - - -sub _cut_off_to_long -{ - my $source = shift; - - if ($] >= 5.006) { - $source = $source % (0xFFFFFFFF + 1) if $source > 0xFFFFFFFF; - return $source; - } - while ($source > 0xFFFFFFFF) { - $source -= 0xFFFFFFFF + 1; - } - return $source; -} - - -1; -__END__ - -=head1 NAME - -Net::MySQL - Pure Perl MySQL network protocol interface. - -=head1 SYNOPSIS - - use Net::MySQL; - - my $mysql = Net::MySQL->new( - # hostname => 'mysql.example.jp', # Default use UNIX socket - database => 'your_database_name', - user => 'user', - password => 'password' - ); - - # INSERT example - $mysql->query(q{ - INSERT INTO tablename (first, next) VALUES ('Hello', 'World') - }); - printf "Affected row: %d\n", $mysql->get_affected_rows_length; - - # SLECT example - $mysql->query(q{SELECT * FROM tablename}); - my $record_set = $mysql->create_record_iterator; - while (my $record = $record_set->each) { - printf "First column: %s Next column: %s\n", - $record->[0], $record->[1]; - } - $mysql->close; - -=head1 DESCRIPTION - -Net::MySQL is a Pure Perl client interface for the MySQL database. This module implements network protocol between server and client of MySQL, thus you don't need external MySQL client library like libmysqlclient for this module to work. It means this module enables you to connect to MySQL server from some operation systems which MySQL is not ported. How nifty! - -Since this module's final goal is to completely replace DBD::mysql, API is made similar to that of DBI. - -From perl you activate the interface with the statement - - use Net::MySQL; - -After that you can connect to multiple MySQL daemon and send multiple queries to any of them via a simple object oriented interface. - -There are two classes which have public APIs: Net::MySQL and Net::MySQL::RecordIterator. - - $mysql = Net::MySQL->new( - hostname => $host, - database => $database, - user => $user, - password => $password, - ); - -Once you have connected to a daemon, you can can execute SQL with: - - $mysql->query(q{ - INSERT INTO foo (id, message) VALUES (1, 'Hello World') - }); - -If you want to retrieve results, you need to create a so-called statement handle with: - - $mysql->query(q{ - SELECT id, message FROM foo - }); - if ($mysql->has_selected_record) { - my $a_record_iterator = $mysql->create_record_iterator; - # ... - } - -This Net::MySQL::RecordIterator object can be used for multiple purposes. First of all you can retreive a row of data: - - my $record = $a_record_iterator->each; - -The each() method takes out the reference result of one line at a time, and the return value is ARRAY reference. - -=head2 Net::MySQL API - -=over 4 - -=item new(HASH) - - use Net::MySQL; - use strict; - - my $mysql = Net::MySQL->new( - unixsocket => $path_to_socket, - hostname => $host, - database => $database, - user => $user, - password => $password, - ); - -The constructor of Net::MySQL. Connection with MySQL daemon is established and the object is returned. Argument hash contains following parameters: - -=over 8 - -=item unixsocket - -Path of the UNIX socket where MySQL daemon. default is F. -Supposing I is omitted, it will connect by I. - -=item hostname - -Name of the host where MySQL daemon runs. -Supposing I is specified, it will connect by I. - -=item port - -Port where MySQL daemon listens to. default is 3306. - -=item database - -Name of the database to connect. - -=item user / password - -Username and password for database authentication. - -=item timeout - -The waiting time which carries out a timeout when connection is overdue is specified. - -=item debug - -The exchanged packet will be outputted if a true value is given. - -=back - - -=item create_database(DB_NAME) - -A create_DATABASE() method creates a database by the specified name. - - $mysql->create_database('example_db'); - die $mysql->get_error_message if $mysql->is_error; - -=item drop_database(DB_NAME) - -A drop_database() method deletes the database of the specified name. - - $mysql->drop_database('example_db'); - die $mysql->get_error_message if $mysql->is_error; - -=item query(SQL_STRING) - -A query() method transmits the specified SQL string to MySQL database, and obtains the response. - -=item create_record_iterator() - -When SELECT type SQL is specified, Net::MySQL::RecordIterator object which shows the reference result is returned. - - $mysql->query(q{SELECT * FROM table}); - my $a_record_iterator = $mysql->create_recrod_iterator(); - -Net::MySQL::RecordIterator object is applicable to acquisition of a reference result. See L<"/Net::SQL::RecordIterator API"> for more. - -=item get_affected_rows_length() - -returns the number of records finally influenced by specified SQL. - - my $affected_rows = $mysql->get_affected_rows_length; - -=item get_insert_id() - -MySQL has the ability to choose unique key values automatically. If this happened, the new ID will be stored in this attribute. - -=item is_error() - -TRUE will be returned if the error has occurred. - -=item has_selected_record() - -TRUE will be returned if it has a reference result by SELECT. - -=item get_field_length() - -return the number of column. - -=item get_field_names() - -return column names by ARRAY. - -=item close() - -transmits an end message to MySQL daemon, and closes a socket. - -=back - -=head2 Net::MySQL::RecordIterator API - -Net::MySQL::RecordIterator object is generated by the query() method of Net::MySQL object. Thus it has no public constructor method. - -=over 4 - -=item each() - -each() method takes out only one line from a result, and returns it as an ARRAY reference. C is returned when all the lines has been taken out. - - while (my $record = $a_record_iterator->each) { - printf "Column 1: %s Column 2: %s Collumn 3: %s\n", - $record->[0], $record->[1], $record->[2]; - } - -=back - -=head1 SUPPORT OPERATING SYSTEM - -This module has been tested on these OSes. - -=over 4 - -=item * MacOS 9.x - -with MacPerl5.6.1r. - -=item * MacOS X - -with perl5.6.0 build for darwin. - -=item * Windows2000 - -with ActivePerl5.6.1 build631. - -=item * FreeBSD 3.4 and 4.x - -with perl5.6.1 build for i386-freebsd. - -with perl5.005_03 build for i386-freebsd. - -=item * Linux - -with perl 5.005_03 built for ppc-linux. - -with perl 5.6.0 bult for i386-linux. - -=item * Solaris 2.6 (SPARC) - -with perl 5.6.1 built for sun4-solaris. - -with perl 5.004_04 built for sun4-solaris. - -Can use on Solaris2.6 with perl5.004_04, although I is failure. - -=back - -This list is the environment which I can use by the test usually. Net::MySQL will operate also in much environment which is not in a list. - -I believe this module can work with whatever perls which has B. I'll be glad if you give me a report of successful installation of this module on I OSes. - -=head1 SEE ALSO - -L, L - -=head1 AUTHOR - -Hiroyuki OYAMA Eoyama@module.jpE - -=head1 COPYRIGHT AND LICENCE - -Copyright (C) 2002 Hiroyuki OYAMA. Japan. All rights reserved. - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut diff --git a/libs/Net/HTTP.pm b/libs/Net/HTTP.pm deleted file mode 100644 index 80786825..00000000 --- a/libs/Net/HTTP.pm +++ /dev/null @@ -1,266 +0,0 @@ -package Net::HTTP; - -# $Id: HTTP.pm,v 1.43 2002/12/26 09:13:53 gisle Exp $ - -use strict; -use vars qw($VERSION @ISA); - -$VERSION = "1.00"; -eval { require IO::Socket::INET } || require IO::Socket; -require Net::HTTP::Methods; - -@ISA=qw(IO::Socket::INET Net::HTTP::Methods); - -sub configure { - my($self, $cnf) = @_; - $self->http_configure($cnf); -} - -sub http_connect { - my($self, $cnf) = @_; - $self->SUPER::configure($cnf); -} - -1; - -__END__ - -=head1 NAME - -Net::HTTP - Low-level HTTP connection (client) - -=head1 SYNOPSIS - - use Net::HTTP; - my $s = Net::HTTP->new(Host => "www.perl.com) || die $@; - $s->write_request(GET => "/", 'User-Agent' => "Mozilla/5.0"); - my($code, $mess, %h) = $s->read_response_headers; - - while (1) { - my $buf; - my $n = $s->read_entity_body($buf, 1024); - die "read failed: $!" unless defined $n; - last unless $n; - print $buf; - } - -=head1 DESCRIPTION - -The C class is a low-level HTTP client. An instance of the -C class represents a connection to an HTTP server. The -HTTP protocol is described in RFC 2616. The C class -support C and C. - -C is a sub-class of C. You can mix the -methods described below with reading and writing from the socket -directly. This is not necessary a good idea, unless you know what you -are doing. - -The following methods are provided (in addition to those of -C): - -=over - -=item $s = Net::HTTP->new( %options ) - -The C constructor method takes the same options as -C's as well as these: - - Host: Initial host attribute value - KeepAlive: Initial keep_alive attribute value - SendTE: Initial send_te attribute_value - HTTPVersion: Initial http_version attribute value - PeerHTTPVersion: Initial peer_http_version attribute value - MaxLineLength: Initial max_line_length attribute value - MaxHeaderLines: Initial max_header_lines attribute value - -The C option is also the default for C's -C. The C defaults to 80 if not provided. - -The C option provided by C's constructor -method is not allowed. - -If unable to connect to the given HTTP server then the constructor -returns C and $@ contains the reason. After a successful -connect, a C object is returned. - -=item $s->host - -Get/set the default value of the C header to send. The $host -should not be set to an empty string (or C). - -=item $s->keep_alive - -Get/set the I value. If this value is TRUE then the -request will be sent with headers indicating that the server should try -to keep the connection open so that multiple requests can be sent. - -The actual headers set will depend on the value of the C -and C attributes. - -=item $s->send_te - -Get/set the a value indicating if the request will be sent with a "TE" -header to indicate the transfer encodings that the server can chose to -use. If the C module is installed then this will -annouce that this client accept both the I and I -encodings. - -=item $s->http_version - -Get/set the HTTP version number that this client should announce. -This value can only be set to "1.0" or "1.1". The default is "1.1". - -=item $s->peer_http_version - -Get/set the protocol version number of our peer. This value will -initially be "1.0", but will be updated by a successful -read_response_headers() method call. - -=item $s->max_line_length - -Get/set a limit on the length of response line and response header -lines. The default is 4096. A value of 0 means no limit. - -=item $s->max_header_length - -Get/set a limit on the number of headers lines that a response can -have. The default is 128. A value of 0 means no limit. - -=item $s->format_request($method, $uri, %headers, [$content]) - -Format a request message and return it as a string. If the headers do -not include a C header, then a header is inserted with the value -of the C attribute. Headers like C and -C might also be added depending on the status of the -C attribute. - -If $content is given (and it is non-empty), then a C -header is automatically added unless it was already present. - -=item $s->write_request($method, $uri, %headers, [$content]) - -Format and send a request message. Arguments are the same as for -format_request(). Returns true if successful. - -=item $s->format_chunk( $data ) - -Returns the string to be written for the given chunk of data. - -=item $s->write_chunk($data) - -Will write a new chunk of request entity body data. This method -should only be used if the C header with a value of -C was sent in the request. Note, writing zero-length data is -a no-op. Use the write_chunk_eof() method to signal end of entity -body data. - -Returns true if successful. - -=item $s->format_chunk_eof( %trailers ) - -Returns the string to be written for signaling EOF when a -C of C is used. - -=item $s->write_chunk_eof( %trailers ) - -Will write eof marker for chunked data and optional trailers. Note -that trailers should not really be used unless is was signaled -with a C header. - -Returns true if successful. - -=item ($code, $mess, %headers) = $s->read_response_headers( %opts ) - -Read response headers from server and return it. The $code is the 3 -digit HTTP status code (see L) and $mess is the textual -message that came with it. Headers are then returned as key/value -pairs. Since key letter casing is not normalized and the same key can -even occur multiple times, assigning these values directly to a hash -is not wise. Only the $code is returned if this method is called in -scalar context. - -As a side effect this method updates the 'peer_http_version' -attribute. - -Options might be passed in as key/value pairs. There are currently -only two options supported; C and C. - -The C option will make read_response_headers() more forgiving -towards servers that have not learned how to speak HTTP properly. The -C option is a boolean flag, and is enabled by passing in a TRUE -value. The C option can be used to capture bad header lines -when C is enabled. The value should be an array reference. -Bad header lines will be pushed onto the array. - -The C option must be specified in order to communicate with -pre-HTTP/1.0 servers that don't describe the response outcome or the -data they send back with a header block. For these servers -peer_http_version is set to "0.9" and this method returns (200, -"Assumed OK"). - -The method will raise an exception (die) if the server does not speak -proper HTTP or if the C or C -limits are reached. If the C option is turned on and -C and C checks are turned off, -then no exception will be raised and this method will always -return a response code. - -=item $n = $s->read_entity_body($buf, $size); - -Reads chunks of the entity body content. Basically the same interface -as for read() and sysread(), but the buffer offset argument is not -supported yet. This method should only be called after a successful -read_response_headers() call. - -The return value will be C on read errors, 0 on EOF, -1 if no data -could be returned this time, otherwise the number of bytes assgined -to $buf. The $buf set to "" when the return value is -1. - -This method will raise exceptions (die) if the server does not speak -proper HTTP. This can only happen when reading chunked data. - -=item %headers = $s->get_trailers - -After read_entity_body() has returned 0 to indicate end of the entity -body, you might call this method to pick up any trailers. - -=item $s->_rbuf - -Get/set the read buffer content. The read_response_headers() and -read_entity_body() methods use an internal buffer which they will look -for data before they actually sysread more from the socket itself. If -they read too much, the remaining data will be left in this buffer. - -=item $s->_rbuf_length - -Returns the number of bytes in the read buffer. This should always be -the same as: - - length($s->_rbuf) - -but might be more efficient. - -=back - -=head1 SUBCLASSING - -The read_response_headers() and read_entity_body() will invoke the -sysread() method when they need more data. Subclasses might want to -override this method to contol how reading takes place. - -The object itself is a glob. Subclasses should avoid using hash key -names prefixed with C and C. - -=head1 SEE ALSO - -L, L, L - -=head1 COPYRIGHT - -Copyright 2001-2003 Gisle Aas. - -This library is free software; you can redistribute it and/or -modify it under the same terms as Perl itself. - -=cut diff --git a/libs/Net/HTTP/Methods.pm b/libs/Net/HTTP/Methods.pm deleted file mode 100644 index b1b2115f..00000000 --- a/libs/Net/HTTP/Methods.pm +++ /dev/null @@ -1,520 +0,0 @@ -package Net::HTTP::Methods; - -# $Id: Methods.pm,v 1.12 2002/12/26 09:13:55 gisle Exp $ - -require 5.005; # 4-arg substr - -use strict; -use vars qw($VERSION); - -$VERSION = "1.00"; - -my $CRLF = "\015\012"; # "\r\n" is not portable - -sub new { - my($class, %cnf) = @_; - require Symbol; - my $self = bless Symbol::gensym(), $class; - return $self->http_configure(\%cnf); -} - -sub http_configure { - my($self, $cnf) = @_; - - die "Listen option not allowed" if $cnf->{Listen}; - my $host = delete $cnf->{Host}; - my $peer = $cnf->{PeerAddr} || $cnf->{PeerHost}; - if ($host) { - $cnf->{PeerAddr} = $host unless $peer; - } - else { - $host = $peer; - $host =~ s/:.*//; - } - $cnf->{PeerPort} = $self->http_default_port unless $cnf->{PeerPort}; - $cnf->{Proto} = 'tcp'; - - my $keep_alive = delete $cnf->{KeepAlive}; - my $http_version = delete $cnf->{HTTPVersion}; - $http_version = "1.1" unless defined $http_version; - my $peer_http_version = delete $cnf->{PeerHTTPVersion}; - $peer_http_version = "1.0" unless defined $peer_http_version; - my $send_te = delete $cnf->{SendTE}; - my $max_line_length = delete $cnf->{MaxLineLength}; - $max_line_length = 4*1024 unless defined $max_line_length; - my $max_header_lines = delete $cnf->{MaxHeaderLines}; - $max_header_lines = 128 unless defined $max_header_lines; - - return undef unless $self->http_connect($cnf); - - unless ($host =~ /:/) { - my $p = $self->peerport; - $host .= ":$p"; - } - $self->host($host); - $self->keep_alive($keep_alive); - $self->send_te($send_te); - $self->http_version($http_version); - $self->peer_http_version($peer_http_version); - $self->max_line_length($max_line_length); - $self->max_header_lines($max_header_lines); - - ${*$self}{'http_buf'} = ""; - - return $self; -} - -sub http_default_port { - 80; -} - -# set up property accessors -for my $method (qw(host keep_alive send_te max_line_length max_header_lines peer_http_version)) { - my $prop_name = "http_" . $method; - no strict 'refs'; - *$method = sub { - my $self = shift; - my $old = ${*$self}{$prop_name}; - ${*$self}{$prop_name} = shift if @_; - return $old; - }; -} - -# we want this one to be a bit smarter -sub http_version { - my $self = shift; - my $old = ${*$self}{'http_version'}; - if (@_) { - my $v = shift; - $v = "1.0" if $v eq "1"; # float - unless ($v eq "1.0" or $v eq "1.1") { - require Carp; - Carp::croak("Unsupported HTTP version '$v'"); - } - ${*$self}{'http_version'} = $v; - } - $old; -} - -sub format_request { - my $self = shift; - my $method = shift; - my $uri = shift; - - my $content = (@_ % 2) ? pop : ""; - - for ($method, $uri) { - require Carp; - Carp::croak("Bad method or uri") if /\s/ || !length; - } - - push(@{${*$self}{'http_request_method'}}, $method); - my $ver = ${*$self}{'http_version'}; - my $peer_ver = ${*$self}{'http_peer_http_version'} || "1.0"; - - my @h; - my @connection; - my %given = (host => 0, "content-length" => 0, "te" => 0); - while (@_) { - my($k, $v) = splice(@_, 0, 2); - my $lc_k = lc($k); - if ($lc_k eq "connection") { - push(@connection, split(/\s*,\s*/, $v)); - next; - } - if (exists $given{$lc_k}) { - $given{$lc_k}++; - } - push(@h, "$k: $v"); - } - - if (length($content) && !$given{'content-length'}) { - push(@h, "Content-Length: " . length($content)); - } - - my @h2; - if ($given{te}) { - push(@connection, "TE") unless grep lc($_) eq "te", @connection; - } - elsif ($self->send_te && zlib_ok()) { - # gzip is less wanted since the Compress::Zlib interface for - # it does not really allow chunked decoding to take place easily. - push(@h2, "TE: deflate,gzip;q=0.3"); - push(@connection, "TE"); - } - - unless (grep lc($_) eq "close", @connection) { - if ($self->keep_alive) { - if ($peer_ver eq "1.0") { - # from looking at Netscape's headers - push(@h2, "Keep-Alive: 300"); - unshift(@connection, "Keep-Alive"); - } - } - else { - push(@connection, "close") if $ver ge "1.1"; - } - } - push(@h2, "Connection: " . join(", ", @connection)) if @connection; - push(@h2, "Host: ${*$self}{'http_host'}") unless $given{host}; - - return join($CRLF, "$method $uri HTTP/$ver", @h2, @h, "", $content); -} - - -sub write_request { - my $self = shift; - $self->print($self->format_request(@_)); -} - -sub format_chunk { - my $self = shift; - return $_[0] unless defined($_[0]) && length($_[0]); - return sprintf("%x", length($_[0])) . $CRLF . $_[0] . $CRLF; -} - -sub write_chunk { - my $self = shift; - return 1 unless defined($_[0]) && length($_[0]); - $self->print(sprintf("%x", length($_[0])) . $CRLF . $_[0] . $CRLF); -} - -sub format_chunk_eof { - my $self = shift; - my @h; - while (@_) { - push(@h, sprintf "%s: %s$CRLF", splice(@_, 0, 2)); - } - return join("", "0$CRLF", @h, $CRLF); -} - -sub write_chunk_eof { - my $self = shift; - $self->print($self->format_chunk_eof(@_)); -} - - -sub my_read { - die if @_ > 3; - my $self = shift; - my $len = $_[1]; - for (${*$self}{'http_buf'}) { - if (length) { - $_[0] = substr($_, 0, $len, ""); - return length($_[0]); - } - else { - return $self->sysread($_[0], $len); - } - } -} - - -sub my_readline { - my $self = shift; - for (${*$self}{'http_buf'}) { - my $max_line_length = ${*$self}{'http_max_line_length'}; - my $pos; - while (1) { - # find line ending - $pos = index($_, "\012"); - last if $pos >= 0; - die "Line too long (limit is $max_line_length)" - if $max_line_length && length($_) > $max_line_length; - - # need to read more data to find a line ending - my $n = $self->sysread($_, 1024, length); - if (!$n) { - return undef unless length; - return substr($_, 0, length, ""); - } - } - die "Line too long ($pos; limit is $max_line_length)" - if $max_line_length && $pos > $max_line_length; - - my $line = substr($_, 0, $pos+1, ""); - $line =~ s/(\015?\012)\z// || die "Assert"; - return wantarray ? ($line, $1) : $line; - } -} - - -sub _rbuf { - my $self = shift; - if (@_) { - for (${*$self}{'http_buf'}) { - my $old; - $old = $_ if defined wantarray; - $_ = shift; - return $old; - } - } - else { - return ${*$self}{'http_buf'}; - } -} - -sub _rbuf_length { - my $self = shift; - return length ${*$self}{'http_buf'}; -} - - -sub _read_header_lines { - my $self = shift; - my $junk_out = shift; - - my @headers; - my $line_count = 0; - my $max_header_lines = ${*$self}{'http_max_header_lines'}; - while (my $line = my_readline($self)) { - if ($line =~ /^(\S+)\s*:\s*(.*)/s) { - push(@headers, $1, $2); - } - elsif (@headers && $line =~ s/^\s+//) { - $headers[-1] .= " " . $line; - } - elsif ($junk_out) { - push(@$junk_out, $line); - } - else { - die "Bad header: '$line'\n"; - } - if ($max_header_lines) { - $line_count++; - if ($line_count >= $max_header_lines) { - die "Too many header lines (limit is $max_header_lines)"; - } - } - } - return @headers; -} - - -sub read_response_headers { - my($self, %opt) = @_; - my $laxed = $opt{laxed}; - - my($status, $eol) = my_readline($self); - unless (defined $status) { - die "EOF instead of response status line" unless $laxed; - # assume HTTP/0.9 - ${*$self}{'http_peer_http_version'} = "0.9"; - ${*$self}{'http_status'} = "200"; - return 200 unless wantarray; - return (200, "EOF"); - } - - my($peer_ver, $code, $message) = split(/\s+/, $status, 3); - if (!$peer_ver || $peer_ver !~ s,^HTTP/,, || $code !~ /^[1-5]\d\d$/) { - die "Bad response status line: '$status'" unless $laxed; - # assume HTTP/0.9 - ${*$self}{'http_peer_http_version'} = "0.9"; - ${*$self}{'http_status'} = "200"; - substr(${*$self}{'http_buf'}, 0, 0) = $status . $eol; - return 200 unless wantarray; - return (200, "Assumed OK"); - }; - - ${*$self}{'http_peer_http_version'} = $peer_ver; - ${*$self}{'http_status'} = $code; - - my $junk_out; - if ($laxed) { - $junk_out = $opt{junk_out} || []; - } - my @headers = $self->_read_header_lines($junk_out); - - # pick out headers that read_entity_body might need - my @te; - my $content_length; - for (my $i = 0; $i < @headers; $i += 2) { - my $h = lc($headers[$i]); - if ($h eq 'transfer-encoding') { - push(@te, $headers[$i+1]); - } - elsif ($h eq 'content-length') { - $content_length = $headers[$i+1]; - } - } - ${*$self}{'http_te'} = join(",", @te); - ${*$self}{'http_content_length'} = $content_length; - ${*$self}{'http_first_body'}++; - delete ${*$self}{'http_trailers'}; - return $code unless wantarray; - return ($code, $message, @headers); -} - - -sub read_entity_body { - my $self = shift; - my $buf_ref = \$_[0]; - my $size = $_[1]; - die "Offset not supported yet" if $_[2]; - - my $chunked; - my $bytes; - - if (${*$self}{'http_first_body'}) { - ${*$self}{'http_first_body'} = 0; - delete ${*$self}{'http_chunked'}; - delete ${*$self}{'http_bytes'}; - my $method = shift(@{${*$self}{'http_request_method'}}); - my $status = ${*$self}{'http_status'}; - if ($method eq "HEAD" || $status =~ /^(?:1|[23]04)/) { - # these responses are always empty - $bytes = 0; - } - elsif (my $te = ${*$self}{'http_te'}) { - my @te = split(/\s*,\s*/, lc($te)); - die "Chunked must be last Transfer-Encoding '$te'" - unless pop(@te) eq "chunked"; - - for (@te) { - if ($_ eq "deflate" && zlib_ok()) { - #require Compress::Zlib; - my $i = Compress::Zlib::inflateInit(); - die "Can't make inflator" unless $i; - $_ = sub { scalar($i->inflate($_[0])) } - } - elsif ($_ eq "gzip" && zlib_ok()) { - #require Compress::Zlib; - my @buf; - $_ = sub { - push(@buf, $_[0]); - return Compress::Zlib::memGunzip(join("", @buf)) if $_[1]; - return ""; - }; - } - elsif ($_ eq "identity") { - $_ = sub { $_[0] }; - } - else { - die "Can't handle transfer encoding '$te'"; - } - } - - @te = reverse(@te); - - ${*$self}{'http_te2'} = @te ? \@te : ""; - $chunked = -1; - } - elsif (defined(my $content_length = ${*$self}{'http_content_length'})) { - $bytes = $content_length; - } - else { - # XXX Multi-Part types are self delimiting, but RFC 2616 says we - # only has to deal with 'multipart/byteranges' - - # Read until EOF - } - } - else { - $chunked = ${*$self}{'http_chunked'}; - $bytes = ${*$self}{'http_bytes'}; - } - - if (defined $chunked) { - # The state encoded in $chunked is: - # $chunked == 0: read CRLF after chunk, then chunk header - # $chunked == -1: read chunk header - # $chunked > 0: bytes left in current chunk to read - - if ($chunked <= 0) { - my $line = my_readline($self); - if ($chunked == 0) { - die "Missing newline after chunk data: '$line'" unless $line eq ""; - $line = my_readline($self); - } - my $chunk_len = $line; - $chunk_len =~ s/;.*//; # ignore potential chunk parameters - unless ($chunk_len =~ /^([\da-fA-F]+)\s*$/) { - die "Bad chunk-size in HTTP response: $line"; - } - $chunked = hex($1); - if ($chunked == 0) { - ${*$self}{'http_trailers'} = [$self->_read_header_lines]; - $$buf_ref = ""; - - my $n = 0; - if (my $transforms = delete ${*$self}{'http_te2'}) { - for (@$transforms) { - $$buf_ref = &$_($$buf_ref, 1); - } - $n = length($$buf_ref); - } - - # in case somebody tries to read more, make sure we continue - # to return EOF - delete ${*$self}{'http_chunked'}; - ${*$self}{'http_bytes'} = 0; - - return $n; - } - } - - my $n = $chunked; - $n = $size if $size && $size < $n; - $n = my_read($self, $$buf_ref, $n); - return undef unless defined $n; - - ${*$self}{'http_chunked'} = $chunked - $n; - - if ($n > 0) { - if (my $transforms = ${*$self}{'http_te2'}) { - for (@$transforms) { - $$buf_ref = &$_($$buf_ref, 0); - } - $n = length($$buf_ref); - $n = -1 if $n == 0; - } - } - return $n; - } - elsif (defined $bytes) { - unless ($bytes) { - $$buf_ref = ""; - return 0; - } - my $n = $bytes; - $n = $size if $size && $size < $n; - $n = my_read($self, $$buf_ref, $n); - return undef unless defined $n; - ${*$self}{'http_bytes'} = $bytes - $n; - return $n; - } - else { - # read until eof - $size ||= 8*1024; - return my_read($self, $$buf_ref, $size); - } -} - -sub get_trailers { - my $self = shift; - @{${*$self}{'http_trailers'} || []}; -} - -BEGIN { -my $zlib_ok; - -sub zlib_ok { - return $zlib_ok if defined $zlib_ok; - - # Try to load Compress::Zlib. - local $@; - local $SIG{__DIE__}; - $zlib_ok = 0; - - eval { - require Compress::Zlib; - Compress::Zlib->VERSION(1.10); - $zlib_ok++; - }; - - return $zlib_ok; -} - -} # BEGIN - -1; diff --git a/libs/Net/HTTP/NB.pm b/libs/Net/HTTP/NB.pm deleted file mode 100644 index feeee310..00000000 --- a/libs/Net/HTTP/NB.pm +++ /dev/null @@ -1,106 +0,0 @@ -package Net::HTTP::NB; - -# $Id: NB.pm,v 1.5 2001/08/28 03:03:42 gisle Exp $ - -use strict; -use vars qw($VERSION @ISA); - -$VERSION = "0.02"; -require Net::HTTP; -@ISA=qw(Net::HTTP); - -sub sysread { - my $self = $_[0]; - if (${*$self}{'httpnb_read_count'}++) { - ${*$self}{'http_buf'} = ${*$self}{'httpnb_save'}; - die "Multi-read\n"; - } - my $buf; - my $offset = $_[3] || 0; - my $n = sysread($self, $_[1], $_[2], $offset); - ${*$self}{'httpnb_save'} .= substr($_[1], $offset); - return $n; -} - -sub read_response_headers { - my $self = shift; - ${*$self}{'httpnb_read_count'} = 0; - ${*$self}{'httpnb_save'} = ${*$self}{'http_buf'}; - my @h = eval { $self->SUPER::read_response_headers(@_) }; - if ($@) { - return if $@ eq "Multi-read\n"; - die; - } - return @h; -} - -sub read_entity_body { - my $self = shift; - ${*$self}{'httpnb_read_count'} = 0; - ${*$self}{'httpnb_save'} = ${*$self}{'http_buf'}; - # XXX I'm not so sure this does the correct thing in case of - # transfer-encoding tranforms - my $n = eval { $self->SUPER::read_entity_body(@_); }; - if ($@) { - $_[0] = ""; - return -1; - } - return $n; -} - -1; - -__END__ - -=head1 NAME - -Net::HTTP::NB - Non-blocking HTTP client - -=head1 SYNOPSIS - - use Net::HTTP::NB; - my $s = Net::HTTP::NB->new(Host => "www.perl.com) || die $@; - $s->write_request(GET => "/"); - - use IO::Select; - my $sel = IO::Select->new($s); - - READ_HEADER: { - die "Header timeout" unless $sel->can_read(10); - my($code, $mess, %h) = $s->read_response_headers; - redo READ_HEADER unless $code; - } - - while (1) { - die "Body timeout" unless $sel->can_read(10); - my $buf; - my $n = $s->read_entity_body($buf, 1024); - last unless $n; - print $buf; - } - -=head1 DESCRIPTION - -Same interface as C but it will never try multiple reads -when the read_response_headers() or read_entity_body() methods are -invoked. This make it possible to multiplex multiple Net::HTTP::NB -using select without risk blocking. - -If read_response_headers() did not see enough data to complete the -headers an empty list is returned. - -If read_entity_body() did not see new entity data in its read -the value -1 is returned. - -=head1 SEE ALSO - -L - -=head1 COPYRIGHT - -Copyright 2001 Gisle Aas. - -This library is free software; you can redistribute it and/or -modify it under the same terms as Perl itself. - -=cut diff --git a/libs/Net/HTTPS.pm b/libs/Net/HTTPS.pm deleted file mode 100644 index 1549a06d..00000000 --- a/libs/Net/HTTPS.pm +++ /dev/null @@ -1,55 +0,0 @@ -package Net::HTTPS; - -# $Id: HTTPS.pm,v 1.3 2002/12/23 18:16:29 gisle Exp $ - -use strict; -use vars qw($VERSION $SSL_SOCKET_CLASS @ISA); - -$VERSION = "1.00"; - -# Figure out which SSL implementation to use -if ($IO::Socket::SSL::VERSION) { - $SSL_SOCKET_CLASS = "IO::Socket::SSL"; # it was already loaded -} -else { - eval { require Net::SSL; }; # from Crypt-SSLeay - if ($@) { - my $old_errsv = $@; - eval { - require IO::Socket::SSL; - }; - if ($@) { - $old_errsv =~ s/\s\(\@INC contains:.*\)/)/g; - die $old_errsv . $@; - } - $SSL_SOCKET_CLASS = "IO::Socket::SSL"; - } - else { - $SSL_SOCKET_CLASS = "Net::SSL"; - } -} - -require Net::HTTP::Methods; - -@ISA=($SSL_SOCKET_CLASS, 'Net::HTTP::Methods'); - -sub configure { - my($self, $cnf) = @_; - $self->http_configure($cnf); -} - -sub http_connect { - my($self, $cnf) = @_; - $self->SUPER::configure($cnf); -} - -sub http_default_port { - 443; -} - -# The underlying SSLeay classes fails to work if the socket is -# placed in non-blocking mode. This override of the blocking -# method makes sure it stays the way it was created. -sub blocking { } # noop - -1; diff --git a/libs/Net/MySQL.pm b/libs/Net/MySQL.pm deleted file mode 100644 index e6a92c80..00000000 --- a/libs/Net/MySQL.pm +++ /dev/null @@ -1,1015 +0,0 @@ -package Net::MySQL; - -use 5.004; -use IO::Socket; -use Carp; -use vars qw($VERSION $DEBUG); -use strict; -$VERSION = '0.08'; - -use constant COMMAND_SLEEP => "\x00"; -use constant COMMAND_QUIT => "\x01"; -use constant COMMAND_INIT_DB => "\x02"; -use constant COMMAND_QUERY => "\x03"; -use constant COMMAND_FIELD_LIST => "\x04"; -use constant COMMAND_CREATE_DB => "\x05"; -use constant COMMAND_DROP_DB => "\x06"; -use constant COMMAND_REFRESH => "\x07"; -use constant COMMAND_SHUTDOWN => "\x08"; -use constant COMMAND_STATISTICS => "\x09"; -use constant COMMAND_PROCESS_INFO => "\x0A"; -use constant COMMAND_CONNECT => "\x0B"; -use constant COMMAND_PROCESS_KILL => "\x0C"; -use constant COMMAND_DEBUG => "\x0D"; -use constant COMMAND_PING => "\x0E"; -use constant COMMAND_TIME => "\x0F"; -use constant COMMAND_DELAYED_INSERT => "\x10"; -use constant COMMAND_CHANGE_USER => "\x11"; -use constant COMMAND_BINLOG_DUMP => "\x12"; -use constant COMMAND_TABLE_DUMP => "\x13"; -use constant COMMAND_CONNECT_OUT => "\x14"; - -use constant DEFAULT_PORT_NUMBER => 3306; -use constant BUFFER_LENGTH => 1460; -use constant DEFAULT_UNIX_SOCKET => '/tmp/mysql.sock'; - - -sub new -{ - my $class = shift; - my %args = @_; - - my $self = bless { - hostname => $args{hostname}, - unixsocket => $args{unixsocket} || DEFAULT_UNIX_SOCKET, - port => $args{port} || DEFAULT_PORT_NUMBER, - database => $args{database}, - user => $args{user}, - password => $args{password}, - timeout => $args{timeout} || 60, - socket => undef, - salt => '', - protocol_version => undef, - client_capabilities => 0, - affected_rows_length => 0, - }, $class; - $self->debug($args{debug}); - $self->_initialize; - return $self; -} - - -sub query -{ - my $self = shift; - my $sql = join '', @_; - my $mysql = $self->{socket}; - - return $self->_execute_command(COMMAND_QUERY, $sql); -} - - -sub create_database -{ - my $self = shift; - my $db_name = shift; - my $mysql = $self->{socket}; - - return $self->_execute_command(COMMAND_CREATE_DB, $db_name); -} - - -sub drop_database -{ - my $self = shift; - my $db_name = shift; - my $mysql = $self->{socket}; - - return $self->_execute_command(COMMAND_DROP_DB, $db_name); -} - - -sub close -{ - my $self = shift; - my $mysql = $self->{socket}; - return unless $mysql->can('send'); - - my $quit_message = - chr(length(COMMAND_QUIT)). "\x00\x00\x00". COMMAND_QUIT; - $mysql->send($quit_message, 0); - $self->_dump_packet($quit_message) if Net::MySQL->debug; - $mysql->close; -} - - -sub get_affected_rows_length -{ - my $self = shift; - $self->{affected_rows_length}; -} - - -sub get_insert_id -{ - my $self = shift; - $self->{insert_id}; -} - - -sub create_record_iterator -{ - my $self = shift; - return undef unless $self->has_selected_record; - - my $record = Net::MySQL::RecordIterator->new( - $self->{selected_record} - ); - $self->{selected_record} = undef; - $record->parse; - return $record; -} - - -sub has_selected_record -{ - my $self = shift; - $self->{selected_record} ? 1 : undef; -} - - -sub is_error -{ - my $self = shift; - $self->{error_code} ? 1 : undef; -} - - -sub get_error_code -{ - my $self = shift; - $self->{error_code}; -} - - -sub get_error_message -{ - my $self = shift; - $self->{server_message}; -} - - -sub debug -{ - my $class = shift; - $DEBUG = shift if @_; - $DEBUG; -} - - -sub _connect -{ - my $self = shift; - - my $mysql; - if ($self->{hostname}) { - printf "Use INET Socket: %s %d/tcp\n", $self->{hostname}, $self->{port} - if $self->debug; - $mysql = IO::Socket::INET->new( - PeerAddr => $self->{hostname}, - PeerPort => $self->{port}, - Proto => 'tcp', - Timeout => $self->{timeout} || 60, - ) or croak "Couldn't connect to $self->{hostname}:$self->{port}/tcp: $@"; - } - else { - printf "Use UNIX Socket: %s\n", $self->{unixsocket} if $self->debug; - $mysql = IO::Socket::UNIX->new( - Type => SOCK_STREAM, - Peer => $self->{unixsocket}, - ) or croak "Couldn't connect to $self->{unixsocket}: $@"; - } - $mysql->autoflush(1); - $self->{socket} = $mysql; -} - - -sub _get_server_information -{ - my $self = shift; - my $mysql = $self->{socket}; - - my $message; - $mysql->recv($message, BUFFER_LENGTH, 0); - $self->_dump_packet($message) - if Net::MySQL->debug; - my $i = 0; - my $packet_length = ord substr $message, $i, 1; - $i += 4; - $self->{protocol_version} = ord substr $message, $i, 1; - printf "Protocol Version: %d\n", $self->{protocol_version} - if Net::MySQL->debug; - if ($self->{protocol_version} == 10) { - $self->{client_capabilities} = 1; - } - - ++$i; - my $string_end = index($message, "\0", $i) - $i; - $self->{server_version} = substr $message, $i, $string_end; - printf "Server Version: %s\n", $self->{server_version} - if Net::MySQL->debug; - - $i += $string_end + 1; - $self->{server_thread_id} = unpack 'v', substr $message, $i, 2; - $i += 4; - $self->{salt} = substr $message, $i, 8; - printf "Salt: %s\n", $self->{salt} if Net::MySQL->debug; -} - - -sub _request_authentication -{ - my $self = shift; - my $mysql = $self->{socket}; - $self->_send_login_message(); - - my $auth_result; - $mysql->recv($auth_result, BUFFER_LENGTH, 0); - $self->_dump_packet($auth_result) if Net::MySQL->debug; - if ($self->_is_error($auth_result)) { - $mysql->close; - if (length $auth_result < 7) { - croak "Timeout of authentication"; - } - croak substr $auth_result, 7; - } - print "connect database\n" if Net::MySQL->debug; -} - - -sub _send_login_message -{ - my $self = shift; - my $mysql = $self->{socket}; - - my $body = "\0\0\x01\x8d\x00\00\00\00". join "\0", - $self->{user}, - Net::MySQL::Password->scramble( - $self->{password}, $self->{salt}, $self->{client_capabilities} - ), - $self->{database}; - my $login_message = chr(length($body)-3). $body; - $mysql->send($login_message, 0); - $self->_dump_packet($login_message) if Net::MySQL->debug; -} - - - -sub _execute_command -{ - my $self = shift; - my $command = shift; - my $sql = shift; - my $mysql = $self->{socket}; - - my $message = pack('V', length($sql) + 1). $command. $sql; - - $mysql->send($message, 0); - $self->_dump_packet($message) if Net::MySQL->debug; - - my $result; - $mysql->recv($result, BUFFER_LENGTH, 0); - $self->_dump_packet($result) if Net::MySQL->debug; - $self->_reset_status; - - if ($self->_is_error($result)) { - return $self->_set_error_by_packet($result); - } - elsif ($self->_is_select_query_result($result)) { - return $self->_get_record_by_server($result); - } - elsif ($self->_is_update_query_result($result)){ - return $self->_get_affected_rows_information_by_packet($result); - } - else { - croak 'Unknown Result: '. $self->_get_result_length($result). 'byte'; - } -} - - -sub _initialize -{ - my $self = shift; - $self->_connect; - $self->_get_server_information; - $self->_request_authentication; -} - - -sub _set_error_by_packet -{ - my $self = shift; - my $packet = shift; - - my $error_message = $self->_get_server_message($packet); - $self->{server_message} = $error_message; - $self->{error_code} = $self->_get_error_code($packet); - return undef; -} - - -sub _get_record_by_server -{ - my $self = shift; - my $packet = shift; - my $mysql = $self->{socket}; - - $self->_get_column_length($packet); - while ($self->_has_next_packet($packet)) { - my $next_result; - $mysql->recv($next_result, BUFFER_LENGTH, 0); - $packet .= $next_result; - $self->_dump_packet($next_result) if Net::MySQL->debug; - } - $self->{selected_record} = $packet; -} - - -sub _get_affected_rows_information_by_packet -{ - my $self = shift; - my $packet = shift; - - $self->{affected_rows_length} = $self->_get_affected_rows_length($packet); - $self->{insert_id} = $self->_get_insert_id($packet); - $self->{server_message} = $self->_get_server_message($packet); - return $self->{affected_rows_length}; -} - - -sub _is_error -{ - my $self = shift; - my $packet = shift; - return 1 if length $packet < 4; - ord(substr $packet, 4) == 255; -} - - -sub _is_select_query_result -{ - my $self = shift; - my $packet = shift; - return undef if $self->_is_error($packet); - ord(substr $packet, 4) >= 1; -} - - -sub _is_update_query_result -{ - my $self = shift; - my $packet = shift; - return undef if $self->_is_error($packet); - ord(substr $packet, 4) == 0; -} - - -sub _get_result_length -{ - my $self = shift; - my $packet = shift; - ord(substr $packet, 0, 1) -} - - -sub _get_column_length -{ - my $self = shift; - my $packet = shift; - ord(substr $packet, 4); -} - - -sub _get_affected_rows_length -{ - my $self = shift; - my $packet = shift; - ord(substr $packet, 5, 1); -} - - -sub _get_insert_id -{ - my $self = shift; - my $packet = shift; - return ord(substr $packet, 6, 1) if ord(substr $packet, 6, 1) != 0xfc; - unpack 'v', substr $packet, 7, 2; -} - - -sub _get_server_message -{ - my $self = shift; - my $packet = shift; - return '' if length $packet < 7; - substr $packet, 7; -} - - -sub _get_error_code -{ - my $self = shift; - my $packet = shift; - $self->_is_error($packet) - or croak "_get_error_code(): Is not error packet"; - unpack 'v', substr $packet, 5, 2; -} - - -sub _reset_status -{ - my $self = shift; - $self->{insert_id} = 0; - $self->{server_message} = ''; - $self->{error_code} = undef; - $self->{selected_record} = undef; -} - - -sub _has_next_packet -{ - my $self = shift; - substr($_[0], -1) ne "\xfe"; -} - - -sub _dump_packet -{ - my $self = shift; - my $packet = shift; - - my ($method_name) = (caller(1))[3]; - printf "%s():\n%s\n", - $method_name, - join ' ', map { sprintf "%02x", ord $_ } split //, $packet; - printf "%s():\n%s\n", - $method_name, - join ' ', map { m/[\d \w\._]/ ? $_ : '.' } split //, $packet; - print "--\n"; -} - - - -package Net::MySQL::RecordIterator; -use strict; - -use constant NULL_COLUMN => 251; -use constant UNSIGNED_CHAR_COLUMN => 251; -use constant UNSIGNED_SHORT_COLUMN => 252; -use constant UNSIGNED_INT24_COLUMN => 253; -use constant UNSIGNED_INT32_COLUMN => 254; -use constant UNSIGNED_CHAR_LENGTH => 1; -use constant UNSIGNED_SHORT_LENGTH => 2; -use constant UNSIGNED_INT24_LENGTH => 3; -use constant UNSIGNED_INT32_LENGTH => 4; -use constant UNSIGNED_INT32_PAD_LENGTH => 4; - - -sub new -{ - my $class = shift; - my $packet = shift; - bless { - packet => $packet, - position => 0, - column => [], - }, $class; -} - - -sub parse -{ - my $self = shift; - $self->_get_column_length; - $self->_get_column_name; -} - - -sub each -{ - my $self = shift; - my @result; - return undef if $self->is_end_of_packet; - - for (1..$self->{column_length}) { - push @result, $self->_get_string_and_seek_position; - } - $self->{position} += 4; - return \@result; -} - - -sub is_end_of_packet -{ - my $self = shift; - length $self->{packet} <= $self->{position} + 1; -} - - -sub get_field_length -{ - my $self = shift; - $self->{column_length}; -} - - -sub get_field_names -{ - my $self = shift; - map { $_->{column} } @{$self->{column}}; -} - - -sub _get_column_length -{ - my $self = shift; - $self->{position} += 4; - $self->{column_length} = ord substr $self->{packet}, $self->{position}, 1; - $self->{position} += 5; - printf "Column Length: %d\n", $self->{column_length} - if Net::MySQL->debug; -} - - -sub _get_column_name -{ - my $self = shift; - for my $i (1.. $self->{column_length}) { - push @{$self->{column}}, { - table => $self->_get_string_and_seek_position, - column => $self->_get_string_and_seek_position, - }; - $self->{position} += 14; - } - $self->{position} += 5; - - printf "Column name: %s\n", - join ", ", map { $_->{column} } @{$self->{column}} - if Net::MySQL->debug; -} - - -sub _get_string_and_seek_position -{ - my $self = shift; - - my $length = $self->_get_field_length(); - return undef unless defined $length; - - my $string = substr $self->{packet}, $self->{position}, $length; - $self->{position} += $length; - return $string; -} - - -sub _get_field_length -{ - my $self = shift; - - my $head = ord substr( - $self->{packet}, - $self->{position}, - UNSIGNED_CHAR_LENGTH - ); - $self->{position} += UNSIGNED_CHAR_LENGTH; - - return undef if $head == NULL_COLUMN; - if ($head < UNSIGNED_CHAR_COLUMN) { - return $head; - } - elsif ($head == UNSIGNED_SHORT_COLUMN) { - warn "in short"; - my $length = unpack 'v', substr( - $self->{packet}, - $self->{position}, - UNSIGNED_SHORT_LENGTH - ); - $self->{position} += UNSIGNED_SHORT_LENGTH; - return $length; - } - elsif ($head == UNSIGNED_INT24_COLUMN) { - warn "in int23"; - my $int24 = substr( - $self->{packet}, $self->{position}, - UNSIGNED_INT24_LENGTH - ); - my $length = unpack('C', substr($int24, 0, 1)) - + (unpack('C', substr($int24, 1, 1)) << 8) - + (unpack('C', substr($int24, 2, 1)) << 16); - $self->{position} += UNSIGNED_INT24_LENGTH; - return $length; - } - else { - warn "in int32"; - my $int32 = substr( - $self->{packet}, $self->{position}, - UNSIGNED_INT32_LENGTH - ); - my $length = unpack('C', substr($int32, 0, 1)) - + (unpack('C', substr($int32, 1, 1)) << 8) - + (unpack('C', substr($int32, 2, 1)) << 16) - + (unpack('C', substr($int32, 3, 1)) << 24); - $self->{position} += UNSIGNED_INT32_LENGTH; - $self->{position} += UNSIGNED_INT32_PAD_LENGTH; - return $length; - } -} - - -package Net::MySQL::Password; -use strict; - -sub scramble -{ - my $class = shift; - my $password = shift; - my $hash_seed = shift; - my $client_capabilities = shift; - - return '' unless $password; - return '' if length $password == 0; - - my $hsl = length $hash_seed; - my @out; - my @hash_pass = _get_hash($password); - my @hash_mess = _get_hash($hash_seed); - - my ($max_value, $seed, $seed2); - my ($dRes, $dSeed, $dMax); - if ($client_capabilities < 1) { - $max_value = 0x01FFFFFF; - $seed = _xor_by_long($hash_pass[0], $hash_mess[0]) % $max_value; - $seed2 = int($seed / 2); - } else { - $max_value= 0x3FFFFFFF; - $seed = _xor_by_long($hash_pass[0], $hash_mess[0]) % $max_value; - $seed2 = _xor_by_long($hash_pass[1], $hash_mess[1]) % $max_value; - } - $dMax = $max_value; - - for (my $i=0; $i < $hsl; $i++) { - $seed = int(($seed * 3 + $seed2) % $max_value); - $seed2 = int(($seed + $seed2 + 33) % $max_value); - $dSeed = $seed; - $dRes = $dSeed / $dMax; - push @out, int($dRes * 31) + 64; - } - - if ($client_capabilities == 1) { - # Make it harder to break - $seed = ($seed * 3 + $seed2 ) % $max_value; - $seed2 = ($seed + $seed2 + 33 ) % $max_value; - $dSeed = $seed; - - $dRes = $dSeed / $dMax; - my $e = int($dRes * 31); - for (my $i=0; $i < $hsl ; $i++) { - $out[$i] ^= $e; - } - } - return join '', map { chr $_ } @out; -} - - -sub _get_hash -{ - my $password = shift; - - my $nr = 1345345333; - my $add = 7; - my $nr2 = 0x12345671; - my $tmp; - my $pwlen = length $password; - my $c; - - for (my $i=0; $i < $pwlen; $i++) { - my $c = substr $password, $i, 1; - next if $c eq ' ' || $c eq "\t"; - my $tmp = ord $c; - my $value = ((_and_by_char($nr, 63) + $add) * $tmp) + $nr * 256; - $nr = _xor_by_long($nr, $value); - $nr2 += _xor_by_long(($nr2 * 256), $nr); - $add += $tmp; - } - return (_and_by_long($nr, 0x7fffffff), _and_by_long($nr2, 0x7fffffff)); -} - - -sub _and_by_char -{ - my $source = shift; - my $mask = shift; - - return $source & $mask; -} - - -sub _and_by_long -{ - my $source = shift; - my $mask = shift || 0xFFFFFFFF; - - return _cut_off_to_long($source) & _cut_off_to_long($mask); -} - - -sub _xor_by_long -{ - my $source = shift; - my $mask = shift || 0; - - return _cut_off_to_long($source) ^ _cut_off_to_long($mask); -} - - -sub _cut_off_to_long -{ - my $source = shift; - - if ($] >= 5.006) { - $source = $source % (0xFFFFFFFF + 1) if $source > 0xFFFFFFFF; - return $source; - } - while ($source > 0xFFFFFFFF) { - $source -= 0xFFFFFFFF + 1; - } - return $source; -} - - -1; -__END__ - -=head1 NAME - -Net::MySQL - Pure Perl MySQL network protocol interface. - -=head1 SYNOPSIS - - use Net::MySQL; - - my $mysql = Net::MySQL->new( - # hostname => 'mysql.example.jp', # Default use UNIX socket - database => 'your_database_name', - user => 'user', - password => 'password' - ); - - # INSERT example - $mysql->query(q{ - INSERT INTO tablename (first, next) VALUES ('Hello', 'World') - }); - printf "Affected row: %d\n", $mysql->get_affected_rows_length; - - # SLECT example - $mysql->query(q{SELECT * FROM tablename}); - my $record_set = $mysql->create_record_iterator; - while (my $record = $record_set->each) { - printf "First column: %s Next column: %s\n", - $record->[0], $record->[1]; - } - $mysql->close; - -=head1 DESCRIPTION - -Net::MySQL is a Pure Perl client interface for the MySQL database. This module implements network protocol between server and client of MySQL, thus you don't need external MySQL client library like libmysqlclient for this module to work. It means this module enables you to connect to MySQL server from some operation systems which MySQL is not ported. How nifty! - -Since this module's final goal is to completely replace DBD::mysql, API is made similar to that of DBI. - -From perl you activate the interface with the statement - - use Net::MySQL; - -After that you can connect to multiple MySQL daemon and send multiple queries to any of them via a simple object oriented interface. - -There are two classes which have public APIs: Net::MySQL and Net::MySQL::RecordIterator. - - $mysql = Net::MySQL->new( - hostname => $host, - database => $database, - user => $user, - password => $password, - ); - -Once you have connected to a daemon, you can can execute SQL with: - - $mysql->query(q{ - INSERT INTO foo (id, message) VALUES (1, 'Hello World') - }); - -If you want to retrieve results, you need to create a so-called statement handle with: - - $mysql->query(q{ - SELECT id, message FROM foo - }); - if ($mysql->has_selected_record) { - my $a_record_iterator = $mysql->create_record_iterator; - # ... - } - -This Net::MySQL::RecordIterator object can be used for multiple purposes. First of all you can retreive a row of data: - - my $record = $a_record_iterator->each; - -The each() method takes out the reference result of one line at a time, and the return value is ARRAY reference. - -=head2 Net::MySQL API - -=over 4 - -=item new(HASH) - - use Net::MySQL; - use strict; - - my $mysql = Net::MySQL->new( - unixsocket => $path_to_socket, - hostname => $host, - database => $database, - user => $user, - password => $password, - ); - -The constructor of Net::MySQL. Connection with MySQL daemon is established and the object is returned. Argument hash contains following parameters: - -=over 8 - -=item unixsocket - -Path of the UNIX socket where MySQL daemon. default is F. -Supposing I is omitted, it will connect by I. - -=item hostname - -Name of the host where MySQL daemon runs. -Supposing I is specified, it will connect by I. - -=item port - -Port where MySQL daemon listens to. default is 3306. - -=item database - -Name of the database to connect. - -=item user / password - -Username and password for database authentication. - -=item timeout - -The waiting time which carries out a timeout when connection is overdue is specified. - -=item debug - -The exchanged packet will be outputted if a true value is given. - -=back - - -=item create_database(DB_NAME) - -A create_DATABASE() method creates a database by the specified name. - - $mysql->create_database('example_db'); - die $mysql->get_error_message if $mysql->is_error; - -=item drop_database(DB_NAME) - -A drop_database() method deletes the database of the specified name. - - $mysql->drop_database('example_db'); - die $mysql->get_error_message if $mysql->is_error; - -=item query(SQL_STRING) - -A query() method transmits the specified SQL string to MySQL database, and obtains the response. - -=item create_record_iterator() - -When SELECT type SQL is specified, Net::MySQL::RecordIterator object which shows the reference result is returned. - - $mysql->query(q{SELECT * FROM table}); - my $a_record_iterator = $mysql->create_recrod_iterator(); - -Net::MySQL::RecordIterator object is applicable to acquisition of a reference result. See L<"/Net::SQL::RecordIterator API"> for more. - -=item get_affected_rows_length() - -returns the number of records finally influenced by specified SQL. - - my $affected_rows = $mysql->get_affected_rows_length; - -=item get_insert_id() - -MySQL has the ability to choose unique key values automatically. If this happened, the new ID will be stored in this attribute. - -=item is_error() - -TRUE will be returned if the error has occurred. - -=item has_selected_record() - -TRUE will be returned if it has a reference result by SELECT. - -=item get_field_length() - -return the number of column. - -=item get_field_names() - -return column names by ARRAY. - -=item close() - -transmits an end message to MySQL daemon, and closes a socket. - -=back - -=head2 Net::MySQL::RecordIterator API - -Net::MySQL::RecordIterator object is generated by the query() method of Net::MySQL object. Thus it has no public constructor method. - -=over 4 - -=item each() - -each() method takes out only one line from a result, and returns it as an ARRAY reference. C is returned when all the lines has been taken out. - - while (my $record = $a_record_iterator->each) { - printf "Column 1: %s Column 2: %s Collumn 3: %s\n", - $record->[0], $record->[1], $record->[2]; - } - -=back - -=head1 SUPPORT OPERATING SYSTEM - -This module has been tested on these OSes. - -=over 4 - -=item * MacOS 9.x - -with MacPerl5.6.1r. - -=item * MacOS X - -with perl5.6.0 build for darwin. - -=item * Windows2000 - -with ActivePerl5.6.1 build631. - -=item * FreeBSD 3.4 and 4.x - -with perl5.6.1 build for i386-freebsd. - -with perl5.005_03 build for i386-freebsd. - -=item * Linux - -with perl 5.005_03 built for ppc-linux. - -with perl 5.6.0 bult for i386-linux. - -=item * Solaris 2.6 (SPARC) - -with perl 5.6.1 built for sun4-solaris. - -with perl 5.004_04 built for sun4-solaris. - -Can use on Solaris2.6 with perl5.004_04, although I is failure. - -=back - -This list is the environment which I can use by the test usually. Net::MySQL will operate also in much environment which is not in a list. - -I believe this module can work with whatever perls which has B. I'll be glad if you give me a report of successful installation of this module on I OSes. - -=head1 SEE ALSO - -L, L - -=head1 AUTHOR - -Hiroyuki OYAMA Eoyama@module.jpE - -=head1 COPYRIGHT AND LICENCE - -Copyright (C) 2002 Hiroyuki OYAMA. Japan. All rights reserved. - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut diff --git a/libs/Net/SSH.pm b/libs/Net/SSH.pm deleted file mode 100644 index 41f87f1f..00000000 --- a/libs/Net/SSH.pm +++ /dev/null @@ -1,255 +0,0 @@ -package Net::SSH; - -use strict; -use vars qw($VERSION @ISA @EXPORT_OK $ssh $equalspace $DEBUG @ssh_options); -use Exporter; -use IO::File; -use IPC::Open2; -use IPC::Open3; - -@ISA = qw(Exporter); -@EXPORT_OK = qw( ssh issh ssh_cmd sshopen2 sshopen3 ); -$VERSION = '0.07'; - -$DEBUG = 0; - -$ssh = "ssh"; - -=head1 NAME - -Net::SSH - Perl extension for secure shell - -=head1 SYNOPSIS - - use Net::SSH qw(ssh issh sshopen2 sshopen3); - - ssh('user@hostname', $command); - - issh('user@hostname', $command); - - ssh_cmd('user@hostname', $command); - ssh_cmd( { - user => 'user', - host => 'host.name', - command => 'command', - args => [ '-arg1', '-arg2' ], - stdin_string => "string\n", - } ); - - sshopen2('user@hostname', $reader, $writer, $command); - - sshopen3('user@hostname', $writer, $reader, $error, $command); - -=head1 DESCRIPTION - -Simple wrappers around ssh commands. - -For an all-perl implementation that does not require the system B command, -see L instead. - -=head1 SUBROUTINES - -=over 4 - -=item ssh [USER@]HOST, COMMAND [, ARGS ... ] - -Calls ssh in batch mode. - -=cut - -sub ssh { - my($host, @command) = @_; - @ssh_options = &_ssh_options unless @ssh_options; - my @cmd = ($ssh, @ssh_options, $host, @command); - warn "[Net::SSH::ssh] executing ". join(' ', @cmd). "\n" - if $DEBUG; - system(@cmd); -} - -=item issh [USER@]HOST, COMMAND [, ARGS ... ] - -Prints the ssh command to be executed, waits for the user to confirm, and -(optionally) executes the command. - -=cut - -sub issh { - my($host, @command) = @_; - my @cmd = ($ssh, $host, @command); - print join(' ', @cmd), "\n"; - if ( &_yesno ) { - system(@cmd); - } -} - -=item ssh_cmd [USER@]HOST, COMMAND [, ARGS ... ] - -=item ssh_cmd OPTIONS_HASHREF - -Calls ssh in batch mode. Throws a fatal error if data occurs on the command's -STDERR. Returns any data from the command's STDOUT. - -If using the hashref-style of passing arguments, possible keys are: - - user (optional) - host (requried) - command (required) - args (optional, arrayref) - stdin_string (optional) - written to the command's STDIN - -=cut - -sub ssh_cmd { - my($host, $stdin_string, @command); - if ( ref($_[0]) ) { - my $opt = shift; - $host = $opt->{host}; - $host = $opt->{user}. '@'. $host if exists $opt->{user}; - @command = ( $opt->{command} ); - push @command, @{ $opt->{args} } if exists $opt->{args}; - $stdin_string = $opt->{stdin_string}; - } else { - ($host, @command) = @_; - undef $stdin_string; - } - - my $reader = IO::File->new(); - my $writer = IO::File->new(); - my $error = IO::File->new(); - - sshopen3( $host, $writer, $reader, $error, @command ) or die $!; - - print $writer $stdin_string if defined $stdin_string; - close $writer; - - local $/ = undef; - my $output_stream = <$reader>; - my $error_stream = <$error>; - - if ( length $error_stream ) { - die "[Net:SSH::ssh_cmd] STDERR $error_stream"; - } - - return $output_stream; - -} - -=item sshopen2 [USER@]HOST, READER, WRITER, COMMAND [, ARGS ... ] - -Connects the supplied filehandles to the ssh process (in batch mode). - -=cut - -sub sshopen2 { - my($host, $reader, $writer, @command) = @_; - @ssh_options = &_ssh_options unless @ssh_options; - open2($reader, $writer, $ssh, @ssh_options, $host, @command); -} - -=item sshopen3 HOST, WRITER, READER, ERROR, COMMAND [, ARGS ... ] - -Connects the supplied filehandles to the ssh process (in batch mode). - -=cut - -sub sshopen3 { - my($host, $writer, $reader, $error, @command) = @_; - @ssh_options = &_ssh_options unless @ssh_options; - open3($writer, $reader, $error, $ssh, @ssh_options, $host, @command); -} - -sub _yesno { - print "Proceed [y/N]:"; - my $x = scalar(); - $x =~ /^y/i; -} - -sub _ssh_options { - my $reader = IO::File->new(); - my $writer = IO::File->new(); - my $error = IO::File->new(); - open3($writer, $reader, $error, $ssh, '-V'); - my $ssh_version = <$error>; - chomp($ssh_version); - if ( $ssh_version =~ /.*OpenSSH[-|_](\w+)\./ && $1 == 1 ) { - $equalspace = " "; - } else { - $equalspace = "="; - } - my @options = ( '-o', 'BatchMode'.$equalspace.'yes' ); - if ( $ssh_version =~ /.*OpenSSH[-|_](\w+)\./ && $1 > 1 ) { - unshift @options, '-T'; - } - @options; -} - -=back - -=head1 EXAMPLE - - use Net::SSH qw(sshopen2); - use strict; - - my $user = "username"; - my $host = "hostname"; - my $cmd = "command"; - - sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: $!"; - - while () { - chomp(); - print "$_\n"; - } - - close(READER); - close(WRITER); - -=head1 FREQUENTLY ASKED QUESTIONS - -Q: How do you supply a password to connect with ssh within a perl script -using the Net::SSH module? - -A: You don't. Use RSA or DSA keys. See the ssh-keygen(1) manpage. - -Q: My script is "leaking" ssh processes. - -A: See L, L, -L and L. - -=head1 AUTHORS - -Ivan Kohler - -John Harrison contributed an example for the documentation. - -Martin Langhoff contributed the ssh_cmd command, and -Jeff Finucane updated it and took care of the 0.04 release. - -Anthony Awtrey contributed a fix for those still using -OpenSSH v1. - -=head1 COPYRIGHT - -Copyright (c) 2002 Ivan Kohler. -Copyright (c) 2002 Freeside Internet Services, LLC -All rights reserved. -This program is free software; you can redistribute it and/or modify it under -the same terms as Perl itself. - -=head1 BUGS - -Not OO. - -Look at IPC::Session (also fsh) - -=head1 SEE ALSO - -For an all-perl implementation that does not require the system B command, -see L instead. - -ssh-keygen(1), ssh(1), L, L, L - -=cut - -1; - diff --git a/libs/Net/Telnet.pm b/libs/Net/Telnet.pm deleted file mode 100644 index 9f84fe31..00000000 --- a/libs/Net/Telnet.pm +++ /dev/null @@ -1,5252 +0,0 @@ -package Net::Telnet; - -## Copyright 1997, 2000, 2002 Jay Rogers. All rights reserved. -## This program is free software; you can redistribute it and/or -## modify it under the same terms as Perl itself. - -## See user documentation at the end of this file. Search for =head - -use strict; -require 5.002; - -## Module export. -use vars qw(@EXPORT_OK); -@EXPORT_OK = qw(TELNET_IAC TELNET_DONT TELNET_DO TELNET_WONT TELNET_WILL - TELNET_SB TELNET_GA TELNET_EL TELNET_EC TELNET_AYT TELNET_AO - TELNET_IP TELNET_BREAK TELNET_DM TELNET_NOP TELNET_SE - TELNET_EOR TELNET_ABORT TELNET_SUSP TELNET_EOF TELNET_SYNCH - TELOPT_BINARY TELOPT_ECHO TELOPT_RCP TELOPT_SGA TELOPT_NAMS - TELOPT_STATUS TELOPT_TM TELOPT_RCTE TELOPT_NAOL TELOPT_NAOP - TELOPT_NAOCRD TELOPT_NAOHTS TELOPT_NAOHTD TELOPT_NAOFFD - TELOPT_NAOVTS TELOPT_NAOVTD TELOPT_NAOLFD TELOPT_XASCII - TELOPT_LOGOUT TELOPT_BM TELOPT_DET TELOPT_SUPDUP - TELOPT_SUPDUPOUTPUT TELOPT_SNDLOC TELOPT_TTYPE TELOPT_EOR - TELOPT_TUID TELOPT_OUTMRK TELOPT_TTYLOC TELOPT_3270REGIME - TELOPT_X3PAD TELOPT_NAWS TELOPT_TSPEED TELOPT_LFLOW - TELOPT_LINEMODE TELOPT_XDISPLOC TELOPT_OLD_ENVIRON - TELOPT_AUTHENTICATION TELOPT_ENCRYPT TELOPT_NEW_ENVIRON - TELOPT_EXOPL); - -## Module import. -use Exporter (); -use Socket qw(AF_INET SOCK_STREAM inet_aton sockaddr_in); -use Symbol qw(qualify); - -## Base classes. -use vars qw(@ISA); -@ISA = qw(Exporter); -if (&_io_socket_include) { # successfully required module IO::Socket - push @ISA, "IO::Socket::INET"; -} -else { # perl version < 5.004 - require FileHandle; - push @ISA, "FileHandle"; -} - -## Global variables. -use vars qw($VERSION @Telopts); -$VERSION = "3.03"; -@Telopts = ("BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", "STATUS", - "TIMING MARK", "RCTE", "NAOL", "NAOP", "NAOCRD", "NAOHTS", - "NAOHTD", "NAOFFD", "NAOVTS", "NAOVTD", "NAOLFD", "EXTEND ASCII", - "LOGOUT", "BYTE MACRO", "DATA ENTRY TERMINAL", "SUPDUP", - "SUPDUP OUTPUT", "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD", - "TACACS UID", "OUTPUT MARKING", "TTYLOC", "3270 REGIME", "X.3 PAD", - "NAWS", "TSPEED", "LFLOW", "LINEMODE", "XDISPLOC", "OLD-ENVIRON", - "AUTHENTICATION", "ENCRYPT", "NEW-ENVIRON"); - - -########################### Public Methods ########################### - - -sub new { - my ($class) = @_; - my ( - $errmode, - $fh_open, - $host, - $self, - %args, - ); - local $_; - - ## Create a new object with defaults. - $self = $class->SUPER::new; - *$self->{net_telnet} = { - bin_mode => 0, - blksize => &_optimal_blksize(), - buf => "", - cmd_prompt => '/[\$%#>] $/', - cmd_rm_mode => "auto", - dumplog => '', - eofile => 1, - errormode => "die", - errormsg => "", - fdmask => '', - host => "localhost", - inputlog => '', - last_line => "", - last_prompt => "", - maxbufsize => 1_048_576, - num_wrote => 0, - ofs => "", - opened => '', - opt_cback => '', - opt_log => '', - opts => {}, - ors => "\n", - outputlog => '', - pending_errormsg => "", - port => 23, - pushback_buf => "", - rs => "\n", - subopt_cback => '', - telnet_mode => 1, - time_out => 10, - timedout => '', - unsent_opts => "", - }; - - ## Indicate that we'll accept an offer from remote side for it to echo - ## and suppress go aheads. - &_opt_accept($self, - { option => &TELOPT_ECHO, - is_remote => 1, - is_enable => 1 }, - { option => &TELOPT_SGA, - is_remote => 1, - is_enable => 1 }, - ); - - ## Parse the args. - if (@_ == 2) { # one positional arg given - $host = $_[1]; - } - elsif (@_ > 2) { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse all other named args. - foreach (keys %args) { - if (/^-?binmode$/i) { - $self->binmode($args{$_}); - } - elsif (/^-?cmd_remove_mode$/i) { - $self->cmd_remove_mode($args{$_}); - } - elsif (/^-?dump_log$/i) { - $self->dump_log($args{$_}); - } - elsif (/^-?errmode$/i) { - $errmode = $args{$_}; - } - elsif (/^-?fhopen$/i) { - $fh_open = $args{$_}; - } - elsif (/^-?host$/i) { - $host = $args{$_}; - } - elsif (/^-?input_log$/i) { - $self->input_log($args{$_}); - } - elsif (/^-?input_record_separator$/i or /^-?rs$/i) { - $self->input_record_separator($args{$_}); - } - elsif (/^-?option_log$/i) { - $self->option_log($args{$_}); - } - elsif (/^-?output_log$/i) { - $self->output_log($args{$_}); - } - elsif (/^-?output_record_separator$/i or /^-?ors$/i) { - $self->output_record_separator($args{$_}); - } - elsif (/^-?port$/i) { - $self->port($args{$_}); - } - elsif (/^-?prompt$/i) { - $self->prompt($args{$_}); - } - elsif (/^-?telnetmode$/i) { - $self->telnetmode($args{$_}); - } - elsif (/^-?timeout$/i) { - $self->timeout($args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::new()"); - } - } - } - - if (defined $errmode) { # user wants to set errmode - $self->errmode($errmode); - } - - if (defined $fh_open) { # user wants us to attach to existing filehandle - $self->fhopen($fh_open) - or return; - } - elsif (defined $host) { # user wants us to open a connection to host - $self->host($host); - $self->open - or return; - } - - $self; -} # end sub new - - -sub DESTROY { -} # end sub DESTROY - - -sub binmode { - my ($self, $mode) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{bin_mode}; - - if (@_ >= 2) { - unless (defined $mode) { - $mode = 0; - } - - $s->{bin_mode} = $mode; - } - - $prev; -} # end sub binmode - - -sub break { - my ($self) = @_; - my $s = *$self->{net_telnet}; - my $break_cmd = "\xff\xf3"; - - $s->{timedout} = ''; - - &_put($self, \$break_cmd, "break"); -} # end sub break - - -sub buffer { - my ($self) = @_; - my $s = *$self->{net_telnet}; - - \$s->{buf}; -} # end sub buffer - - -sub buffer_empty { - my ($self) = @_; - my ( - $buffer, - ); - - $buffer = $self->buffer; - $$buffer = ""; -} # end sub buffer_empty - - -sub close { - my ($self) = @_; - my $s = *$self->{net_telnet}; - - $s->{eofile} = 1; - $s->{opened} = ''; - close $self - if defined fileno($self); - - 1; -} # end sub close - - -sub cmd { - my ($self, @args) = @_; - my ( - $cmd_remove_mode, - $errmode, - $firstpos, - $last_prompt, - $lastpos, - $lines, - $ors, - $output, - $output_ref, - $prompt, - $remove_echo, - $rs, - $rs_len, - $s, - $telopt_echo, - $timeout, - %args, - ); - my $cmd = ""; - local $_; - - ## Init. - $self->timed_out(''); - $self->last_prompt(""); - $s = *$self->{net_telnet}; - $output = []; - $cmd_remove_mode = $self->cmd_remove_mode; - $errmode = $self->errmode; - $ors = $self->output_record_separator; - $prompt = $self->prompt; - $rs = $self->input_record_separator; - $timeout = $self->timeout; - - ## Parse args. - if (@_ == 2) { # one positional arg given - $cmd = $_[1]; - } - elsif (@_ > 2) { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?cmd_remove/i) { - $cmd_remove_mode = &_parse_cmd_remove_mode($self, $args{$_}); - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?input_record_separator$/i or /^-?rs$/i) { - $rs = &_parse_input_record_separator($self, $args{$_}); - } - elsif (/^-?output$/i) { - $output_ref = $args{$_}; - if (defined($output_ref) and ref($output_ref) eq "ARRAY") { - $output = $output_ref; - } - } - elsif (/^-?output_record_separator$/i or /^-?ors$/i) { - $ors = $self->output_record_separator($args{$_}); - } - elsif (/^-?prompt$/i) { - $prompt = &_parse_prompt($self, $args{$_}); - } - elsif (/^-?string$/i) { - $cmd = $args{$_}; - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::cmd()"); - } - } - } - - ## Override some user settings. - local $s->{errormode} = "return"; - local $s->{time_out} = &_endtime($timeout); - $self->errmsg(""); - - ## Send command and wait for the prompt. - $self->put($cmd . $ors) - and ($lines, $last_prompt) = $self->waitfor($prompt); - - ## Check for failure. - $s->{errormode} = $errmode; - return $self->error("command timed-out") if $self->timed_out; - return $self->error($self->errmsg) if $self->errmsg ne ""; - - ## Save the most recently matched prompt. - $self->last_prompt($last_prompt); - - ## Split lines into an array, keeping record separator at end of line. - $firstpos = 0; - $rs_len = length $rs; - while (($lastpos = index($lines, $rs, $firstpos)) > -1) { - push(@$output, - substr($lines, $firstpos, $lastpos - $firstpos + $rs_len)); - $firstpos = $lastpos + $rs_len; - } - - if ($firstpos < length $lines) { - push @$output, substr($lines, $firstpos); - } - - ## Determine if we should remove the first line of output based - ## on the assumption that it's an echoed back command. - if ($cmd_remove_mode eq "auto") { - ## See if remote side told us they'd echo. - $telopt_echo = $self->option_state(&TELOPT_ECHO); - $remove_echo = $telopt_echo->{remote_enabled}; - } - else { # user explicitly told us how many lines to remove. - $remove_echo = $cmd_remove_mode; - } - - ## Get rid of possible echo back command. - while ($remove_echo--) { - shift @$output; - } - - ## Ensure at least a null string when there's no command output - so - ## "true" is returned in a list context. - unless (@$output) { - @$output = (""); - } - - ## Return command output via named arg, if requested. - if (defined $output_ref) { - if (ref($output_ref) eq "SCALAR") { - $$output_ref = join "", @$output; - } - elsif (ref($output_ref) eq "HASH") { - %$output_ref = @$output; - } - } - - wantarray ? @$output : 1; -} # end sub cmd - - -sub cmd_remove_mode { - my ($self, $mode) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{cmd_rm_mode}; - - if (@_ >= 2) { - $s->{cmd_rm_mode} = &_parse_cmd_remove_mode($self, $mode); - } - - $prev; -} # end sub cmd_remove_mode - - -sub dump_log { - my ($self, $name) = @_; - my ( - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $fh = $s->{dumplog}; - - if (@_ >= 2) { - unless (defined $name) { - $name = ""; - } - - $fh = &_fname_to_handle($self, $name) - or return; - $s->{dumplog} = $fh; - } - - $fh; -} # end sub dump_log - - -sub eof { - my ($self) = @_; - - *$self->{net_telnet}{eofile}; -} # end sub eof - - -sub errmode { - my ($self, $mode) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{errormode}; - - if (@_ >= 2) { - $s->{errormode} = &_parse_errmode($self, $mode); - } - - $prev; -} # end sub errmode - - -sub errmsg { - my ($self, @errmsgs) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{errormsg}; - - if (@_ >= 2) { - $s->{errormsg} = join "", @errmsgs; - } - - $prev; -} # end sub errmsg - - -sub error { - my ($self, @errmsg) = @_; - my ( - $errmsg, - $func, - $mode, - $s, - @args, - ); - local $_; - - $s = *$self->{net_telnet}; - - if (@_ >= 2) { - ## Put error message in the object. - $errmsg = join "", @errmsg; - $s->{errormsg} = $errmsg; - - ## Do the error action as described by error mode. - $mode = $s->{errormode}; - if (ref($mode) eq "CODE") { - &$mode($errmsg); - return; - } - elsif (ref($mode) eq "ARRAY") { - ($func, @args) = @$mode; - &$func(@args); - return; - } - elsif ($mode =~ /^return$/i) { - return; - } - else { # die - if ($errmsg =~ /\n$/) { - die $errmsg; - } - else { - ## Die and append caller's line number to message. - &_croak($self, $errmsg); - } - } - } - else { - return $s->{errormsg} ne ""; - } -} # end sub error - - -sub fhopen { - my ($self, $fh) = @_; - my ( - $globref, - $s, - ); - - ## Convert given filehandle to a typeglob reference, if necessary. - $globref = &_qualify_fh($self, $fh); - - ## Ensure filehandle is already open. - return $self->error("fhopen filehandle isn't already open") - unless defined($globref) and defined(fileno $globref); - - ## Ensure we're closed. - $self->close; - - ## Save our private data. - $s = *$self->{net_telnet}; - - ## Switch ourself with the given filehandle. - *$self = *$globref; - - ## Restore our private data. - *$self->{net_telnet} = $s; - - ## Re-initialize ourself. - select((select($self), $|=1)[$[]); # don't buffer writes - $s = *$self->{net_telnet}; - $s->{blksize} = &_optimal_blksize((stat $self)[11]); - $s->{buf} = ""; - $s->{eofile} = ''; - $s->{errormsg} = ""; - vec($s->{fdmask}='', fileno($self), 1) = 1; - $s->{host} = ""; - $s->{last_line} = ""; - $s->{last_prompt} = ""; - $s->{num_wrote} = 0; - $s->{opened} = 1; - $s->{pending_errormsg} = ""; - $s->{port} = ''; - $s->{pushback_buf} = ""; - $s->{timedout} = ''; - $s->{unsent_opts} = ""; - &_reset_options($s->{opts}); - - 1; -} # end sub fhopen - - -sub get { - my ($self, %args) = @_; - my ( - $binmode, - $endtime, - $errmode, - $line, - $s, - $telnetmode, - $timeout, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $timeout = $s->{time_out}; - $s->{timedout} = ''; - return if $s->{eofile}; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?binmode$/i) { - $binmode = $args{$_}; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $args{$_}; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::get()"); - } - } - - ## If any args given, override corresponding instance data. - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - - ## Set wall time when we time out. - $endtime = &_endtime($timeout); - - ## Try to send any waiting option negotiation. - if (length $s->{unsent_opts}) { - &_flush_opts($self); - } - - ## Try to read just the waiting data using return error mode. - { - local $s->{errormode} = "return"; - $s->{errormsg} = ""; - &_fillbuf($self, $s, 0); - } - - ## We're done if we timed-out and timeout value is set to "poll". - return $self->error($s->{errormsg}) - if ($s->{timedout} and defined($timeout) and $timeout == 0 - and !length $s->{buf}); - - ## We're done if we hit an error other than timing out. - if ($s->{errormsg} and !$s->{timedout}) { - if (!length $s->{buf}) { - return $self->error($s->{errormsg}); - } - else { # error encountered but there's some data in buffer - $s->{pending_errormsg} = $s->{errormsg}; - } - } - - ## Clear time-out error from first read. - $s->{timedout} = ''; - $s->{errormsg} = ""; - - ## If buffer is still empty, try to read according to user's timeout. - if (!length $s->{buf}) { - &_fillbuf($self, $s, $endtime) - or do { - return if $s->{timedout}; - - ## We've reached end-of-file. - $self->close; - return; - }; - } - - ## Extract chars from buffer. - $line = $s->{buf}; - $s->{buf} = ""; - - $line; -} # end sub get - - -sub getline { - my ($self, %args) = @_; - my ( - $binmode, - $endtime, - $errmode, - $len, - $line, - $offset, - $pos, - $rs, - $s, - $telnetmode, - $timeout, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - return if $s->{eofile}; - $rs = $s->{rs}; - $timeout = $s->{time_out}; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?binmode$/i) { - $binmode = $args{$_}; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?input_record_separator$/i or /^-?rs$/i) { - $rs = &_parse_input_record_separator($self, $args{$_}); - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $args{$_}; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::getline()"); - } - } - - ## If any args given, override corresponding instance data. - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - - ## Set wall time when we time out. - $endtime = &_endtime($timeout); - - ## Try to send any waiting option negotiation. - if (length $s->{unsent_opts}) { - &_flush_opts($self); - } - - ## Keep reading into buffer until end-of-line is read. - $offset = 0; - while (($pos = index($s->{buf}, $rs, $offset)) == -1) { - $offset = length $s->{buf}; - &_fillbuf($self, $s, $endtime) - or do { - return if $s->{timedout}; - - ## We've reached end-of-file. - $self->close; - if (length $s->{buf}) { - return $s->{buf}; - } - else { - return; - } - }; - } - - ## Extract line from buffer. - $len = $pos + length $rs; - $line = substr($s->{buf}, 0, $len); - substr($s->{buf}, 0, $len) = ""; - - $line; -} # end sub getline - - -sub getlines { - my ($self, %args) = @_; - my ( - $binmode, - $errmode, - $line, - $rs, - $s, - $telnetmode, - $timeout, - ); - my $all = 1; - my @lines = (); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - return if $s->{eofile}; - $timeout = $s->{time_out}; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?all$/i) { - $all = $args{$_}; - unless (defined $all) { - $all = ''; - } - } - elsif (/^-?binmode$/i) { - $binmode = $args{$_}; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?input_record_separator$/i or /^-?rs$/i) { - $rs = &_parse_input_record_separator($self, $args{$_}); - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $args{$_}; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::getlines()"); - } - } - - ## If any args given, override corresponding instance data. - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{rs} = $rs - if defined $rs; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - local $s->{time_out} = &_endtime($timeout); - - ## User requested only the currently available lines. - if (! $all) { - return &_next_getlines($self, $s); - } - - ## Read lines until eof or error. - while (1) { - $line = $self->getline - or last; - push @lines, $line; - } - - ## Check for error. - return if ! $self->eof; - - @lines; -} # end sub getlines - - -sub host { - my ($self, $host) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{host}; - - if (@_ >= 2) { - unless (defined $host) { - $host = ""; - } - - $s->{host} = $host; - } - - $prev; -} # end sub host - - -sub input_log { - my ($self, $name) = @_; - my ( - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $fh = $s->{inputlog}; - - if (@_ >= 2) { - unless (defined $name) { - $name = ""; - } - - $fh = &_fname_to_handle($self, $name) - or return; - $s->{inputlog} = $fh; - } - - $fh; -} # end sub input_log - - -sub input_record_separator { - my ($self, $rs) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{rs}; - - if (@_ >= 2) { - $s->{rs} = &_parse_input_record_separator($self, $rs); - } - - $prev; -} # end sub input_record_separator - - -sub last_prompt { - my ($self, $string) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{last_prompt}; - - if (@_ >= 2) { - unless (defined $string) { - $string = ""; - } - - $s->{last_prompt} = $string; - } - - $prev; -} # end sub last_prompt - - -sub lastline { - my ($self, $line) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{last_line}; - - if (@_ >= 2) { - unless (defined $line) { - $line = ""; - } - - $s->{last_line} = $line; - } - - $prev; -} # end sub lastline - - -sub login { - my ($self) = @_; - my ( - $errmode, - $error, - $is_passwd_arg, - $is_username_arg, - $lastline, - $match, - $ors, - $passwd, - $prematch, - $prompt, - $s, - $timeout, - $username, - %args, - ); - local $_; - - ## Init. - $self->timed_out(''); - $self->last_prompt(""); - $s = *$self->{net_telnet}; - $timeout = $self->timeout; - $ors = $self->output_record_separator; - $prompt = $self->prompt; - - ## Parse args. - if (@_ == 3) { # just username and passwd given - $username = $_[1]; - $passwd = $_[2]; - - $is_username_arg = 1; - $is_passwd_arg = 1; - } - else { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?name$/i) { - $username = $args{$_}; - unless (defined $username) { - $username = ""; - } - - $is_username_arg = 1; - } - elsif (/^-?pass/i) { - $passwd = $args{$_}; - unless (defined $passwd) { - $passwd = ""; - } - - $is_passwd_arg = 1; - } - elsif (/^-?prompt$/i) { - $prompt = &_parse_prompt($self, $args{$_}); - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given ", - "to " . ref($self) . "::login()"); - } - } - } - - ## Ensure both username and password argument given. - &_croak($self,"Name argument not given to " . ref($self) . "::login()") - unless $is_username_arg; - &_croak($self,"Password argument not given to " . ref($self) . "::login()") - unless $is_passwd_arg; - - ## Override some user settings. - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{time_out} = &_endtime($timeout); - - ## Create a subroutine to generate an error. - $error - = sub { - my ($errmsg) = @_; - - if ($self->timed_out) { - return $self->error($errmsg); - } - elsif ($self->eof) { - ($lastline = $self->lastline) =~ s/\n+//; - return $self->error($errmsg, ": ", $lastline); - } - else { - return $self->error($self->errmsg); - } - }; - - - return $self->error("login failed: filehandle isn't open") - if $self->eof; - - ## Wait for login prompt. - $self->waitfor(Match => '/login[: ]*$/i', - Match => '/username[: ]*$/i', - Errmode => "return") - or do { - return &$error("eof read waiting for login prompt") - if $self->eof; - return &$error("timed-out waiting for login prompt"); - }; - - ## Delay sending response because of bug in Linux login program. - &_sleep(0.01); - - ## Send login name. - $self->put(String => $username . $ors, - Errmode => "return") - or return &$error("login disconnected"); - - ## Wait for password prompt. - $self->waitfor(Match => '/password[: ]*$/i', - Errmode => "return") - or do { - return &$error("eof read waiting for password prompt") - if $self->eof; - return &$error("timed-out waiting for password prompt"); - }; - - ## Delay sending response because of bug in Linux login program. - &_sleep(0.01); - - ## Send password. - $self->put(String => $passwd . $ors, - Errmode => "return") - or return &$error("login disconnected"); - - ## Wait for command prompt or another login prompt. - ($prematch, $match) = $self->waitfor(Match => '/login[: ]*$/i', - Match => '/username[: ]*$/i', - Match => $prompt, - Errmode => "return") - or do { - return &$error("eof read waiting for command prompt") - if $self->eof; - return &$error("timed-out waiting for command prompt"); - }; - - ## It's a bad login if we got another login prompt. - return $self->error("login failed: bad name or password") - if $match =~ /login[: ]*$/i or $match =~ /username[: ]*$/i; - - ## Save the most recently matched command prompt. - $self->last_prompt($match); - - 1; -} # end sub login - - -sub max_buffer_length { - my ($self, $maxbufsize) = @_; - my ( - $prev, - $s, - ); - my $minbufsize = 512; - - $s = *$self->{net_telnet}; - $prev = $s->{maxbufsize}; - - if (@_ >= 2) { - ## Ensure a positive integer value. - unless (defined $maxbufsize - and $maxbufsize =~ /^\d+$/ - and $maxbufsize) - { - &_carp($self, "ignoring bad Max_buffer_length " . - "argument \"$maxbufsize\": it's not a positive integer"); - $maxbufsize = $prev; - } - - ## Adjust up values that are too small. - if ($maxbufsize < $minbufsize) { - $maxbufsize = $minbufsize; - } - - $s->{maxbufsize} = $maxbufsize; - } - - $prev; -} # end sub max_buffer_length - - -## Make ofs() synonymous with output_field_separator(). -*ofs = \&output_field_separator; - - -sub open { - my ($self) = @_; - my ( - $errmode, - $errno, - $host, - $ip_addr, - $port, - $s, - $timeout, - %args, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $timeout = $s->{time_out}; - $s->{timedout} = ''; - - if (@_ == 2) { # one positional arg given - $self->host($_[1]); - } - elsif (@_ > 2) { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?host$/i) { - $self->host($args{$_}); - } - elsif (/^-?port$/i) { - $self->port($args{$_}) - or return; - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given ", - "to " . ref($self) . "::open()"); - } - } - } - - ## If any args given, override corresponding instance data. - local $s->{errormode} = $errmode - if defined $errmode; - - ## Get host and port. - $host = $self->host; - $port = $self->port; - - ## Ensure we're already closed. - $self->close; - - ## Connect with or without a timeout. - if (defined($timeout) and &_have_alarm) { # use a timeout - ## Convert possible absolute timeout to relative timeout. - if ($timeout >= $^T) { # it's an absolute time - $timeout = $timeout - time; - } - - ## Ensure a valid timeout value for alarm. - if ($timeout < 1) { - $timeout = 1; - } - $timeout = int($timeout + 1.5); - - ## Connect to server, timing out if it takes too long. - eval { - ## Turn on timer. - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{ALRM} = sub { die "timed-out\n" }; - alarm $timeout; - - ## Lookup server's IP address. - $ip_addr = inet_aton $host - or die "unknown remote host: $host\n"; - - ## Create a socket and attach the filehandle to it. - socket $self, AF_INET, SOCK_STREAM, 0 - or die "problem creating socket: $!\n"; - - ## Open connection to server. - connect $self, sockaddr_in($port, $ip_addr) - or die "problem connecting to \"$host\", port $port: $!\n"; - }; - alarm 0; - - ## Check for error. - if ($@ =~ /^timed-out$/) { # time out failure - $s->{timedout} = 1; - $self->close; - if (!$ip_addr) { - return $self->error("unknown remote host: $host: ", - "name lookup timed-out"); - } - else { - return $self->error("problem connecting to \"$host\", ", - "port $port: connect timed-out"); - } - } - elsif ($@) { # hostname lookup or connect failure - $self->close; - chomp $@; - return $self->error($@); - } - } - else { # don't use a timeout - $timeout = undef; - - ## Lookup server's IP address. - $ip_addr = inet_aton $host - or return $self->error("unknown remote host: $host"); - - ## Create a socket and attach the filehandle to it. - socket $self, AF_INET, SOCK_STREAM, 0 - or return $self->error("problem creating socket: $!"); - - ## Open connection to server. - connect $self, sockaddr_in($port, $ip_addr) - or do { - $errno = "$!"; - $self->close; - return $self->error("problem connecting to \"$host\", ", - "port $port: $errno"); - }; - } - - select((select($self), $|=1)[$[]); # don't buffer writes - $s->{blksize} = &_optimal_blksize((stat $self)[11]); - $s->{buf} = ""; - $s->{eofile} = ''; - $s->{errormsg} = ""; - vec($s->{fdmask}='', fileno($self), 1) = 1; - $s->{last_line} = ""; - $s->{num_wrote} = 0; - $s->{opened} = 1; - $s->{pending_errormsg} = ""; - $s->{pushback_buf} = ""; - $s->{timedout} = ''; - $s->{unsent_opts} = ""; - &_reset_options($s->{opts}); - - 1; -} # end sub open - - -sub option_accept { - my ($self, @args) = @_; - my ( - $arg, - $option, - $s, - @opt_args, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - - ## Parse the named args. - while (($_, $arg) = splice @args, 0, 2) { - ## Verify and save arguments. - if (/^-?do$/i) { - ## Make sure a callback is defined. - return $self->error("usage: an option callback must already ", - "be defined when enabling with $_") - unless $s->{opt_cback}; - - $option = &_verify_telopt_arg($self, $arg, $_); - return unless defined $option; - push @opt_args, { option => $option, - is_remote => '', - is_enable => 1, - }; - } - elsif (/^-?dont$/i) { - $option = &_verify_telopt_arg($self, $arg, $_); - return unless defined $option; - push @opt_args, { option => $option, - is_remote => '', - is_enable => '', - }; - } - elsif (/^-?will$/i) { - ## Make sure a callback is defined. - return $self->error("usage: an option callback must already ", - "be defined when enabling with $_") - unless $s->{opt_cback}; - - $option = &_verify_telopt_arg($self, $arg, $_); - return unless defined $option; - push @opt_args, { option => $option, - is_remote => 1, - is_enable => 1, - }; - } - elsif (/^-?wont$/i) { - $option = &_verify_telopt_arg($self, $arg, $_); - return unless defined $option; - push @opt_args, { option => $option, - is_remote => 1, - is_enable => '', - }; - } - else { - return $self->error('usage: $obj->option_accept(' . - '[Do => $telopt,] ', - '[Dont => $telopt,] ', - '[Will => $telopt,] ', - '[Wont => $telopt,]'); - } - } - - ## Set "receive ok" for options specified. - &_opt_accept($self, @opt_args); -} # end sub option_accept - - -sub option_callback { - my ($self, $callback) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{opt_cback}; - - if (@_ >= 2) { - unless (defined $callback and ref($callback) eq "CODE") { - &_carp($self, "ignoring Option_callback argument because it's " . - "not a code ref"); - $callback = $prev; - } - - $s->{opt_cback} = $callback; - } - - $prev; -} # end sub option_callback - - -sub option_log { - my ($self, $name) = @_; - my ( - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $fh = $s->{opt_log}; - - if (@_ >= 2) { - unless (defined $name) { - $name = ""; - } - - $fh = &_fname_to_handle($self, $name) - or return; - $s->{opt_log} = $fh; - } - - $fh; -} # end sub option_log - - -sub option_state { - my ($self, $option) = @_; - my ( - $opt_state, - $s, - %opt_state, - ); - - ## Ensure telnet option is non-negative integer. - $option = &_verify_telopt_arg($self, $option); - return unless defined $option; - - ## Init. - $s = *$self->{net_telnet}; - unless (defined $s->{opts}{$option}) { - &_set_default_option($s, $option); - } - - ## Return hashref to a copy of the values. - $opt_state = $s->{opts}{$option}; - %opt_state = %$opt_state; - \%opt_state; -} # end sub option_state - - -## Make ors() synonymous with output_record_separator(). -*ors = \&output_record_separator; - - -sub output_field_separator { - my ($self, $ofs) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{ofs}; - - if (@_ >= 2) { - unless (defined $ofs) { - $ofs = ""; - } - - $s->{ofs} = $ofs; - } - - $prev; -} # end sub output_field_separator - - -sub output_log { - my ($self, $name) = @_; - my ( - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $fh = $s->{outputlog}; - - if (@_ >= 2) { - unless (defined $name) { - $name = ""; - } - - $fh = &_fname_to_handle($self, $name) - or return; - $s->{outputlog} = $fh; - } - - $fh; -} # end sub output_log - - -sub output_record_separator { - my ($self, $ors) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{ors}; - - if (@_ >= 2) { - unless (defined $ors) { - $ors = ""; - } - - $s->{ors} = $ors; - } - - $prev; -} # end sub output_record_separator - - -sub port { - my ($self, $port) = @_; - my ( - $prev, - $s, - $service, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{port}; - - if (@_ >= 2) { - unless (defined $port) { - $port = ""; - } - - if (!$port) { - &_carp($self, "ignoring bad Port argument \"$port\""); - $port = $prev; - } - elsif ($port !~ /^\d+$/) { # port isn't all digits - $service = $port; - $port = getservbyname($service, "tcp"); - unless ($port) { - &_carp($self, "ignoring bad Port argument \"$service\": " . - "it's an unknown TCP service"); - $port = $prev; - } - } - - $s->{port} = $port; - } - - $prev; -} # end sub port - - -sub print { - my ($self) = shift; - my ( - $buf, - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - return $self->error("write error: filehandle isn't open") - unless $s->{opened}; - - ## Add field and record separators. - $buf = join($s->{ofs}, @_) . $s->{ors}; - - ## Log the output if requested. - if ($s->{outputlog}) { - &_log_print($s->{outputlog}, $buf); - } - - ## Convert native newlines to CR LF. - if (!$s->{bin_mode}) { - $buf =~ s(\n)(\015\012)g; - } - - ## Escape TELNET IAC and also CR not followed by LF. - if ($s->{telnet_mode}) { - $buf =~ s(\377)(\377\377)g; - &_escape_cr(\$buf); - } - - &_put($self, \$buf, "print"); -} # end sub print - - -sub print_length { - my ($self) = @_; - - *$self->{net_telnet}{num_wrote}; -} # end sub print_length - - -sub prompt { - my ($self, $prompt) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{cmd_prompt}; - - ## Parse args. - if (@_ == 2) { - $s->{cmd_prompt} = &_parse_prompt($self, $prompt); - } - - $prev; -} # end sub prompt - - -sub put { - my ($self) = @_; - my ( - $binmode, - $buf, - $errmode, - $is_timeout_arg, - $s, - $telnetmode, - $timeout, - %args, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - - ## Parse args. - if (@_ == 2) { # one positional arg given - $buf = $_[1]; - } - elsif (@_ > 2) { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?binmode$/i) { - $binmode = $args{$_}; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?string$/i) { - $buf = $args{$_}; - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $args{$_}; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - $is_timeout_arg = 1; - } - else { - &_croak($self, "bad named parameter \"$_\" given ", - "to " . ref($self) . "::put()"); - } - } - } - - ## If any args given, override corresponding instance data. - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - local $s->{time_out} = $timeout - if defined $is_timeout_arg; - - ## Check for errors. - return $self->error("write error: filehandle isn't open") - unless $s->{opened}; - - ## Log the output if requested. - if ($s->{outputlog}) { - &_log_print($s->{outputlog}, $buf); - } - - ## Convert native newlines to CR LF. - if (!$s->{bin_mode}) { - $buf =~ s(\n)(\015\012)g; - } - - ## Escape TELNET IAC and also CR not followed by LF. - if ($s->{telnet_mode}) { - $buf =~ s(\377)(\377\377)g; - &_escape_cr(\$buf); - } - - &_put($self, \$buf, "print"); -} # end sub put - - -## Make rs() synonymous input_record_separator(). -*rs = \&input_record_separator; - - -sub suboption_callback { - my ($self, $callback) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{subopt_cback}; - - if (@_ >= 2) { - unless (defined $callback and ref($callback) eq "CODE") { - &_carp($self,"ignoring Suboption_callback argument because it's " . - "not a code ref"); - $callback = $prev; - } - - $s->{subopt_cback} = $callback; - } - - $prev; -} # end sub suboption_callback - - -sub telnetmode { - my ($self, $mode) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{telnet_mode}; - - if (@_ >= 2) { - unless (defined $mode) { - $mode = 0; - } - - $s->{telnet_mode} = $mode; - } - - $prev; -} # end sub telnetmode - - -sub timed_out { - my ($self, $value) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{timedout}; - - if (@_ >= 2) { - unless (defined $value) { - $value = ""; - } - - $s->{timedout} = $value; - } - - $prev; -} # end sub timed_out - - -sub timeout { - my ($self, $timeout) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{time_out}; - - if (@_ >= 2) { - $s->{time_out} = &_parse_timeout($self, $timeout); - } - - $prev; -} # end sub timeout - - -sub waitfor { - my ($self, @args) = @_; - my ( - $arg, - $binmode, - $endtime, - $errmode, - $len, - $match, - $match_op, - $pos, - $prematch, - $s, - $search, - $search_cond, - $telnetmode, - $timeout, - @match_cond, - @match_ops, - @search_cond, - @string_cond, - @warns, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - return if $s->{eofile}; - return unless @args; - $timeout = $s->{time_out}; - - ## Code template used to build string match conditional. - ## Values between array elements must be supplied later. - @string_cond = - ('if (($pos = index $s->{buf}, ', ') > -1) { - $len = ', '; - $prematch = substr $s->{buf}, 0, $pos; - $match = substr $s->{buf}, $pos, $len; - substr($s->{buf}, 0, $pos + $len) = ""; - last; - }'); - - ## Code template used to build pattern match conditional. - ## Values between array elements must be supplied later. - @match_cond = - ('if ($s->{buf} =~ ', ') { - $prematch = $`; - $match = $&; - substr($s->{buf}, 0, length($`) + length($&)) = ""; - last; - }'); - - ## Parse args. - if (@_ == 2) { # one positional arg given - $arg = $_[1]; - - ## Fill in the blanks in the code template. - push @match_ops, $arg; - push @search_cond, join("", $match_cond[0], $arg, $match_cond[1]); - } - elsif (@_ > 2) { # named args given - ## Parse the named args. - while (($_, $arg) = splice @args, 0, 2) { - if (/^-?binmode$/i) { - $binmode = $arg; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $arg); - } - elsif (/^-?match$/i) { - ## Fill in the blanks in the code template. - push @match_ops, $arg; - push @search_cond, join("", - $match_cond[0], $arg, $match_cond[1]); - } - elsif (/^-?string$/i) { - ## Fill in the blanks in the code template. - $arg =~ s/'/\\'/g; # quote ticks - push @search_cond, join("", - $string_cond[0], "'$arg'", - $string_cond[1], length($arg), - $string_cond[2]); - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $arg; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $arg); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::waitfor()"); - } - } - } - - ## If any args given, override corresponding instance data. - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - - ## Check for bad match operator argument. - foreach $match_op (@match_ops) { - return $self->error("missing opening delimiter of match operator ", - "in argument \"$match_op\" given to ", - ref($self) . "::waitfor()") - unless $match_op =~ m(^\s*/) or $match_op =~ m(^\s*m\s*\W); - } - - ## Construct conditional to check for requested string and pattern matches. - ## Turn subsequent "if"s into "elsif". - $search_cond = join "\n\tels", @search_cond; - - ## Construct loop to fill buffer until string/pattern, timeout, or eof. - $search = join "", " - while (1) {\n\t", - $search_cond, ' - &_fillbuf($self, $s, $endtime) - or do { - last if $s->{timedout}; - $self->close; - last; - }; - }'; - - ## Set wall time when we timeout. - $endtime = &_endtime($timeout); - - ## Run the loop. - { - local $^W = 1; - local $SIG{"__WARN__"} = sub { push @warns, @_ }; - local $s->{errormode} = "return"; - $s->{errormsg} = ""; - eval $search; - } - - ## Check for failure. - return $self->error("pattern match timed-out") if $s->{timedout}; - return $self->error($s->{errormsg}) if $s->{errormsg} ne ""; - return $self->error("pattern match read eof") if $s->{eofile}; - - ## Check for Perl syntax errors or warnings. - if ($@ or @warns) { - foreach $match_op (@match_ops) { - &_match_check($self, $match_op) - or return; - } - return $self->error($@) if $@; - return $self->error(@warns) if @warns; - } - - wantarray ? ($prematch, $match) : 1; -} # end sub waitfor - - -######################## Private Subroutines ######################### - - -sub _append_lineno { - my ($obj, @msgs) = @_; - my ( - $file, - $line, - $pkg, - ); - - ## Find the caller that's not in object's class or one of its base classes. - ($pkg, $file , $line) = &_user_caller($obj); - join("", @msgs, " at ", $file, " line ", $line, "\n"); -} # end sub _append_lineno - - -sub _carp { - warn &_append_lineno(@_); -} # end sub _carp - - -sub _croak { - die &_append_lineno(@_); -} # end sub _croak - - -sub _endtime { - my ($interval) = @_; - - ## Compute wall time when timeout occurs. - if (defined $interval) { - if ($interval >= $^T) { # it's already an absolute time - return $interval; - } - elsif ($interval > 0) { # it's relative to the current time - return int(time + 1.5 + $interval); - } - else { # it's a one time poll - return 0; - } - } - else { # there's no timeout - return undef; - } -} # end sub _endtime - - -sub _escape_cr { - my ($string) = @_; - my ( - $nextchar, - ); - my $pos = 0; - - ## Convert all CR (not followed by LF) to CR NULL. - while (($pos = index($$string, "\015", $pos)) > -1) { - $nextchar = substr $$string, $pos + 1, 1; - - substr($$string, $pos, 1) = "\015\000" - unless $nextchar eq "\012"; - - $pos++; - } - - 1; -} # end sub _escape_cr - - -sub _fillbuf { - my ($self, $s, $endtime) = @_; - my ( - $msg, - $nfound, - $nread, - $pushback_len, - $read_pos, - $ready, - $timed_out, - $timeout, - $unparsed_pos, - ); - - ## If error from last read not yet reported then do it now. - if ($s->{pending_errormsg}) { - $msg = $s->{pending_errormsg}; - $s->{pending_errormsg} = ""; - return $self->error($msg); - } - - return unless $s->{opened}; - - while (1) { - ## Maximum buffer size exceeded? - return $self->error("maximum input buffer length exceeded: ", - $s->{maxbufsize}, " bytes") - unless length($s->{buf}) <= $s->{maxbufsize}; - - ## Determine how long to wait for input ready. - ($timed_out, $timeout) = &_timeout_interval($endtime); - if ($timed_out) { - $s->{timedout} = 1; - return $self->error("read timed-out"); - } - - ## Wait for input ready. - $nfound = select $ready=$s->{fdmask}, "", "", $timeout; - - ## Handle any errors while waiting. - if (!defined $nfound or $nfound <= 0) { # input not ready - if (defined $nfound and $nfound == 0) { # timed-out - $s->{timedout} = 1; - return $self->error("read timed-out"); - } - else { # error waiting for input ready - next if $! =~ /^interrupted/i; - - $s->{opened} = ''; - return $self->error("read error: $!"); - } - } - - ## Append to buffer any partially processed telnet or CR sequence. - $pushback_len = length $s->{pushback_buf}; - if ($pushback_len) { - $s->{buf} .= $s->{pushback_buf}; - $s->{pushback_buf} = ""; - } - - ## Read the waiting data. - $read_pos = length $s->{buf}; - $unparsed_pos = $read_pos - $pushback_len; - $nread = sysread $self, $s->{buf}, $s->{blksize}, $read_pos; - - ## Handle any read errors. - if (!defined $nread) { # read failed - next if $! =~ /^interrupted/i; # restart interrupted syscall - - $s->{opened} = ''; - return $self->error("read error: $!"); - } - - ## Handle eof. - if ($nread == 0) { # eof read - $s->{opened} = ''; - return; - } - - ## Display network traffic if requested. - if ($s->{dumplog}) { - &_log_dump('<', $s->{dumplog}, \$s->{buf}, $read_pos); - } - - ## Process any telnet commands in the data stream. - if ($s->{telnet_mode} and index($s->{buf},"\377",$unparsed_pos) > -1) { - &_interpret_tcmd($self, $s, $unparsed_pos); - } - - ## Process any carriage-return sequences in the data stream. - &_interpret_cr($s, $unparsed_pos); - - ## Read again if all chars read were consumed as telnet cmds. - next if $unparsed_pos >= length $s->{buf}; - - ## Log the input if requested. - if ($s->{inputlog}) { - &_log_print($s->{inputlog}, substr($s->{buf}, $unparsed_pos)); - } - - ## Save the last line read. - &_save_lastline($s); - - ## We've successfully read some data into the buffer. - last; - } # end while(1) - - 1; -} # end sub _fillbuf - - -sub _flush_opts { - my ($self) = @_; - my ( - $option_chars, - ); - my $s = *$self->{net_telnet}; - - ## Get option and clear the output buf. - $option_chars = $s->{unsent_opts}; - $s->{unsent_opts} = ""; - - ## Try to send options without waiting. - { - local $s->{errormode} = "return"; - local $s->{time_out} = 0; - &_put($self, \$option_chars, "telnet option negotiation") - or do { - ## Save chars not printed for later. - substr($option_chars, 0, $self->print_length) = ""; - $s->{unsent_opts} .= $option_chars; - }; - } - - 1; -} # end sub _flush_opts - - -sub _fname_to_handle { - my ($self, $fh) = @_; - my ( - $filename, - ); - - ## Ensure valid input. - return "" - unless defined $fh and (ref $fh or length $fh); - - ## Open a new filehandle if input is a filename. - no strict "refs"; - if (!ref($fh) and !defined(fileno $fh)) { # fh is a filename - $filename = $fh; - $fh = &_new_handle(); - CORE::open $fh, "> $filename" - or return $self->error("problem creating $filename: $!"); - } - - select((select($fh), $|=1)[$[]); # don't buffer writes - $fh; -} # end sub _fname_to_handle - - -sub _have_alarm { - eval { - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{ALRM} = sub { die }; - alarm 0; - }; - - ! $@; -} # end sub _have_alarm - - -sub _interpret_cr { - my ($s, $pos) = @_; - my ( - $nextchar, - ); - - while (($pos = index($s->{buf}, "\015", $pos)) > -1) { - $nextchar = substr($s->{buf}, $pos + 1, 1); - if ($nextchar eq "\0") { - ## Convert CR NULL to CR when in telnet mode. - if ($s->{telnet_mode}) { - substr($s->{buf}, $pos + 1, 1) = ""; - } - } - elsif ($nextchar eq "\012") { - ## Convert CR LF to newline when not in binary mode. - if (!$s->{bin_mode}) { - substr($s->{buf}, $pos, 2) = "\n"; - } - } - elsif (!length($nextchar) and ($s->{telnet_mode} or !$s->{bin_mode})) { - ## Save CR in alt buffer for possible CR LF or CR NULL conversion. - $s->{pushback_buf} .= "\015"; - chop $s->{buf}; - } - - $pos++; - } - - 1; -} # end sub _interpret_cr - - -sub _interpret_tcmd { - my ($self, $s, $offset) = @_; - my ( - $callback, - $endpos, - $nextchar, - $option, - $parameters, - $pos, - $subcmd, - ); - local $_; - - ## Parse telnet commands in the data stream. - $pos = $offset; - while (($pos = index $s->{buf}, "\377", $pos) > -1) { # unprocessed IAC - $nextchar = substr $s->{buf}, $pos + 1, 1; - - ## Save command if it's only partially read. - if (!length $nextchar) { - $s->{pushback_buf} .= "\377"; - chop $s->{buf}; - last; - } - - if ($nextchar eq "\377") { # IAC is escaping "\377" char - ## Remove escape char from data stream. - substr($s->{buf}, $pos, 1) = ""; - $pos++; - } - elsif ($nextchar eq "\375" or $nextchar eq "\373" or - $nextchar eq "\374" or $nextchar eq "\376") { # opt negotiation - $option = substr $s->{buf}, $pos + 2, 1; - - ## Save command if it's only partially read. - if (!length $option) { - $s->{pushback_buf} .= "\377" . $nextchar; - chop $s->{buf}; - chop $s->{buf}; - last; - } - - ## Remove command from data stream. - substr($s->{buf}, $pos, 3) = ""; - - ## Handle option negotiation. - &_negotiate_recv($self, $s, $nextchar, ord($option), $pos); - } - elsif ($nextchar eq "\372") { # start of subnegotiation parameters - ## Save command if it's only partially read. - $endpos = index $s->{buf}, "\360", $pos; - if ($endpos == -1) { - $s->{pushback_buf} .= substr $s->{buf}, $pos; - substr($s->{buf}, $pos) = ""; - last; - } - - ## Remove subnegotiation cmd from buffer. - $subcmd = substr($s->{buf}, $pos, $endpos - $pos + 1); - substr($s->{buf}, $pos, $endpos - $pos + 1) = ""; - - ## Invoke subnegotiation callback. - if ($s->{subopt_cback} and length($subcmd) >= 5) { - $option = unpack "C", substr($subcmd, 2, 1); - if (length($subcmd) >= 6) { - $parameters = substr $subcmd, 3, length($subcmd) - 5; - } - else { - $parameters = ""; - } - - $callback = $s->{subopt_cback}; - &$callback($self, $option, $parameters); - } - } - else { # various two char telnet commands - ## Ignore and remove command from data stream. - substr($s->{buf}, $pos, 2) = ""; - } - } - - ## Try to send any waiting option negotiation. - if (length $s->{unsent_opts}) { - &_flush_opts($self); - } - - 1; -} # end sub _interpret_tcmd - - -sub _io_socket_include { - local $SIG{"__DIE__"} = "DEFAULT"; - eval "require IO::Socket"; -} # end sub io_socket_include - - -sub _log_dump { - my ($direction, $fh, $data, $offset, $len) = @_; - my ( - $addr, - $hexvals, - $line, - ); - - $addr = 0; - $len = length($$data) - $offset - if !defined $len; - return 1 if $len <= 0; - - ## Print data in dump format. - while ($len > 0) { - ## Convert up to the next 16 chars to hex, padding w/ spaces. - if ($len >= 16) { - $line = substr $$data, $offset, 16; - } - else { - $line = substr $$data, $offset, $len; - } - $hexvals = unpack("H*", $line); - $hexvals .= ' ' x (32 - length $hexvals); - - ## Place in 16 columns, each containing two hex digits. - $hexvals = sprintf("%s %s %s %s " x 4, - unpack("a2" x 16, $hexvals)); - - ## For the ASCII column, change unprintable chars to a period. - $line =~ s/[\000-\037,\177-\237]/./g; - - ## Print the line in dump format. - &_log_print($fh, sprintf("%s 0x%5.5lx: %s%s\n", - $direction, $addr, $hexvals, $line)); - - $addr += 16; - $offset += 16; - $len -= 16; - } - - &_log_print($fh, "\n"); - - 1; -} # end sub _log_dump - - -sub _log_option { - my ($fh, $direction, $request, $option) = @_; - my ( - $name, - ); - - if ($option >= 0 and $option <= $#Telopts) { - $name = $Telopts[$option]; - } - else { - $name = $option; - } - - &_log_print($fh, "$direction $request $name\n"); -} # end sub _log_option - - -sub _log_print { - my ($fh, $buf) = @_; - local $\ = ''; - - if (ref($fh) and ref($fh) ne "GLOB") { # fh is blessed ref - $fh->print($buf); - } - else { # fh isn't blessed ref - print $fh $buf; - } -} # end sub _log_print - - -sub _match_check { - my ($self, $code) = @_; - my $error; - my @warns = (); - - ## Use eval to check for syntax errors or warnings. - { - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{"__WARN__"} = sub { push @warns, @_ }; - local $^W = 1; - local $_ = ''; - eval "\$_ =~ $code;"; - } - if ($@) { - ## Remove useless lines numbers from message. - ($error = $@) =~ s/ at \(eval \d+\) line \d+.?//; - chomp $error; - return $self->error("bad match operator: $error"); - } - elsif (@warns) { - ## Remove useless lines numbers from message. - ($error = shift @warns) =~ s/ at \(eval \d+\) line \d+.?//; - $error =~ s/ while "strict subs" in use//; - chomp $error; - return $self->error("bad match operator: $error"); - } - - 1; -} # end sub _match_check - - -sub _negotiate_callback { - my ($self, $opt, $is_remote, $is_enabled, $was_enabled, $opt_bufpos) = @_; - my ( - $callback, - $s, - ); - local $_; - - ## Keep track of remote echo. - if ($is_remote and $opt == &TELOPT_ECHO) { # received WILL or WONT ECHO - $s = *$self->{net_telnet}; - - if ($is_enabled and !$was_enabled) { # received WILL ECHO - $s->{remote_echo} = 1; - } - elsif (!$is_enabled and $was_enabled) { # received WONT ECHO - $s->{remote_echo} = ''; - } - } - - ## Invoke callback, if there is one. - $callback = $self->option_callback; - if ($callback) { - &$callback($self, $opt, $is_remote, - $is_enabled, $was_enabled, $opt_bufpos); - } - - 1; -} # end sub _negotiate_callback - - -sub _negotiate_recv { - my ($self, $s, $opt_request, $opt, $opt_bufpos) = @_; - - ## Ensure data structure exists for this option. - unless (defined $s->{opts}{$opt}) { - &_set_default_option($s, $opt); - } - - ## Process the option. - if ($opt_request eq "\376") { # DONT - &_negotiate_recv_disable($self, $s, $opt, "dont", $opt_bufpos, - $s->{opts}{$opt}{local_enable_ok}, - \$s->{opts}{$opt}{local_enabled}, - \$s->{opts}{$opt}{local_state}); - } - elsif ($opt_request eq "\375") { # DO - &_negotiate_recv_enable($self, $s, $opt, "do", $opt_bufpos, - $s->{opts}{$opt}{local_enable_ok}, - \$s->{opts}{$opt}{local_enabled}, - \$s->{opts}{$opt}{local_state}); - } - elsif ($opt_request eq "\374") { # WONT - &_negotiate_recv_disable($self, $s, $opt, "wont", $opt_bufpos, - $s->{opts}{$opt}{remote_enable_ok}, - \$s->{opts}{$opt}{remote_enabled}, - \$s->{opts}{$opt}{remote_state}); - } - elsif ($opt_request eq "\373") { # WILL - &_negotiate_recv_enable($self, $s, $opt, "will", $opt_bufpos, - $s->{opts}{$opt}{remote_enable_ok}, - \$s->{opts}{$opt}{remote_enabled}, - \$s->{opts}{$opt}{remote_state}); - } - else { # internal error - die; - } - - 1; -} # end sub _negotiate_recv - - -sub _negotiate_recv_disable { - my ($self, $s, $opt, $opt_request, - $opt_bufpos, $enable_ok, $is_enabled, $state) = @_; - my ( - $ack, - $disable_cmd, - $enable_cmd, - $is_remote, - $nak, - $was_enabled, - ); - - ## What do we use to request enable/disable or respond with ack/nak. - if ($opt_request eq "wont") { - $enable_cmd = "\377\375" . pack("C", $opt); # do command - $disable_cmd = "\377\376" . pack("C", $opt); # dont command - $is_remote = 1; - $ack = "DO"; - $nak = "DONT"; - - &_log_option($s->{opt_log}, "RCVD", "WONT", $opt) - if $s->{opt_log}; - } - elsif ($opt_request eq "dont") { - $enable_cmd = "\377\373" . pack("C", $opt); # will command - $disable_cmd = "\377\374" . pack("C", $opt); # wont command - $is_remote = ''; - $ack = "WILL"; - $nak = "WONT"; - - &_log_option($s->{opt_log}, "RCVD", "DONT", $opt) - if $s->{opt_log}; - } - else { # internal error - die; - } - - ## Respond to WONT or DONT based on the current negotiation state. - if ($$state eq "no") { # state is already disabled - } - elsif ($$state eq "yes") { # they're initiating disable - $$is_enabled = ''; - $$state = "no"; - - ## Send positive acknowledgment. - $s->{unsent_opts} .= $disable_cmd; - &_log_option($s->{opt_log}, "SENT", $nak, $opt) - if $s->{opt_log}; - - ## Invoke callbacks. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantno") { # they sent positive ack - $$is_enabled = ''; - $$state = "no"; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantno opposite") { # pos ack but we changed our mind - ## Indicate disabled but now we want to enable. - $$is_enabled = ''; - $$state = "wantyes"; - - ## Send queued request. - $s->{unsent_opts} .= $enable_cmd; - &_log_option($s->{opt_log}, "SENT", $ack, $opt) - if $s->{opt_log}; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantyes") { # they sent negative ack - $$is_enabled = ''; - $$state = "no"; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantyes opposite") { # nak but we changed our mind - $$is_enabled = ''; - $$state = "no"; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } -} # end sub _negotiate_recv_disable - - -sub _negotiate_recv_enable { - my ($self, $s, $opt, $opt_request, - $opt_bufpos, $enable_ok, $is_enabled, $state) = @_; - my ( - $ack, - $disable_cmd, - $enable_cmd, - $is_remote, - $nak, - $was_enabled, - ); - - ## What we use to send enable/disable request or send ack/nak response. - if ($opt_request eq "will") { - $enable_cmd = "\377\375" . pack("C", $opt); # do command - $disable_cmd = "\377\376" . pack("C", $opt); # dont command - $is_remote = 1; - $ack = "DO"; - $nak = "DONT"; - - &_log_option($s->{opt_log}, "RCVD", "WILL", $opt) - if $s->{opt_log}; - } - elsif ($opt_request eq "do") { - $enable_cmd = "\377\373" . pack("C", $opt); # will command - $disable_cmd = "\377\374" . pack("C", $opt); # wont command - $is_remote = ''; - $ack = "WILL"; - $nak = "WONT"; - - &_log_option($s->{opt_log}, "RCVD", "DO", $opt) - if $s->{opt_log}; - } - else { # internal error - die; - } - - ## Save current enabled state. - $was_enabled = $$is_enabled; - - ## Respond to WILL or DO based on the current negotiation state. - if ($$state eq "no") { # they're initiating enable - if ($enable_ok) { # we agree they/us should enable - $$is_enabled = 1; - $$state = "yes"; - - ## Send positive acknowledgment. - $s->{unsent_opts} .= $enable_cmd; - &_log_option($s->{opt_log}, "SENT", $ack, $opt) - if $s->{opt_log}; - - ## Invoke callbacks. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - else { # we disagree they/us should enable - ## Send negative acknowledgment. - $s->{unsent_opts} .= $disable_cmd; - &_log_option($s->{opt_log}, "SENT", $nak, $opt) - if $s->{opt_log}; - } - } - elsif ($$state eq "yes") { # state is already enabled - } - elsif ($$state eq "wantno") { # error: our disable req answered by enable - $$is_enabled = ''; - $$state = "no"; - - ## Invoke callbacks. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantno opposite") { # err: disable req answerd by enable - $$is_enabled = 1; - $$state = "yes"; - - ## Invoke callbacks. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantyes") { # they sent pos ack - $$is_enabled = 1; - $$state = "yes"; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantyes opposite") { # pos ack but we changed our mind - ## Indicate enabled but now we want to disable. - $$is_enabled = 1; - $$state = "wantno"; - - ## Inform other side we changed our mind. - $s->{unsent_opts} .= $disable_cmd; - &_log_option($s->{opt_log}, "SENT", $nak, $opt) - if $s->{opt_log}; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - - 1; -} # end sub _negotiate_recv_enable - - -sub _new_handle { - if ($INC{"IO/Handle.pm"}) { - return IO::Handle->new; - } - else { - require FileHandle; - return FileHandle->new; - } -} # end sub _new_handle - - -sub _next_getlines { - my ($self, $s) = @_; - my ( - $len, - $line, - $pos, - @lines, - ); - - ## Fill buffer and get first line. - $line = $self->getline - or return; - push @lines, $line; - - ## Extract subsequent lines from buffer. - while (($pos = index($s->{buf}, $s->{rs})) != -1) { - $len = $pos + length $s->{rs}; - push @lines, substr($s->{buf}, 0, $len); - substr($s->{buf}, 0, $len) = ""; - } - - @lines; -} # end sub _next_getlines - - -sub _opt_accept { - my ($self, @args) = @_; - my ( - $arg, - $option, - $s, - ); - - ## Init. - $s = *$self->{net_telnet}; - - foreach $arg (@args) { - ## Ensure data structure defined for this option. - $option = $arg->{option}; - if (!defined $s->{opts}{$option}) { - &_set_default_option($s, $option); - } - - ## Save whether we'll accept or reject this option. - if ($arg->{is_remote}) { - $s->{opts}{$option}{remote_enable_ok} = $arg->{is_enable}; - } - else { - $s->{opts}{$option}{local_enable_ok} = $arg->{is_enable}; - } - } - - 1; -} # end sub _opt_accept - - -sub _optimal_blksize { - my ($blksize) = @_; - local $^W = ''; # avoid non-numeric warning for ms-windows blksize of "" - - ## Use default when block size is invalid. - return 8192 - unless defined $blksize and $blksize >= 1 and $blksize <= 1_048_576; - - $blksize; -} # end sub _optimal_blksize - - -sub _parse_cmd_remove_mode { - my ($self, $mode) = @_; - - if (!defined $mode) { - $mode = 0; - } - elsif ($mode =~ /^\s*auto\s*$/i) { - $mode = "auto"; - } - elsif ($mode !~ /^\d+$/) { - &_carp($self, "ignoring bad Cmd_remove_mode " . - "argument \"$mode\": it's not \"auto\" or a " . - "non-negative integer"); - $mode = *$self->{net_telnet}{cmd_rm_mode}; - } - - $mode; -} # end sub _parse_cmd_remove_mode - - -sub _parse_errmode { - my ($self, $errmode) = @_; - - ## Set the error mode. - if (!defined $errmode) { - &_carp($self, "ignoring undefined Errmode argument"); - $errmode = *$self->{net_telnet}{errormode}; - } - elsif ($errmode =~ /^\s*return\s*$/i) { - $errmode = "return"; - } - elsif ($errmode =~ /^\s*die\s*$/i) { - $errmode = "die"; - } - elsif (ref($errmode) eq "CODE") { - } - elsif (ref($errmode) eq "ARRAY") { - unless (ref($errmode->[0]) eq "CODE") { - &_carp($self, "ignoring bad Errmode argument: " . - "first list item isn't a code ref"); - $errmode = *$self->{net_telnet}{errormode}; - } - } - else { - &_carp($self, "ignoring bad Errmode argument \"$errmode\""); - $errmode = *$self->{net_telnet}{errormode}; - } - - $errmode; -} # end sub _parse_errmode - - -sub _parse_input_record_separator { - my ($self, $rs) = @_; - - unless (defined $rs and length $rs) { - &_carp($self, "ignoring null Input_record_separator argument"); - $rs = *$self->{net_telnet}{rs}; - } - - $rs; -} # end sub _parse_input_record_separator - - -sub _parse_prompt { - my ($self, $prompt) = @_; - - unless (defined $prompt) { - $prompt = ""; - } - - unless ($prompt =~ m(^\s*/) or $prompt =~ m(^\s*m\s*\W)) { - &_carp($self, "ignoring bad Prompt argument \"$prompt\": " . - "missing opening delimiter of match operator"); - $prompt = *$self->{net_telnet}{cmd_prompt}; - } - - $prompt; -} # end sub _parse_prompt - - -sub _parse_timeout { - my ($self, $timeout) = @_; - - ## Ensure valid timeout. - if (defined $timeout) { - ## Test for non-numeric or negative values. - eval { - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{"__WARN__"} = sub { die "non-numeric\n" }; - local $^W = 1; - $timeout *= 1; - }; - if ($@) { # timeout arg is non-numeric - &_carp($self, - "ignoring non-numeric Timeout argument \"$timeout\""); - $timeout = *$self->{net_telnet}{time_out}; - } - elsif ($timeout < 0) { # timeout arg is negative - &_carp($self, "ignoring negative Timeout argument \"$timeout\""); - $timeout = *$self->{net_telnet}{time_out}; - } - } - - $timeout; -} # end sub _parse_timeout - - -sub _put { - my ($self, $buf, $subname) = @_; - my ( - $endtime, - $len, - $nfound, - $nwrote, - $offset, - $ready, - $s, - $timed_out, - $timeout, - $zero_wrote_count, - ); - - ## Init. - $s = *$self->{net_telnet}; - $s->{num_wrote} = 0; - $zero_wrote_count = 0; - $offset = 0; - $len = length $$buf; - $endtime = &_endtime($s->{time_out}); - - return $self->error("write error: filehandle isn't open") - unless $s->{opened}; - - ## Try to send any waiting option negotiation. - if (length $s->{unsent_opts}) { - &_flush_opts($self); - } - - ## Write until all data blocks written. - while ($len) { - ## Determine how long to wait for output ready. - ($timed_out, $timeout) = &_timeout_interval($endtime); - if ($timed_out) { - $s->{timedout} = 1; - return $self->error("$subname timed-out"); - } - - ## Wait for output ready. - $nfound = select "", $ready=$s->{fdmask}, "", $timeout; - - ## Handle any errors while waiting. - if (!defined $nfound or $nfound <= 0) { # output not ready - if (defined $nfound and $nfound == 0) { # timed-out - $s->{timedout} = 1; - return $self->error("$subname timed-out"); - } - else { # error waiting for output ready - next if $! =~ /^interrupted/i; - - $s->{opened} = ''; - return $self->error("write error: $!"); - } - } - - ## Write the data. - $nwrote = syswrite $self, $$buf, $len, $offset; - - ## Handle any write errors. - if (!defined $nwrote) { # write failed - next if $! =~ /^interrupted/i; # restart interrupted syscall - - $s->{opened} = ''; - return $self->error("write error: $!"); - } - elsif ($nwrote == 0) { # zero chars written - ## Try ten more times to write the data. - if ($zero_wrote_count++ <= 10) { - &_sleep(0.01); - next; - } - - $s->{opened} = ''; - return $self->error("write error: zero length write: $!"); - } - - ## Display network traffic if requested. - if ($s->{dumplog}) { - &_log_dump('>', $s->{dumplog}, $buf, $offset, $nwrote); - } - - ## Increment. - $s->{num_wrote} += $nwrote; - $offset += $nwrote; - $len -= $nwrote; - } - - 1; -} # end sub _put - - -sub _qualify_fh { - my ($obj, $name) = @_; - my ( - $user_class, - ); - local $_; - - ## Get user's package name. - ($user_class) = &_user_caller($obj); - - ## Ensure name is qualified with a package name. - $name = qualify($name, $user_class); - - ## If it's not already, make it a typeglob ref. - if (!ref $name) { - no strict; - local $^W = 0; - - $name =~ s/^\*+//; - $name = eval "\\*$name"; - return unless ref $name; - } - - $name; -} # end sub _qualify_fh - - -sub _reset_options { - my ($opts) = @_; - my ( - $opt, - ); - - foreach $opt (keys %$opts) { - $opts->{$opt}{remote_enabled} = ''; - $opts->{$opt}{remote_state} = "no"; - $opts->{$opt}{local_enabled} = ''; - $opts->{$opt}{local_state} = "no"; - } - - 1; -} # end sub _reset_options - - -sub _save_lastline { - my ($s) = @_; - my ( - $firstpos, - $lastpos, - $len_w_sep, - $len_wo_sep, - $offset, - ); - my $rs = "\n"; - - if (($lastpos = rindex $s->{buf}, $rs) > -1) { # eol found - while (1) { - ## Find beginning of line. - $firstpos = rindex $s->{buf}, $rs, $lastpos - 1; - if ($firstpos == -1) { - $offset = 0; - } - else { - $offset = $firstpos + length $rs; - } - - ## Determine length of line with and without separator. - $len_wo_sep = $lastpos - $offset; - $len_w_sep = $len_wo_sep + length $rs; - - ## Save line if it's not blank. - if (substr($s->{buf}, $offset, $len_wo_sep) - !~ /^\s*$/) - { - $s->{last_line} = substr($s->{buf}, - $offset, - $len_w_sep); - last; - } - - last if $firstpos == -1; - - $lastpos = $firstpos; - } - } - - 1; -} # end sub _save_lastline - - -sub _set_default_option { - my ($s, $option) = @_; - - $s->{opts}{$option} = { - remote_enabled => '', - remote_state => "no", - remote_enable_ok => '', - local_enabled => '', - local_state => "no", - local_enable_ok => '', - }; -} # end sub _set_default_option - - -sub _sleep { - my ($secs) = @_; - my $bitmask = ""; - local *SOCK; - - socket SOCK, AF_INET, SOCK_STREAM, 0; - vec($bitmask, fileno(SOCK), 1) = 1; - select $bitmask, "", "", $secs; - CORE::close SOCK; - - 1; -} # end sub _sleep - - -sub _timeout_interval { - my ($endtime) = @_; - my ( - $timeout, - ); - - ## Return timed-out boolean and timeout interval. - if (defined $endtime) { - ## Is it a one-time poll. - return ('', 0) if $endtime == 0; - - ## Calculate the timeout interval. - $timeout = $endtime - time; - - ## Did we already timeout. - return (1, 0) unless $timeout > 0; - - return ('', $timeout); - } - else { # there is no timeout - return ('', undef); - } -} # end sub _timeout_interval - - -sub _user_caller { - my ($obj) = @_; - my ( - $class, - $curr_pkg, - $file, - $i, - $line, - $pkg, - %isa, - @isa, - ); - local $_; - - ## Create a boolean hash to test for isa. Make sure current - ## package and the object's class are members. - $class = ref $obj; - @isa = eval "\@${class}::ISA"; - push @isa, $class; - ($curr_pkg) = caller 1; - push @isa, $curr_pkg; - %isa = map { $_ => 1 } @isa; - - ## Search back in call frames for a package that's not in isa. - $i = 1; - while (($pkg, $file, $line) = caller ++$i) { - next if $isa{$pkg}; - - return ($pkg, $file, $line); - } - - ## If not found, choose outer most call frame. - ($pkg, $file, $line) = caller --$i; - return ($pkg, $file, $line); -} # end sub _user_caller - - -sub _verify_telopt_arg { - my ($self, $option, $argname) = @_; - - ## If provided, use argument name in error message. - if (defined $argname) { - $argname = "for arg $argname"; - } - else { - $argname = ""; - } - - ## Ensure telnet option is a non-negative integer. - eval { - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{"__WARN__"} = sub { die "non-numeric\n" }; - local $^W = 1; - $option = abs(int $option); - }; - return $self->error("bad telnet option $argname: non-numeric") - if $@; - - return $self->error("bad telnet option $argname: option > 255") - unless $option <= 255; - - $option; -} # end sub _verify_telopt_arg - - -######################## Exported Constants ########################## - - -sub TELNET_IAC () {255}; # interpret as command: -sub TELNET_DONT () {254}; # you are not to use option -sub TELNET_DO () {253}; # please, you use option -sub TELNET_WONT () {252}; # I won't use option -sub TELNET_WILL () {251}; # I will use option -sub TELNET_SB () {250}; # interpret as subnegotiation -sub TELNET_GA () {249}; # you may reverse the line -sub TELNET_EL () {248}; # erase the current line -sub TELNET_EC () {247}; # erase the current character -sub TELNET_AYT () {246}; # are you there -sub TELNET_AO () {245}; # abort output--but let prog finish -sub TELNET_IP () {244}; # interrupt process--permanently -sub TELNET_BREAK () {243}; # break -sub TELNET_DM () {242}; # data mark--for connect. cleaning -sub TELNET_NOP () {241}; # nop -sub TELNET_SE () {240}; # end sub negotiation -sub TELNET_EOR () {239}; # end of record (transparent mode) -sub TELNET_ABORT () {238}; # Abort process -sub TELNET_SUSP () {237}; # Suspend process -sub TELNET_EOF () {236}; # End of file -sub TELNET_SYNCH () {242}; # for telfunc calls - -sub TELOPT_BINARY () {0}; # Binary Transmission -sub TELOPT_ECHO () {1}; # Echo -sub TELOPT_RCP () {2}; # Reconnection -sub TELOPT_SGA () {3}; # Suppress Go Ahead -sub TELOPT_NAMS () {4}; # Approx Message Size Negotiation -sub TELOPT_STATUS () {5}; # Status -sub TELOPT_TM () {6}; # Timing Mark -sub TELOPT_RCTE () {7}; # Remote Controlled Trans and Echo -sub TELOPT_NAOL () {8}; # Output Line Width -sub TELOPT_NAOP () {9}; # Output Page Size -sub TELOPT_NAOCRD () {10}; # Output Carriage-Return Disposition -sub TELOPT_NAOHTS () {11}; # Output Horizontal Tab Stops -sub TELOPT_NAOHTD () {12}; # Output Horizontal Tab Disposition -sub TELOPT_NAOFFD () {13}; # Output Formfeed Disposition -sub TELOPT_NAOVTS () {14}; # Output Vertical Tabstops -sub TELOPT_NAOVTD () {15}; # Output Vertical Tab Disposition -sub TELOPT_NAOLFD () {16}; # Output Linefeed Disposition -sub TELOPT_XASCII () {17}; # Extended ASCII -sub TELOPT_LOGOUT () {18}; # Logout -sub TELOPT_BM () {19}; # Byte Macro -sub TELOPT_DET () {20}; # Data Entry Terminal -sub TELOPT_SUPDUP () {21}; # SUPDUP -sub TELOPT_SUPDUPOUTPUT () {22}; # SUPDUP Output -sub TELOPT_SNDLOC () {23}; # Send Location -sub TELOPT_TTYPE () {24}; # Terminal Type -sub TELOPT_EOR () {25}; # End of Record -sub TELOPT_TUID () {26}; # TACACS User Identification -sub TELOPT_OUTMRK () {27}; # Output Marking -sub TELOPT_TTYLOC () {28}; # Terminal Location Number -sub TELOPT_3270REGIME () {29}; # Telnet 3270 Regime -sub TELOPT_X3PAD () {30}; # X.3 PAD -sub TELOPT_NAWS () {31}; # Negotiate About Window Size -sub TELOPT_TSPEED () {32}; # Terminal Speed -sub TELOPT_LFLOW () {33}; # Remote Flow Control -sub TELOPT_LINEMODE () {34}; # Linemode -sub TELOPT_XDISPLOC () {35}; # X Display Location -sub TELOPT_OLD_ENVIRON () {36}; # Environment Option -sub TELOPT_AUTHENTICATION () {37}; # Authentication Option -sub TELOPT_ENCRYPT () {38}; # Encryption Option -sub TELOPT_NEW_ENVIRON () {39}; # New Environment Option -sub TELOPT_EXOPL () {255}; # Extended-Options-List - - -1; -__END__; - - -######################## User Documentation ########################## - - -## To format the following documentation into a more readable format, -## use one of these programs: perldoc; pod2man; pod2html; pod2text. -## For example, to nicely format this documentation for printing, you -## may use pod2man and groff to convert to postscript: -## pod2man Net/Telnet.pm | groff -man -Tps > Net::Telnet.ps - -=head1 NAME - -Net::Telnet - interact with TELNET port or other TCP ports - -=head1 SYNOPSIS - -C - -see METHODS section below - -=head1 DESCRIPTION - -Net::Telnet allows you to make client connections to a TCP port and do -network I/O, especially to a port using the TELNET protocol. Simple -I/O methods such as print, get, and getline are provided. More -sophisticated interactive features are provided because connecting to -a TELNET port ultimately means communicating with a program designed -for human interaction. These interactive features include the ability -to specify a time-out and to wait for patterns to appear in the input -stream, such as the prompt from a shell. - -Other reasons to use this module than strictly with a TELNET port are: - -=over 2 - -=item * - -You're not familiar with sockets and you want a simple way to make -client connections to TCP services. - -=item * - -You want to be able to specify your own time-out while connecting, -reading, or writing. - -=item * - -You're communicating with an interactive program at the other end of -some socket or pipe and you want to wait for certain patterns to -appear. - -=back - -Here's an example that prints who's logged-on to the remote host -sparky. In addition to a username and password, you must also know -the user's shell prompt, which for this example is C - - use Net::Telnet (); - $t = new Net::Telnet (Timeout => 10, - Prompt => '/bash\$ $/'); - $t->open("sparky"); - $t->login($username, $passwd); - @lines = $t->cmd("who"); - print @lines; - -More examples are in the B section below. - -Usage questions should be directed to the Usenet newsgroup -comp.lang.perl.modules. - -Contact me, Jay Rogers , if you find any bugs or have -suggestions for improvement. - -=head2 What To Know Before Using - -=over 2 - -=item * - -All output is flushed while all input is buffered. Each object -contains its own input buffer. - -=item * - -The output record separator for C and C is set to -C<"\n"> by default, so that you don't have to append all your commands -with a newline. To avoid printing a trailing C<"\n"> use C or -set the I to C<"">. - -=item * - -The methods C and C use the I setting in the -object to determine when a login or remote command is complete. Those -methods will fail with a time-out if you don't set the prompt -correctly. - -=item * - -Use a combination of C and C as an alternative to -C or C when they don't do what you want. - -=item * - -Errors such as timing-out are handled according to the error mode -action. The default action is to print an error message to standard -error and have the program die. See the C method for more -information. - -=item * - -When constructing the match operator argument for C or -C, always use single quotes instead of double quotes to -avoid unexpected backslash interpretation (e.g. C<'/bash\$ $/'>). If -you're constructing a DOS like file path, you'll need to use four -backslashes to represent one (e.g. C<'/c:\\\\users\\\\billE$/i'>). - -Of course don't forget about regexp metacharacters like C<.>, C<[>, or -C<$>. You'll only need a single backslash to quote them. The anchor -metacharacters C<^> and C<$> refer to positions in the input buffer. -To avoid matching characters read that look like a prompt, it's a good -idea to end your prompt pattern with the C<$> anchor. That way the -prompt will only match if it's the last thing read. - -=item * - -In the input stream, each sequence of I and I (i.e. C<"\015\012"> or CR LF) is converted to C<"\n">. In the -output stream, each occurrence of C<"\n"> is converted to a sequence -of CR LF. See C to change the behavior. TCP protocols -typically use the ASCII sequence, carriage return and line feed to -designate a newline. - -=item * - -Timing-out while making a connection is disabled for machines that -don't support the C function. Most notably these include -MS-Windows machines. - -=item * - -You'll need to be running at least Perl version 5.002 to use this -module. This module does not require any libraries that don't already -come with a standard Perl distribution. - -If you have the IO:: libraries installed (they come standard with -perl5.004 and later) then IO::Socket::INET is used as a base class, -otherwise FileHandle is used. - -=item * - -Contact me, Jay Rogers , if you find any bugs or have -suggestions for improvement. - -=back - -=head2 Debugging - -The typical usage bug causes a time-out error because you've made -incorrect assumptions about what the remote side actually sends. The -easiest way to reconcile what the remote side sends with your -expectations is to use C or C. - -C allows you to see the data being sent from the remote -side before any translation is done, while C shows you -the results after translation. The translation includes converting -end of line characters, removing and responding to TELNET protocol -commands in the data stream. - -=head2 Style of Named Parameters - -Two different styles of named parameters are supported. This document -only shows the IO:: style: - - Net::Telnet->new(Timeout => 20); - -however the dash-option style is also allowed: - - Net::Telnet->new(-timeout => 20); - -=head2 Connecting to a Remote MS-Windows Machine - -By default MS-Windows doesn't come with a TELNET server. However -third party TELNET servers are available. Unfortunately many of these -servers falsely claim to be a TELNET server. This is especially true -of the so-called "Microsoft Telnet Server" that comes installed with -some newer versions MS-Windows. - -When a TELNET server first accepts a connection, it must use the ASCII -control characters carriage-return and line-feed to start a new line -(see RFC854). A server like the "Microsoft Telnet Server" that -doesn't do this, isn't a TELNET server. These servers send ANSI -terminal escape sequences to position to a column on a subsequent line -and to even position while writing characters that are adjacent to -each other. Worse, when sending output these servers resend -previously sent command output in a misguided attempt to display an -entire terminal screen. - -Connecting Net::Telnet to one of these false TELNET servers makes your -job of parsing command output very difficult. It's better to replace -a false TELNET server with a real TELNET server. The better TELNET -servers for MS-Windows allow you to avoid the ANSI escapes by turning -off something some of them call I. - - -=head1 METHODS - -In the calling sequences below, square brackets B<[]> represent -optional parameters. - -=over 4 - -=item B - create a new Net::Telnet object - - $obj = new Net::Telnet ([$host]); - - $obj = new Net::Telnet ([Binmode => $mode,] - [Cmd_remove_mode => $mode,] - [Dump_Log => $filename,] - [Errmode => $errmode,] - [Fhopen => $filehandle,] - [Host => $host,] - [Input_log => $file,] - [Input_record_separator => $chars,] - [Option_log => $file,] - [Ors => $chars,] - [Output_log => $file,] - [Output_record_separator => $chars,] - [Port => $port,] - [Prompt => $matchop,] - [Rs => $chars,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This is the constructor for Net::Telnet objects. A new object is -returned on success, the error mode action is performed on failure - -see C. The optional arguments are short-cuts to methods of -the same name. - -If the I<$host> argument is given then the object is opened by -connecting to TCP I<$port> on I<$host>. Also see C. The new -object returned is given the following defaults in the absence of -corresponding named parameters: - -=over 4 - -=item - -The default I is C<"localhost"> - -=item - -The default I is C<23> - -=item - -The default I is C<'/[\$%#E] $/'> - -=item - -The default I is C<10> - -=item - -The default I is C<"die"> - -=item - -The default I is C<"\n">. Note that I -is synonymous with I. - -=item - -The default I is C<"\n">. Note that I is -synonymous with I. - -=item - -The default I is C<0>, which means do newline translation. - -=item - -The default I is C<1>, which means respond to TELNET -commands in the data stream. - -=item - -The default I is C<"auto"> - -=item - -The defaults for I, I, I, and -I are C<"">, which means that logging is turned-off. - -=back - -=back - - -=over 4 - -=item B - toggle newline translation - - $mode = $obj->binmode; - - $prev = $obj->binmode($mode); - -This method controls whether or not sequences of carriage returns and -line feeds (CR LF or more specifically C<"\015\012">) are translated. -By default they are translated (i.e. binmode is C<0>). - -If no argument is given, the current mode is returned. - -If I<$mode> is C<1> then binmode is I and newline translation is -not done. - -If I<$mode> is C<0> then binmode is I and newline translation is -done. In the input stream, each sequence of CR LF is converted to -C<"\n"> and in the output stream, each occurrence of C<"\n"> is -converted to a sequence of CR LF. - -Note that input is always buffered. Changing binmode doesn't effect -what's already been read into the buffer. Output is not buffered and -changing binmode will have an immediate effect. - -=back - - -=over 4 - -=item B - send TELNET break character - - $ok = $obj->break; - -This method sends the TELNET break character. This character is -provided because it's a signal outside the ASCII character set which -is currently given local meaning within many systems. It's intended -to indicate that the Break Key or the Attention Key was hit. - -This method returns C<1> on success, or performs the error mode action -on failure. - -=back - - -=over 4 - -=item B - scalar reference to object's input buffer - - $ref = $obj->buffer; - -This method returns a scalar reference to the input buffer for -I<$obj>. Data in the input buffer is data that has been read from the -remote side but has yet to be read by the user. Modifications to the -input buffer are returned by a subsequent read. - -=back - - -=over 4 - -=item B - discard all data in object's input buffer - - $obj->buffer_empty; - -This method removes all data in the input buffer for I<$obj>. - -=back - - -=over 4 - -=item B - close object - - $ok = $obj->close; - -This method closes the socket, file, or pipe associated with the -object. It always returns a value of C<1>. - -=back - - -=over 4 - -=item B - issue command and retrieve output - - $ok = $obj->cmd($string); - $ok = $obj->cmd(String => $string, - [Output => $ref,] - [Cmd_remove_mode => $mode,] - [Errmode => $mode,] - [Input_record_separator => $chars,] - [Ors => $chars,] - [Output_record_separator => $chars,] - [Prompt => $match,] - [Rs => $chars,] - [Timeout => $secs,]); - - @output = $obj->cmd($string); - @output = $obj->cmd(String => $string, - [Output => $ref,] - [Cmd_remove_mode => $mode,] - [Errmode => $mode,] - [Input_record_separator => $chars,] - [Ors => $chars,] - [Output_record_separator => $chars,] - [Prompt => $match,] - [Rs => $chars,] - [Timeout => $secs,]); - -This method sends the command I<$string>, and reads the characters -sent back by the command up until and including the matching prompt. -It's assumed that the program to which you're sending is some kind of -command prompting interpreter such as a shell. - -The command I<$string> is automatically appended with the -output_record_separator, By default that's C<"\n">. This is similar -to someone typing a command and hitting the return key. Set the -output_record_separator to change this behavior. - -In a scalar context, the characters read from the remote side are -discarded and C<1> is returned on success. On time-out, eof, or other -failures, the error mode action is performed. See C. - -In a list context, just the output generated by the command is -returned, one line per element. In other words, all the characters in -between the echoed back command string and the prompt are returned. -If the command happens to return no output, a list containing one -element, the empty string is returned. This is so the list will -indicate true in a boolean context. On time-out, eof, or other -failures, the error mode action is performed. See C. - -The characters that matched the prompt may be retrieved using -C. - -Many command interpreters echo back the command sent. In most -situations, this method removes the first line returned from the -remote side (i.e. the echoed back command). See C -for more control over this feature. - -Use C to debug when this method keeps timing-out and you -don't think it should. - -Consider using a combination of C and C as an -alternative to this method when it doesn't do what you want, e.g. the -command you send prompts for input. - -The I named parameter provides an alternative method of -receiving command output. If you pass a scalar reference, all the -output (even if it contains multiple lines) is returned in the -referenced scalar. If you pass an array or hash reference, the lines -of output are returned in the referenced array or hash. You can use -C to change the notion of what separates a -line. - -Optional named parameters are provided to override the current -settings of cmd_remove_mode, errmode, input_record_separator, ors, -output_record_separator, prompt, rs, and timeout. Rs is synonymous -with input_record_separator and ors is synonymous with -output_record_separator. - -=back - - -=over 4 - -=item B - toggle removal of echoed commands - - $mode = $obj->cmd_remove_mode; - - $prev = $obj->cmd_remove_mode($mode); - -This method controls how to deal with echoed back commands in the -output returned by cmd(). Typically, when you send a command to the -remote side, the first line of output returned is the command echoed -back. Use this mode to remove the first line of output normally -returned by cmd(). - -If no argument is given, the current mode is returned. - -If I<$mode> is C<0> then the command output returned from cmd() has no -lines removed. If I<$mode> is a positive integer, then the first -I<$mode> lines of command output are stripped. - -By default, I<$mode> is set to C<"auto">. Auto means that whether or -not the first line of command output is stripped, depends on whether -or not the remote side offered to echo. By default, Net::Telnet -always accepts an offer to echo by the remote side. You can change -the default to reject such an offer using C. - -A warning is printed to STDERR when attempting to set this attribute -to something that's not C<"auto"> or a non-negative integer. - -=back - - -=over 4 - -=item B - log all I/O in dump format - - $fh = $obj->dump_log; - - $fh = $obj->dump_log($fh); - - $fh = $obj->dump_log($filename); - -This method starts or stops dump format logging of all the object's -input and output. The dump format shows the blocks read and written -in a hexadecimal and printable character format. This method is -useful when debugging, however you might want to first try -C as it's more readable. - -If no argument is given, the current log filehandle is returned. An -empty string indicates logging is off. - -To stop logging, use an empty string as an argument. - -If an open filehandle is given, it is used for logging and returned. -Otherwise, the argument is assumed to be the name of a file, the file -is opened and a filehandle to it is returned. If the file can't be -opened for writing, the error mode action is performed. - -=back - - -=over 4 - -=item B - end of file indicator - - $eof = $obj->eof; - -This method returns C<1> if end of file has been read, otherwise it -returns an empty string. Because the input is buffered this isn't the -same thing as I<$obj> has closed. In other words I<$obj> can be -closed but there still can be stuff in the buffer to be read. Under -this condition you can still read but you won't be able to write. - -=back - - -=over 4 - -=item B - define action to be performed on error - - $mode = $obj->errmode; - - $prev = $obj->errmode($mode); - -This method gets or sets the action used when errors are encountered -using the object. The first calling sequence returns the current -error mode. The second calling sequence sets it to I<$mode> and -returns the previous mode. Valid values for I<$mode> are C<"die"> -(the default), C<"return">, a I, or an I. - -When mode is C<"die"> and an error is encountered using the object, -then an error message is printed to standard error and the program -dies. - -When mode is C<"return"> then the method generating the error places -an error message in the object and returns an undefined value in a -scalar context and an empty list in list context. The error message -may be obtained using C. - -When mode is a I, then when an error is encountered -I is called with the error message as its first argument. -Using this mode you may have your own subroutine handle errors. If -I itself returns then the method generating the error returns -undefined or an empty list depending on context. - -When mode is an I, the first element of the array must be a -I. Any elements that follow are the arguments to I. -When an error is encountered, the I is called with its -arguments. Using this mode you may have your own subroutine handle -errors. If the I itself returns then the method generating -the error returns undefined or an empty list depending on context. - -A warning is printed to STDERR when attempting to set this attribute -to something that's not C<"die">, C<"return">, a I, or an -I whose first element isn't a I. - -=back - - -=over 4 - -=item B - most recent error message - - $msg = $obj->errmsg; - - $prev = $obj->errmsg(@msgs); - -The first calling sequence returns the error message associated with -the object. The empty string is returned if no error has been -encountered yet. The second calling sequence sets the error message -for the object to the concatenation of I<@msgs> and returns the -previous error message. Normally, error messages are set internally -by a method when an error is encountered. - -=back - - -=over 4 - -=item B - perform the error mode action - - $obj->error(@msgs); - -This method concatenates I<@msgs> into a string and places it in the -object as the error message. Also see C. It then performs -the error mode action. Also see C. - -If the error mode doesn't cause the program to die, then an undefined -value or an empty list is returned depending on the context. - -This method is primarily used by this class or a sub-class to perform -the user requested action when an error is encountered. - -=back - - -=over 4 - -=item B - use already open filehandle for I/O - - $ok = $obj->fhopen($fh); - -This method associates the open filehandle I<$fh> with I<$obj> for -further I/O. Filehandle I<$fh> must already be opened. - -Suppose you want to use the features of this module to do I/O to -something other than a TCP port, for example STDIN or a filehandle -opened to read from a process. Instead of opening the object for I/O -to a TCP port by using C or C, call this method -instead. - -The value C<1> is returned success, the error mode action is performed -on failure. - -=back - - -=over 4 - -=item B - read block of data - - $data = $obj->get([Binmode => $mode,] - [Errmode => $errmode,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This method reads a block of data from the object and returns it along -with any buffered data. If no buffered data is available to return, -it will wait for data to read using the timeout specified in the -object. You can override that timeout using I<$secs>. Also see -C. If buffered data is available to return, it also checks -for a block of data that can be immediately read. - -On eof an undefined value is returned. On time-out or other failures, -the error mode action is performed. To distinguish between eof or an -error occurring when the error mode is not set to C<"die">, use -C. - -Optional named parameters are provided to override the current -settings of binmode, errmode, telnetmode, and timeout. - -=back - - -=over 4 - -=item B - read next line - - $line = $obj->getline([Binmode => $mode,] - [Errmode => $errmode,] - [Input_record_separator => $chars,] - [Rs => $chars,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This method reads and returns the next line of data from the object. -You can use C to change the notion of what -separates a line. The default is C<"\n">. If a line isn't -immediately available, this method blocks waiting for a line or a -time-out. - -On eof an undefined value is returned. On time-out or other failures, -the error mode action is performed. To distinguish between eof or an -error occurring when the error mode is not set to C<"die">, use -C. - -Optional named parameters are provided to override the current -settings of binmode, errmode, input_record_separator, rs, telnetmode, -and timeout. Rs is synonymous with input_record_separator. - -=back - - -=over 4 - -=item B - read next lines - - @lines = $obj->getlines([Binmode => $mode,] - [Errmode => $errmode,] - [Input_record_separator => $chars,] - [Rs => $chars,] - [Telnetmode => $mode,] - [Timeout => $secs,] - [All => $boolean,]); - -This method reads and returns all the lines of data from the object -until end of file is read. You can use C to -change the notion of what separates a line. The default is C<"\n">. -A time-out error occurs if all the lines can't be read within the -time-out interval. See C. - -The behavior of this method was changed in version 3.03. Prior to -version 3.03 this method returned just the lines available from the -next read. To get that old behavior, use the optional named parameter -I and set I<$boolean> to C<""> or C<0>. - -If only eof is read then an empty list is returned. On time-out or -other failures, the error mode action is performed. Use C to -distinguish between reading only eof or an error occurring when the -error mode is not set to C<"die">. - -Optional named parameters are provided to override the current -settings of binmode, errmode, input_record_separator, rs, telnetmode, -and timeout. Rs is synonymous with input_record_separator. - -=back - - -=over 4 - -=item B - name of remote host - - $host = $obj->host; - - $prev = $obj->host($host); - -This method designates the remote host for C. With no -argument it returns the current host name set in the object. With an -argument it sets the current host name to I<$host> and returns the -previous host name. You may indicate the remote host using either a -hostname or an IP address. - -The default value is C<"localhost">. It may also be set by C -or C. - -=back - - -=over 4 - -=item B - log all input - - $fh = $obj->input_log; - - $fh = $obj->input_log($fh); - - $fh = $obj->input_log($filename); - -This method starts or stops logging of input. This is useful when -debugging. Also see C. Because most command interpreters -echo back commands received, it's likely all your output will also be -in this log. Note that input logging occurs after newline -translation. See C for details on newline translation. - -If no argument is given, the log filehandle is returned. An empty -string indicates logging is off. - -To stop logging, use an empty string as an argument. - -If an open filehandle is given, it is used for logging and returned. -Otherwise, the argument is assumed to be the name of a file, the file -is opened for logging and a filehandle to it is returned. If the file -can't be opened for writing, the error mode action is performed. - -=back - - -=over 4 - -=item B - input line delimiter - - $chars = $obj->input_record_separator; - - $prev = $obj->input_record_separator($chars); - -This method designates the line delimiter for input. It's used with -C, C, and C to determine lines in the -input. - -With no argument this method returns the current input record -separator set in the object. With an argument it sets the input -record separator to I<$chars> and returns the previous value. Note -that I<$chars> must have length. - -A warning is printed to STDERR when attempting to set this attribute -to a string with no length. - -=back - - -=over 4 - -=item B - last prompt read - - $string = $obj->last_prompt; - - $prev = $obj->last_prompt($string); - -With no argument this method returns the last prompt read by cmd() or -login(). See C. With an argument it sets the last prompt -read to I<$string> and returns the previous value. Normally, only -internal methods set the last prompt. - -=back - - -=over 4 - -=item B - last line read - - $line = $obj->lastline; - - $prev = $obj->lastline($line); - -This method retrieves the last line read from the object. This may be -a useful error message when the remote side abnormally closes the -connection. Typically the remote side will print an error message -before closing. - -With no argument this method returns the last line read from the -object. With an argument it sets the last line read to I<$line> and -returns the previous value. Normally, only internal methods set the -last line. - -=back - - -=over 4 - -=item B - perform standard login - - $ok = $obj->login($username, $password); - - $ok = $obj->login(Name => $username, - Password => $password, - [Errmode => $mode,] - [Prompt => $match,] - [Timeout => $secs,]); - -This method performs a standard login by waiting for a login prompt -and responding with I<$username>, then waiting for the password prompt -and responding with I<$password>, and then waiting for the command -interpreter prompt. If any of those prompts sent by the remote side -don't match what's expected, this method will time-out, unless timeout -is turned off. - -Login prompt must match either of these case insensitive patterns: - - /login[: ]*$/i - /username[: ]*$/i - -Password prompt must match this case insensitive pattern: - - /password[: ]*$/i - -The command interpreter prompt must match the current setting of -prompt. See C. - -Use C to debug when this method keeps timing-out and you -don't think it should. - -Consider using a combination of C and C as an -alternative to this method when it doesn't do what you want, e.g. the -remote host doesn't prompt for a username. - -On success, C<1> is returned. On time out, eof, or other failures, -the error mode action is performed. See C. - -Optional named parameters are provided to override the current -settings of errmode, prompt, and timeout. - -=back - - -=over 4 - -=item B - maximum size of input buffer - - $len = $obj->max_buffer_length; - - $prev = $obj->max_buffer_length($len); - -This method designates the maximum size of the input buffer. An error -is generated when a read causes the buffer to exceed this limit. The -default value is 1,048,576 bytes (1MB). The input buffer can grow -much larger than the block size when you continuously read using -C or C and the data stream contains no newlines -or matching waitfor patterns. - -With no argument, this method returns the current maximum buffer -length set in the object. With an argument it sets the maximum buffer -length to I<$len> and returns the previous value. Values of I<$len> -smaller than 512 will be adjusted to 512. - -A warning is printed to STDERR when attempting to set this attribute -to something that isn't a positive integer. - -=back - - -=over 4 - -=item B - field separator for print - - $chars = $obj->ofs - - $prev = $obj->ofs($chars); - -This method is synonymous with C. - -=back - - -=over 4 - -=item B - connect to port on remote host - - $ok = $obj->open($host); - - $ok = $obj->open([Host => $host,] - [Port => $port,] - [Errmode => $mode,] - [Timeout => $secs,]); - -This method opens a TCP connection to I<$port> on I<$host>. If either -argument is missing then the current value of C or C -is used. Optional named parameters are provided to override the -current setting of errmode and timeout. - -On success C<1> is returned. On time-out or other connection -failures, the error mode action is performed. See C. - -Time-outs don't work for this method on machines that don't implement -SIGALRM - most notably MS-Windows machines. For those machines, an -error is returned when the system reaches its own time-out while -trying to connect. - -A side effect of this method is to reset the alarm interval associated -with SIGALRM. - -=back - - -=over 4 - -=item B - indicate willingness to accept a TELNET option - - $fh = $obj->option_accept([Do => $telopt,] - [Dont => $telopt,] - [Will => $telopt,] - [Wont => $telopt,]); - -This method is used to indicate whether to accept or reject an offer -to enable a TELNET option made by the remote side. If you're using -I or I to indicate a willingness to enable, then a -notification callback must have already been defined by a prior call -to C. See C for details on -receiving enable/disable notification of a TELNET option. - -You can give multiple I, I, I, or I arguments -for different TELNET options in the same call to this method. - -The following example describes the meaning of the named parameters. -A TELNET option, such as C used below, is an integer -constant that you can import from Net::Telnet. See the source in file -Telnet.pm for the complete list. - -=over 4 - -=item - -I => C - -=over 4 - -=item - -we'll accept an offer to enable the echo option on the local side - -=back - -=item - -I => C - -=over 4 - -=item - -we'll reject an offer to enable the echo option on the local side - -=back - -=item - -I => C - -=over 4 - -=item - -we'll accept an offer to enable the echo option on the remote side - -=back - -=item - -I => C - -=over 4 - -=item - -we'll reject an offer to enable the echo option on the remote side - -=back - -=back - -=item - -Use C to send a request to the remote side to enable or -disable a particular TELNET option. - -=back - - -=over 4 - -=item B - define the option negotiation callback - - $coderef = $obj->option_callback; - - $prev = $obj->option_callback($coderef); - -This method defines the callback subroutine that's called when a -TELNET option is enabled or disabled. Once defined, the -I may not be undefined. However, calling this method -with a different I<$coderef> changes it. - -A warning is printed to STDERR when attempting to set this attribute -to something that isn't a coderef. - -Here are the circumstances that invoke I<$coderef>: - -=over 4 - -=item - -An option becomes enabled because the remote side requested an enable -and C had been used to arrange that it be accepted. - -=item - -The remote side arbitrarily decides to disable an option that is -currently enabled. Note that Net::Telnet always accepts a request to -disable from the remote side. - -=item - -C was used to send a request to enable or disable an -option and the response from the remote side has just been received. -Note, that if a request to enable is rejected then I<$coderef> is -still invoked even though the option didn't change. - -=back - -=item - -Here are the arguments passed to I<&$coderef>: - - &$coderef($obj, $option, $is_remote, - $is_enabled, $was_enabled, $buf_position); - -=over 4 - -=item - -1. I<$obj> is the Net::Telnet object - -=item - -2. I<$option> is the TELNET option. Net::Telnet exports constants -for the various TELNET options which just equate to an integer. - -=item - -3. I<$is_remote> is a boolean indicating for which side the option -applies. - -=item - -4. I<$is_enabled> is a boolean indicating the option is enabled or -disabled - -=item - -5. I<$was_enabled> is a boolean indicating the option was previously -enabled or disabled - -=item - -6. I<$buf_position> is an integer indicating the position in the -object's input buffer where the option takes effect. See C -to access the object's input buffer. - -=back - -=back - - -=over 4 - -=item B - log all TELNET options sent or received - - $fh = $obj->option_log; - - $fh = $obj->option_log($fh); - - $fh = $obj->option_log($filename); - -This method starts or stops logging of all TELNET options being sent -or received. This is useful for debugging when you send options via -C or you arrange to accept option requests from the -remote side via C. Also see C. - -If no argument is given, the log filehandle is returned. An empty -string indicates logging is off. - -To stop logging, use an empty string as an argument. - -If an open filehandle is given, it is used for logging and returned. -Otherwise, the argument is assumed to be the name of a file, the file -is opened for logging and a filehandle to it is returned. If the file -can't be opened for writing, the error mode action is performed. - -=back - - -=over 4 - -=item B - send TELNET option negotiation request - - $ok = $obj->option_send([Do => $telopt,] - [Dont => $telopt,] - [Will => $telopt,] - [Wont => $telopt,] - [Async => $boolean,]); - -This method is not yet implemented. Look for it in a future version. - -=back - - -=over 4 - -=item B - get current state of a TELNET option - - $hashref = $obj->option_state($telopt); - -This method returns a hashref containing a copy of the current state -of TELNET option I<$telopt>. - -Here are the values returned in the hash: - -=over 4 - -=item - -I<$hashref>->{remote_enabled} - -=over 4 - -=item - -boolean that indicates if the option is enabled on the remote side. - -=back - -=item - -I<$hashref>->{remote_enable_ok} - -=over 4 - -=item - -boolean that indicates if it's ok to accept an offer to enable this -option on the remote side. - -=back - -=item - -I<$hashref>->{remote_state} - -=over 4 - -=item - -string used to hold the internal state of option negotiation for this -option on the remote side. - -=back - -=item - -I<$hashref>->{local_enabled} - -=over 4 - -=item - -boolean that indicates if the option is enabled on the local side. - -=back - -=item - -I<$hashref>->{local_enable_ok} - -=over 4 - -=item - -boolean that indicates if it's ok to accept an offer to enable this -option on the local side. - -=back - -=item - -I<$hashref>->{local_state} - -=over 4 - -=item - -string used to hold the internal state of option negotiation for this -option on the local side. - -=back - -=back - -=back - - -=over 4 - -=item B - output line delimiter - - $chars = $obj->ors; - - $prev = $obj->ors($chars); - -This method is synonymous with C. - -=back - - -=over 4 - -=item B - field separator for print - - $chars = $obj->output_field_separator; - - $prev = $obj->output_field_separator($chars); - -This method designates the output field separator for C. -Ordinarily the print method simply prints out the comma separated -fields you specify. Set this to specify what's printed between -fields. - -With no argument this method returns the current output field -separator set in the object. With an argument it sets the output -field separator to I<$chars> and returns the previous value. - -By default it's set to an empty string. - -=back - - -=over 4 - -=item B - log all output - - $fh = $obj->output_log; - - $fh = $obj->output_log($fh); - - $fh = $obj->output_log($filename); - -This method starts or stops logging of output. This is useful when -debugging. Also see C. Because most command interpreters -echo back commands received, it's likely all your output would also be -in an input log. See C. Note that output logging occurs -before newline translation. See C for details on newline -translation. - -If no argument is given, the log filehandle is returned. An empty -string indicates logging is off. - -To stop logging, use an empty string as an argument. - -If an open filehandle is given, it is used for logging and returned. -Otherwise, the argument is assumed to be the name of a file, the file -is opened for logging and a filehandle to it is returned. If the file -can't be opened for writing, the error mode action is performed. - -=back - - -=over 4 - -=item B - output line delimiter - - $chars = $obj->output_record_separator; - - $prev = $obj->output_record_separator($chars); - -This method designates the output line delimiter for C and -C. Set this to specify what's printed at the end of C -and C. - -The output record separator is set to C<"\n"> by default, so there's -no need to append all your commands with a newline. To avoid printing -the output_record_separator use C or set the -output_record_separator to an empty string. - -With no argument this method returns the current output record -separator set in the object. With an argument it sets the output -record separator to I<$chars> and returns the previous value. - -=back - - -=over 4 - -=item B - remote port - - $port = $obj->port; - - $prev = $obj->port($port); - -This method designates the remote TCP port. With no argument this -method returns the current port number. With an argument it sets the -current port number to I<$port> and returns the previous port. If -I<$port> is a TCP service name, then it's first converted to a port -number using the perl function C. - -The default value is C<23>. It may also be set by C or -C. - -A warning is printed to STDERR when attempting to set this attribute -to something that's not a positive integer or a valid TCP service -name. - -=back - - -=over 4 - -=item B - write to object - - $ok = $obj->print(@list); - -This method writes I<@list> followed by the I -to the open object and returns C<1> if all data was successfully -written. On time-out or other failures, the error mode action is -performed. See C. - -By default, the C is set to C<"\n"> so all -your commands automatically end with a newline. In most cases your -output is being read by a command interpreter which won't accept a -command until newline is read. This is similar to someone typing a -command and hitting the return key. To avoid printing a trailing -C<"\n"> use C instead or set the output_record_separator to an -empty string. - -On failure, it's possible that some data was written. If you choose -to try and recover from a print timing-out, use C to -determine how much was written before the error occurred. - -You may also use the output field separator to print a string between -the list elements. See C. - -=back - - -=over 4 - -=item B - number of bytes written by print - - $num = $obj->print_length; - -This returns the number of bytes successfully written by the most -recent C or C. - -=back - - -=over 4 - -=item B - pattern to match a prompt - - $matchop = $obj->prompt; - - $prev = $obj->prompt($matchop); - -This method sets the pattern used to find a prompt in the input -stream. It must be a string representing a valid perl pattern match -operator. The methods C and C try to read until -matching the prompt. They will fail with a time-out error if the -pattern you've chosen doesn't match what the remote side sends. - -With no argument this method returns the prompt set in the object. -With an argument it sets the prompt to I<$matchop> and returns the -previous value. - -The default prompt is C<'/[\$%#E] $/'> - -Always use single quotes, instead of double quotes, to construct -I<$matchop> (e.g. C<'/bash\$ $/'>). If you're constructing a DOS like -file path, you'll need to use four backslashes to represent one -(e.g. C<'/c:\\\\users\\\\billE$/i'>). - -Of course don't forget about regexp metacharacters like C<.>, C<[>, or -C<$>. You'll only need a single backslash to quote them. The anchor -metacharacters C<^> and C<$> refer to positions in the input buffer. - -A warning is printed to STDERR when attempting to set this attribute -with a match operator missing its opening delimiter. - -=back - - -=over 4 - -=item B - write to object - - $ok = $obj->put($string); - - $ok = $obj->put(String => $string, - [Binmode => $mode,] - [Errmode => $errmode,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This method writes I<$string> to the opened object and returns C<1> if -all data was successfully written. This method is like C -except that it doesn't write the trailing output_record_separator -("\n" by default). On time-out or other failures, the error mode -action is performed. See C. - -On failure, it's possible that some data was written. If you choose -to try and recover from a put timing-out, use C to -determine how much was written before the error occurred. - -Optional named parameters are provided to override the current -settings of binmode, errmode, telnetmode, and timeout. - -=back - - -=over 4 - -=item B - input line delimiter - - $chars = $obj->rs; - - $prev = $obj->rs($chars); - -This method is synonymous with C. - -=back - - -=over 4 - -=item B - turn off/on telnet command interpretation - - $mode = $obj->telnetmode; - - $prev = $obj->telnetmode($mode); - -This method controls whether or not TELNET commands in the data stream -are recognized and handled. The TELNET protocol uses certain -character sequences sent in the data stream to control the session. -If the port you're connecting to isn't using the TELNET protocol, then -you should turn this mode off. The default is I. - -If no argument is given, the current mode is returned. - -If I<$mode> is C<0> then telnet mode is off. If I<$mode> is C<1> then -telnet mode is on. - -=back - - -=over 4 - -=item B - time-out indicator - - $boolean = $obj->timed_out; - - $prev = $obj->timed_out($boolean); - -This method indicates if a previous read, write, or open method -timed-out. Remember that timing-out is itself an error. To be able -to invoke C after a time-out error, you'd have to change -the default error mode to something other than C<"die">. See -C. - -With no argument this method returns C<1> if the previous method -timed-out. With an argument it sets the indicator. Normally, only -internal methods set this indicator. - -=back - - -=over 4 - -=item B - I/O time-out interval - - $secs = $obj->timeout; - - $prev = $obj->timeout($secs); - -This method sets the timeout interval that's used when performing I/O -or connecting to a port. When a method doesn't complete within the -timeout interval then it's an error and the error mode action is -performed. - -A timeout may be expressed as a relative or absolute value. If -I<$secs> is greater than or equal to the time the program started, as -determined by $^T, then it's an absolute time value for when time-out -occurs. The perl function C may be used to obtain an absolute -time value. For a relative time-out value less than $^T, time-out -happens I<$secs> from when the method begins. - -If I<$secs> is C<0> then time-out occurs if the data cannot be -immediately read or written. Use the undefined value to turn off -timing-out completely. - -With no argument this method returns the timeout set in the object. -With an argument it sets the timeout to I<$secs> and returns the -previous value. The default timeout value is C<10> seconds. - -A warning is printed to STDERR when attempting to set this attribute -to something that's not an C or a non-negative integer. - -=back - - -=over 4 - -=item B - wait for pattern in the input - - $ok = $obj->waitfor($matchop); - $ok = $obj->waitfor([Match => $matchop,] - [String => $string,] - [Binmode => $mode,] - [Errmode => $errmode,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - - ($prematch, $match) = $obj->waitfor($matchop); - ($prematch, $match) = $obj->waitfor([Match => $matchop,] - [String => $string,] - [Binmode => $mode,] - [Errmode => $errmode,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This method reads until a pattern match or string is found in the -input stream. All the characters before and including the match are -removed from the input stream. - -In a list context the characters before the match and the matched -characters are returned in I<$prematch> and I<$match>. In a scalar -context, the matched characters and all characters before it are -discarded and C<1> is returned on success. On time-out, eof, or other -failures, for both list and scalar context, the error mode action is -performed. See C. - -You can specify more than one pattern or string by simply providing -multiple I and/or I named parameters. A I<$matchop> -must be a string representing a valid Perl pattern match operator. -The I<$string> is just a substring to find in the input stream. - -Use C to debug when this method keeps timing-out and you -don't think it should. - -An optional named parameter is provided to override the current -setting of timeout. - -To avoid unexpected backslash interpretation, always use single quotes -instead of double quotes to construct a match operator argument for -C and C (e.g. C<'/bash\$ $/'>). If you're -constructing a DOS like file path, you'll need to use four backslashes -to represent one (e.g. C<'/c:\\\\users\\\\billE$/i'>). - -Of course don't forget about regexp metacharacters like C<.>, C<[>, or -C<$>. You'll only need a single backslash to quote them. The anchor -metacharacters C<^> and C<$> refer to positions in the input buffer. - -Optional named parameters are provided to override the current -settings of binmode, errmode, telnetmode, and timeout. - -=back - - -=head1 SEE ALSO - -=over 2 - -=item RFC 854 - -S - -S - -=item RFC 1143 - -S - -S - -=item TELNET Option Assignments - -S - -=back - - -=head1 EXAMPLES - -This example gets the current weather forecast for Brainerd, Minnesota. - - my ($forecast, $t); - - use Net::Telnet (); - $t = new Net::Telnet; - $t->open("rainmaker.wunderground.com"); - - ## Wait for first prompt and "hit return". - $t->waitfor('/continue:.*$/'); - $t->print(""); - - ## Wait for second prompt and respond with city code. - $t->waitfor('/city code.*$/'); - $t->print("BRD"); - - ## Read and print the first page of forecast. - ($forecast) = $t->waitfor('/[ \t]+press return to continue/i'); - print $forecast; - - exit; - - -This example checks a POP server to see if you have mail. - - my ($hostname, $line, $passwd, $pop, $username); - - $hostname = "your_destination_host_here"; - $username = "your_username_here"; - $passwd = "your_password_here"; - - use Net::Telnet (); - $pop = new Net::Telnet (Telnetmode => 0); - $pop->open(Host => $hostname, - Port => 110); - - - ## Read connection message. - $line = $pop->getline; - die $line unless $line =~ /^\+OK/; - - ## Send user name. - $pop->print("user $username"); - $line = $pop->getline; - die $line unless $line =~ /^\+OK/; - - ## Send password. - $pop->print("pass $passwd"); - $line = $pop->getline; - die $line unless $line =~ /^\+OK/; - - ## Request status of messages. - $pop->print("list"); - $line = $pop->getline; - print $line; - - exit; - - -Here's an example that uses the ssh program to connect to a remote -host. Because the ssh program reads and writes to its controlling -terminal, the IO::Pty module is used to create a new pseudo terminal -for use by ssh. A new Net::Telnet object is then created to read and -write to that pseudo terminal. To use the code below, substitute -"changeme" with the actual host, user, password, and command prompt. - - ## Main program. - { - my ($pty, $ssh, @lines); - my $host = "changeme"; - my $user = "changeme"; - my $password = "changeme"; - my $prompt = '/changeme:~> $/'; - - ## Start ssh program. - $pty = &spawn("ssh", "-l", $user, $host); # spawn() defined below - - ## Create a Net::Telnet object to perform I/O on ssh's tty. - use Net::Telnet; - $ssh = new Net::Telnet (-fhopen => $pty, - -prompt => $prompt, - -telnetmode => 0, - -cmd_remove_mode => 1, - -output_record_separator => "\r"); - - ## Login to remote host. - $ssh->waitfor(-match => '/password: ?$/i', - -errmode => "return") - or die "problem connecting to host: ", $ssh->lastline; - $ssh->print($password); - $ssh->waitfor(-match => $ssh->prompt, - -errmode => "return") - or die "login failed: ", $ssh->lastline; - - ## Send command, get and print its output. - @lines = $ssh->cmd("who"); - print @lines; - - exit; - } # end main program - - sub spawn { - my(@cmd) = @_; - my($pid, $pty, $tty, $tty_fd); - - ## Create a new pseudo terminal. - use IO::Pty (); - $pty = new IO::Pty - or die $!; - - ## Execute the program in another process. - unless ($pid = fork) { # child process - die "problem spawning program: $!\n" unless defined $pid; - - ## Disassociate process from existing controlling terminal. - use POSIX (); - POSIX::setsid - or die "setsid failed: $!"; - - ## Associate process with a new controlling terminal. - $tty = $pty->slave; - $tty_fd = $tty->fileno; - close $pty; - - ## Make stdio use the new controlling terminal. - open STDIN, "<&$tty_fd" or die $!; - open STDOUT, ">&$tty_fd" or die $!; - open STDERR, ">&STDOUT" or die $!; - close $tty; - - ## Execute requested program. - exec @cmd - or die "problem executing $cmd[0]\n"; - } # end child process - - $pty; - } # end sub spawn - - -Here's an example that changes a user's login password. Because the -passwd program always prompts for passwords on its controlling -terminal, the IO::Pty module is used to create a new pseudo terminal -for use by passwd. A new Net::Telnet object is then created to read -and write to that pseudo terminal. To use the code below, substitute -"changeme" with the actual old and new passwords. - - my ($pty, $passwd); - my $oldpw = "changeme"; - my $newpw = "changeme"; - - ## Start passwd program. - $pty = &spawn("passwd"); # spawn() defined above - - ## Create a Net::Telnet object to perform I/O on passwd's tty. - use Net::Telnet; - $passwd = new Net::Telnet (-fhopen => $pty, - -timeout => 2, - -output_record_separator => "\r", - -telnetmode => 0, - -cmd_remove_mode => 1); - $passwd->errmode("return"); - - ## Send existing password. - $passwd->waitfor('/password: ?$/i') - or die "no old password prompt: ", $passwd->lastline; - $passwd->print($oldpw); - - ## Send new password. - $passwd->waitfor('/new password: ?$/i') - or die "bad old password: ", $passwd->lastline; - $passwd->print($newpw); - - ## Send new password verification. - $passwd->waitfor('/new password: ?$/i') - or die "bad new password: ", $passwd->lastline; - $passwd->print($newpw); - - ## Display success or failure. - $passwd->waitfor('/changed/') - or die "bad new password: ", $passwd->lastline; - print $passwd->lastline; - - $passwd->close; - exit; - - -Here's an example you can use to down load a file of any type. The -file is read from the remote host's standard output using cat. To -prevent any output processing, the remote host's standard output is -put in raw mode using the Bourne shell. The Bourne shell is used -because some shells, notably tcsh, prevent changing tty modes. Upon -completion, FTP style statistics are printed to stderr. - - my ($block, $filename, $host, $hostname, $k_per_sec, $line, - $num_read, $passwd, $prevblock, $prompt, $size, $size_bsd, - $size_sysv, $start_time, $total_time, $username); - - $hostname = "your_destination_host_here"; - $username = "your_username_here"; - $passwd = "your_password_here"; - $filename = "your_download_file_here"; - - ## Connect and login. - use Net::Telnet (); - $host = new Net::Telnet (Timeout => 30, - Prompt => '/[%#>] $/'); - $host->open($hostname); - $host->login($username, $passwd); - - ## Make sure prompt won't match anything in send data. - $prompt = "_funkyPrompt_"; - $host->prompt("/$prompt\$/"); - $host->cmd("set prompt = '$prompt'"); - - ## Get size of file. - ($line) = $host->cmd("/bin/ls -l $filename"); - ($size_bsd, $size_sysv) = (split ' ', $line)[3,4]; - if ($size_sysv =~ /^\d+$/) { - $size = $size_sysv; - } - elsif ($size_bsd =~ /^\d+$/) { - $size = $size_bsd; - } - else { - die "$filename: no such file on $hostname"; - } - - ## Start sending the file. - binmode STDOUT; - $host->binmode(1); - $host->print("/bin/sh -c 'stty raw; cat $filename'"); - $host->getline; # discard echoed back line - - ## Read file a block at a time. - $num_read = 0; - $prevblock = ""; - $start_time = time; - while (($block = $host->get) and ($block !~ /$prompt$/o)) { - if (length $block >= length $prompt) { - print $prevblock; - $num_read += length $prevblock; - $prevblock = $block; - } - else { - $prevblock .= $block; - } - - } - $host->close; - - ## Print last block without trailing prompt. - $prevblock .= $block; - $prevblock =~ s/$prompt$//; - print $prevblock; - $num_read += length $prevblock; - die "error: expected size $size, received size $num_read\n" - unless $num_read == $size; - - ## Print totals. - $total_time = (time - $start_time) || 1; - $k_per_sec = ($size / 1024) / $total_time; - $k_per_sec = sprintf "%3.1f", $k_per_sec; - warn("$num_read bytes received in $total_time seconds ", - "($k_per_sec Kbytes/s)\n"); - - exit; - - -=head1 AUTHOR - -Jay Rogers - - -=head1 COPYRIGHT - -Copyright 1997, 2000, 2002 by Jay Rogers. All rights reserved. -This program is free software; you can redistribute it and/or -modify it under the same terms as Perl itself. diff --git a/libs/Telnet.pm b/libs/Telnet.pm deleted file mode 100644 index 9f84fe31..00000000 --- a/libs/Telnet.pm +++ /dev/null @@ -1,5252 +0,0 @@ -package Net::Telnet; - -## Copyright 1997, 2000, 2002 Jay Rogers. All rights reserved. -## This program is free software; you can redistribute it and/or -## modify it under the same terms as Perl itself. - -## See user documentation at the end of this file. Search for =head - -use strict; -require 5.002; - -## Module export. -use vars qw(@EXPORT_OK); -@EXPORT_OK = qw(TELNET_IAC TELNET_DONT TELNET_DO TELNET_WONT TELNET_WILL - TELNET_SB TELNET_GA TELNET_EL TELNET_EC TELNET_AYT TELNET_AO - TELNET_IP TELNET_BREAK TELNET_DM TELNET_NOP TELNET_SE - TELNET_EOR TELNET_ABORT TELNET_SUSP TELNET_EOF TELNET_SYNCH - TELOPT_BINARY TELOPT_ECHO TELOPT_RCP TELOPT_SGA TELOPT_NAMS - TELOPT_STATUS TELOPT_TM TELOPT_RCTE TELOPT_NAOL TELOPT_NAOP - TELOPT_NAOCRD TELOPT_NAOHTS TELOPT_NAOHTD TELOPT_NAOFFD - TELOPT_NAOVTS TELOPT_NAOVTD TELOPT_NAOLFD TELOPT_XASCII - TELOPT_LOGOUT TELOPT_BM TELOPT_DET TELOPT_SUPDUP - TELOPT_SUPDUPOUTPUT TELOPT_SNDLOC TELOPT_TTYPE TELOPT_EOR - TELOPT_TUID TELOPT_OUTMRK TELOPT_TTYLOC TELOPT_3270REGIME - TELOPT_X3PAD TELOPT_NAWS TELOPT_TSPEED TELOPT_LFLOW - TELOPT_LINEMODE TELOPT_XDISPLOC TELOPT_OLD_ENVIRON - TELOPT_AUTHENTICATION TELOPT_ENCRYPT TELOPT_NEW_ENVIRON - TELOPT_EXOPL); - -## Module import. -use Exporter (); -use Socket qw(AF_INET SOCK_STREAM inet_aton sockaddr_in); -use Symbol qw(qualify); - -## Base classes. -use vars qw(@ISA); -@ISA = qw(Exporter); -if (&_io_socket_include) { # successfully required module IO::Socket - push @ISA, "IO::Socket::INET"; -} -else { # perl version < 5.004 - require FileHandle; - push @ISA, "FileHandle"; -} - -## Global variables. -use vars qw($VERSION @Telopts); -$VERSION = "3.03"; -@Telopts = ("BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", "STATUS", - "TIMING MARK", "RCTE", "NAOL", "NAOP", "NAOCRD", "NAOHTS", - "NAOHTD", "NAOFFD", "NAOVTS", "NAOVTD", "NAOLFD", "EXTEND ASCII", - "LOGOUT", "BYTE MACRO", "DATA ENTRY TERMINAL", "SUPDUP", - "SUPDUP OUTPUT", "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD", - "TACACS UID", "OUTPUT MARKING", "TTYLOC", "3270 REGIME", "X.3 PAD", - "NAWS", "TSPEED", "LFLOW", "LINEMODE", "XDISPLOC", "OLD-ENVIRON", - "AUTHENTICATION", "ENCRYPT", "NEW-ENVIRON"); - - -########################### Public Methods ########################### - - -sub new { - my ($class) = @_; - my ( - $errmode, - $fh_open, - $host, - $self, - %args, - ); - local $_; - - ## Create a new object with defaults. - $self = $class->SUPER::new; - *$self->{net_telnet} = { - bin_mode => 0, - blksize => &_optimal_blksize(), - buf => "", - cmd_prompt => '/[\$%#>] $/', - cmd_rm_mode => "auto", - dumplog => '', - eofile => 1, - errormode => "die", - errormsg => "", - fdmask => '', - host => "localhost", - inputlog => '', - last_line => "", - last_prompt => "", - maxbufsize => 1_048_576, - num_wrote => 0, - ofs => "", - opened => '', - opt_cback => '', - opt_log => '', - opts => {}, - ors => "\n", - outputlog => '', - pending_errormsg => "", - port => 23, - pushback_buf => "", - rs => "\n", - subopt_cback => '', - telnet_mode => 1, - time_out => 10, - timedout => '', - unsent_opts => "", - }; - - ## Indicate that we'll accept an offer from remote side for it to echo - ## and suppress go aheads. - &_opt_accept($self, - { option => &TELOPT_ECHO, - is_remote => 1, - is_enable => 1 }, - { option => &TELOPT_SGA, - is_remote => 1, - is_enable => 1 }, - ); - - ## Parse the args. - if (@_ == 2) { # one positional arg given - $host = $_[1]; - } - elsif (@_ > 2) { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse all other named args. - foreach (keys %args) { - if (/^-?binmode$/i) { - $self->binmode($args{$_}); - } - elsif (/^-?cmd_remove_mode$/i) { - $self->cmd_remove_mode($args{$_}); - } - elsif (/^-?dump_log$/i) { - $self->dump_log($args{$_}); - } - elsif (/^-?errmode$/i) { - $errmode = $args{$_}; - } - elsif (/^-?fhopen$/i) { - $fh_open = $args{$_}; - } - elsif (/^-?host$/i) { - $host = $args{$_}; - } - elsif (/^-?input_log$/i) { - $self->input_log($args{$_}); - } - elsif (/^-?input_record_separator$/i or /^-?rs$/i) { - $self->input_record_separator($args{$_}); - } - elsif (/^-?option_log$/i) { - $self->option_log($args{$_}); - } - elsif (/^-?output_log$/i) { - $self->output_log($args{$_}); - } - elsif (/^-?output_record_separator$/i or /^-?ors$/i) { - $self->output_record_separator($args{$_}); - } - elsif (/^-?port$/i) { - $self->port($args{$_}); - } - elsif (/^-?prompt$/i) { - $self->prompt($args{$_}); - } - elsif (/^-?telnetmode$/i) { - $self->telnetmode($args{$_}); - } - elsif (/^-?timeout$/i) { - $self->timeout($args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::new()"); - } - } - } - - if (defined $errmode) { # user wants to set errmode - $self->errmode($errmode); - } - - if (defined $fh_open) { # user wants us to attach to existing filehandle - $self->fhopen($fh_open) - or return; - } - elsif (defined $host) { # user wants us to open a connection to host - $self->host($host); - $self->open - or return; - } - - $self; -} # end sub new - - -sub DESTROY { -} # end sub DESTROY - - -sub binmode { - my ($self, $mode) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{bin_mode}; - - if (@_ >= 2) { - unless (defined $mode) { - $mode = 0; - } - - $s->{bin_mode} = $mode; - } - - $prev; -} # end sub binmode - - -sub break { - my ($self) = @_; - my $s = *$self->{net_telnet}; - my $break_cmd = "\xff\xf3"; - - $s->{timedout} = ''; - - &_put($self, \$break_cmd, "break"); -} # end sub break - - -sub buffer { - my ($self) = @_; - my $s = *$self->{net_telnet}; - - \$s->{buf}; -} # end sub buffer - - -sub buffer_empty { - my ($self) = @_; - my ( - $buffer, - ); - - $buffer = $self->buffer; - $$buffer = ""; -} # end sub buffer_empty - - -sub close { - my ($self) = @_; - my $s = *$self->{net_telnet}; - - $s->{eofile} = 1; - $s->{opened} = ''; - close $self - if defined fileno($self); - - 1; -} # end sub close - - -sub cmd { - my ($self, @args) = @_; - my ( - $cmd_remove_mode, - $errmode, - $firstpos, - $last_prompt, - $lastpos, - $lines, - $ors, - $output, - $output_ref, - $prompt, - $remove_echo, - $rs, - $rs_len, - $s, - $telopt_echo, - $timeout, - %args, - ); - my $cmd = ""; - local $_; - - ## Init. - $self->timed_out(''); - $self->last_prompt(""); - $s = *$self->{net_telnet}; - $output = []; - $cmd_remove_mode = $self->cmd_remove_mode; - $errmode = $self->errmode; - $ors = $self->output_record_separator; - $prompt = $self->prompt; - $rs = $self->input_record_separator; - $timeout = $self->timeout; - - ## Parse args. - if (@_ == 2) { # one positional arg given - $cmd = $_[1]; - } - elsif (@_ > 2) { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?cmd_remove/i) { - $cmd_remove_mode = &_parse_cmd_remove_mode($self, $args{$_}); - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?input_record_separator$/i or /^-?rs$/i) { - $rs = &_parse_input_record_separator($self, $args{$_}); - } - elsif (/^-?output$/i) { - $output_ref = $args{$_}; - if (defined($output_ref) and ref($output_ref) eq "ARRAY") { - $output = $output_ref; - } - } - elsif (/^-?output_record_separator$/i or /^-?ors$/i) { - $ors = $self->output_record_separator($args{$_}); - } - elsif (/^-?prompt$/i) { - $prompt = &_parse_prompt($self, $args{$_}); - } - elsif (/^-?string$/i) { - $cmd = $args{$_}; - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::cmd()"); - } - } - } - - ## Override some user settings. - local $s->{errormode} = "return"; - local $s->{time_out} = &_endtime($timeout); - $self->errmsg(""); - - ## Send command and wait for the prompt. - $self->put($cmd . $ors) - and ($lines, $last_prompt) = $self->waitfor($prompt); - - ## Check for failure. - $s->{errormode} = $errmode; - return $self->error("command timed-out") if $self->timed_out; - return $self->error($self->errmsg) if $self->errmsg ne ""; - - ## Save the most recently matched prompt. - $self->last_prompt($last_prompt); - - ## Split lines into an array, keeping record separator at end of line. - $firstpos = 0; - $rs_len = length $rs; - while (($lastpos = index($lines, $rs, $firstpos)) > -1) { - push(@$output, - substr($lines, $firstpos, $lastpos - $firstpos + $rs_len)); - $firstpos = $lastpos + $rs_len; - } - - if ($firstpos < length $lines) { - push @$output, substr($lines, $firstpos); - } - - ## Determine if we should remove the first line of output based - ## on the assumption that it's an echoed back command. - if ($cmd_remove_mode eq "auto") { - ## See if remote side told us they'd echo. - $telopt_echo = $self->option_state(&TELOPT_ECHO); - $remove_echo = $telopt_echo->{remote_enabled}; - } - else { # user explicitly told us how many lines to remove. - $remove_echo = $cmd_remove_mode; - } - - ## Get rid of possible echo back command. - while ($remove_echo--) { - shift @$output; - } - - ## Ensure at least a null string when there's no command output - so - ## "true" is returned in a list context. - unless (@$output) { - @$output = (""); - } - - ## Return command output via named arg, if requested. - if (defined $output_ref) { - if (ref($output_ref) eq "SCALAR") { - $$output_ref = join "", @$output; - } - elsif (ref($output_ref) eq "HASH") { - %$output_ref = @$output; - } - } - - wantarray ? @$output : 1; -} # end sub cmd - - -sub cmd_remove_mode { - my ($self, $mode) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{cmd_rm_mode}; - - if (@_ >= 2) { - $s->{cmd_rm_mode} = &_parse_cmd_remove_mode($self, $mode); - } - - $prev; -} # end sub cmd_remove_mode - - -sub dump_log { - my ($self, $name) = @_; - my ( - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $fh = $s->{dumplog}; - - if (@_ >= 2) { - unless (defined $name) { - $name = ""; - } - - $fh = &_fname_to_handle($self, $name) - or return; - $s->{dumplog} = $fh; - } - - $fh; -} # end sub dump_log - - -sub eof { - my ($self) = @_; - - *$self->{net_telnet}{eofile}; -} # end sub eof - - -sub errmode { - my ($self, $mode) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{errormode}; - - if (@_ >= 2) { - $s->{errormode} = &_parse_errmode($self, $mode); - } - - $prev; -} # end sub errmode - - -sub errmsg { - my ($self, @errmsgs) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{errormsg}; - - if (@_ >= 2) { - $s->{errormsg} = join "", @errmsgs; - } - - $prev; -} # end sub errmsg - - -sub error { - my ($self, @errmsg) = @_; - my ( - $errmsg, - $func, - $mode, - $s, - @args, - ); - local $_; - - $s = *$self->{net_telnet}; - - if (@_ >= 2) { - ## Put error message in the object. - $errmsg = join "", @errmsg; - $s->{errormsg} = $errmsg; - - ## Do the error action as described by error mode. - $mode = $s->{errormode}; - if (ref($mode) eq "CODE") { - &$mode($errmsg); - return; - } - elsif (ref($mode) eq "ARRAY") { - ($func, @args) = @$mode; - &$func(@args); - return; - } - elsif ($mode =~ /^return$/i) { - return; - } - else { # die - if ($errmsg =~ /\n$/) { - die $errmsg; - } - else { - ## Die and append caller's line number to message. - &_croak($self, $errmsg); - } - } - } - else { - return $s->{errormsg} ne ""; - } -} # end sub error - - -sub fhopen { - my ($self, $fh) = @_; - my ( - $globref, - $s, - ); - - ## Convert given filehandle to a typeglob reference, if necessary. - $globref = &_qualify_fh($self, $fh); - - ## Ensure filehandle is already open. - return $self->error("fhopen filehandle isn't already open") - unless defined($globref) and defined(fileno $globref); - - ## Ensure we're closed. - $self->close; - - ## Save our private data. - $s = *$self->{net_telnet}; - - ## Switch ourself with the given filehandle. - *$self = *$globref; - - ## Restore our private data. - *$self->{net_telnet} = $s; - - ## Re-initialize ourself. - select((select($self), $|=1)[$[]); # don't buffer writes - $s = *$self->{net_telnet}; - $s->{blksize} = &_optimal_blksize((stat $self)[11]); - $s->{buf} = ""; - $s->{eofile} = ''; - $s->{errormsg} = ""; - vec($s->{fdmask}='', fileno($self), 1) = 1; - $s->{host} = ""; - $s->{last_line} = ""; - $s->{last_prompt} = ""; - $s->{num_wrote} = 0; - $s->{opened} = 1; - $s->{pending_errormsg} = ""; - $s->{port} = ''; - $s->{pushback_buf} = ""; - $s->{timedout} = ''; - $s->{unsent_opts} = ""; - &_reset_options($s->{opts}); - - 1; -} # end sub fhopen - - -sub get { - my ($self, %args) = @_; - my ( - $binmode, - $endtime, - $errmode, - $line, - $s, - $telnetmode, - $timeout, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $timeout = $s->{time_out}; - $s->{timedout} = ''; - return if $s->{eofile}; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?binmode$/i) { - $binmode = $args{$_}; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $args{$_}; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::get()"); - } - } - - ## If any args given, override corresponding instance data. - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - - ## Set wall time when we time out. - $endtime = &_endtime($timeout); - - ## Try to send any waiting option negotiation. - if (length $s->{unsent_opts}) { - &_flush_opts($self); - } - - ## Try to read just the waiting data using return error mode. - { - local $s->{errormode} = "return"; - $s->{errormsg} = ""; - &_fillbuf($self, $s, 0); - } - - ## We're done if we timed-out and timeout value is set to "poll". - return $self->error($s->{errormsg}) - if ($s->{timedout} and defined($timeout) and $timeout == 0 - and !length $s->{buf}); - - ## We're done if we hit an error other than timing out. - if ($s->{errormsg} and !$s->{timedout}) { - if (!length $s->{buf}) { - return $self->error($s->{errormsg}); - } - else { # error encountered but there's some data in buffer - $s->{pending_errormsg} = $s->{errormsg}; - } - } - - ## Clear time-out error from first read. - $s->{timedout} = ''; - $s->{errormsg} = ""; - - ## If buffer is still empty, try to read according to user's timeout. - if (!length $s->{buf}) { - &_fillbuf($self, $s, $endtime) - or do { - return if $s->{timedout}; - - ## We've reached end-of-file. - $self->close; - return; - }; - } - - ## Extract chars from buffer. - $line = $s->{buf}; - $s->{buf} = ""; - - $line; -} # end sub get - - -sub getline { - my ($self, %args) = @_; - my ( - $binmode, - $endtime, - $errmode, - $len, - $line, - $offset, - $pos, - $rs, - $s, - $telnetmode, - $timeout, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - return if $s->{eofile}; - $rs = $s->{rs}; - $timeout = $s->{time_out}; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?binmode$/i) { - $binmode = $args{$_}; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?input_record_separator$/i or /^-?rs$/i) { - $rs = &_parse_input_record_separator($self, $args{$_}); - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $args{$_}; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::getline()"); - } - } - - ## If any args given, override corresponding instance data. - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - - ## Set wall time when we time out. - $endtime = &_endtime($timeout); - - ## Try to send any waiting option negotiation. - if (length $s->{unsent_opts}) { - &_flush_opts($self); - } - - ## Keep reading into buffer until end-of-line is read. - $offset = 0; - while (($pos = index($s->{buf}, $rs, $offset)) == -1) { - $offset = length $s->{buf}; - &_fillbuf($self, $s, $endtime) - or do { - return if $s->{timedout}; - - ## We've reached end-of-file. - $self->close; - if (length $s->{buf}) { - return $s->{buf}; - } - else { - return; - } - }; - } - - ## Extract line from buffer. - $len = $pos + length $rs; - $line = substr($s->{buf}, 0, $len); - substr($s->{buf}, 0, $len) = ""; - - $line; -} # end sub getline - - -sub getlines { - my ($self, %args) = @_; - my ( - $binmode, - $errmode, - $line, - $rs, - $s, - $telnetmode, - $timeout, - ); - my $all = 1; - my @lines = (); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - return if $s->{eofile}; - $timeout = $s->{time_out}; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?all$/i) { - $all = $args{$_}; - unless (defined $all) { - $all = ''; - } - } - elsif (/^-?binmode$/i) { - $binmode = $args{$_}; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?input_record_separator$/i or /^-?rs$/i) { - $rs = &_parse_input_record_separator($self, $args{$_}); - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $args{$_}; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::getlines()"); - } - } - - ## If any args given, override corresponding instance data. - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{rs} = $rs - if defined $rs; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - local $s->{time_out} = &_endtime($timeout); - - ## User requested only the currently available lines. - if (! $all) { - return &_next_getlines($self, $s); - } - - ## Read lines until eof or error. - while (1) { - $line = $self->getline - or last; - push @lines, $line; - } - - ## Check for error. - return if ! $self->eof; - - @lines; -} # end sub getlines - - -sub host { - my ($self, $host) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{host}; - - if (@_ >= 2) { - unless (defined $host) { - $host = ""; - } - - $s->{host} = $host; - } - - $prev; -} # end sub host - - -sub input_log { - my ($self, $name) = @_; - my ( - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $fh = $s->{inputlog}; - - if (@_ >= 2) { - unless (defined $name) { - $name = ""; - } - - $fh = &_fname_to_handle($self, $name) - or return; - $s->{inputlog} = $fh; - } - - $fh; -} # end sub input_log - - -sub input_record_separator { - my ($self, $rs) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{rs}; - - if (@_ >= 2) { - $s->{rs} = &_parse_input_record_separator($self, $rs); - } - - $prev; -} # end sub input_record_separator - - -sub last_prompt { - my ($self, $string) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{last_prompt}; - - if (@_ >= 2) { - unless (defined $string) { - $string = ""; - } - - $s->{last_prompt} = $string; - } - - $prev; -} # end sub last_prompt - - -sub lastline { - my ($self, $line) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{last_line}; - - if (@_ >= 2) { - unless (defined $line) { - $line = ""; - } - - $s->{last_line} = $line; - } - - $prev; -} # end sub lastline - - -sub login { - my ($self) = @_; - my ( - $errmode, - $error, - $is_passwd_arg, - $is_username_arg, - $lastline, - $match, - $ors, - $passwd, - $prematch, - $prompt, - $s, - $timeout, - $username, - %args, - ); - local $_; - - ## Init. - $self->timed_out(''); - $self->last_prompt(""); - $s = *$self->{net_telnet}; - $timeout = $self->timeout; - $ors = $self->output_record_separator; - $prompt = $self->prompt; - - ## Parse args. - if (@_ == 3) { # just username and passwd given - $username = $_[1]; - $passwd = $_[2]; - - $is_username_arg = 1; - $is_passwd_arg = 1; - } - else { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?name$/i) { - $username = $args{$_}; - unless (defined $username) { - $username = ""; - } - - $is_username_arg = 1; - } - elsif (/^-?pass/i) { - $passwd = $args{$_}; - unless (defined $passwd) { - $passwd = ""; - } - - $is_passwd_arg = 1; - } - elsif (/^-?prompt$/i) { - $prompt = &_parse_prompt($self, $args{$_}); - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given ", - "to " . ref($self) . "::login()"); - } - } - } - - ## Ensure both username and password argument given. - &_croak($self,"Name argument not given to " . ref($self) . "::login()") - unless $is_username_arg; - &_croak($self,"Password argument not given to " . ref($self) . "::login()") - unless $is_passwd_arg; - - ## Override some user settings. - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{time_out} = &_endtime($timeout); - - ## Create a subroutine to generate an error. - $error - = sub { - my ($errmsg) = @_; - - if ($self->timed_out) { - return $self->error($errmsg); - } - elsif ($self->eof) { - ($lastline = $self->lastline) =~ s/\n+//; - return $self->error($errmsg, ": ", $lastline); - } - else { - return $self->error($self->errmsg); - } - }; - - - return $self->error("login failed: filehandle isn't open") - if $self->eof; - - ## Wait for login prompt. - $self->waitfor(Match => '/login[: ]*$/i', - Match => '/username[: ]*$/i', - Errmode => "return") - or do { - return &$error("eof read waiting for login prompt") - if $self->eof; - return &$error("timed-out waiting for login prompt"); - }; - - ## Delay sending response because of bug in Linux login program. - &_sleep(0.01); - - ## Send login name. - $self->put(String => $username . $ors, - Errmode => "return") - or return &$error("login disconnected"); - - ## Wait for password prompt. - $self->waitfor(Match => '/password[: ]*$/i', - Errmode => "return") - or do { - return &$error("eof read waiting for password prompt") - if $self->eof; - return &$error("timed-out waiting for password prompt"); - }; - - ## Delay sending response because of bug in Linux login program. - &_sleep(0.01); - - ## Send password. - $self->put(String => $passwd . $ors, - Errmode => "return") - or return &$error("login disconnected"); - - ## Wait for command prompt or another login prompt. - ($prematch, $match) = $self->waitfor(Match => '/login[: ]*$/i', - Match => '/username[: ]*$/i', - Match => $prompt, - Errmode => "return") - or do { - return &$error("eof read waiting for command prompt") - if $self->eof; - return &$error("timed-out waiting for command prompt"); - }; - - ## It's a bad login if we got another login prompt. - return $self->error("login failed: bad name or password") - if $match =~ /login[: ]*$/i or $match =~ /username[: ]*$/i; - - ## Save the most recently matched command prompt. - $self->last_prompt($match); - - 1; -} # end sub login - - -sub max_buffer_length { - my ($self, $maxbufsize) = @_; - my ( - $prev, - $s, - ); - my $minbufsize = 512; - - $s = *$self->{net_telnet}; - $prev = $s->{maxbufsize}; - - if (@_ >= 2) { - ## Ensure a positive integer value. - unless (defined $maxbufsize - and $maxbufsize =~ /^\d+$/ - and $maxbufsize) - { - &_carp($self, "ignoring bad Max_buffer_length " . - "argument \"$maxbufsize\": it's not a positive integer"); - $maxbufsize = $prev; - } - - ## Adjust up values that are too small. - if ($maxbufsize < $minbufsize) { - $maxbufsize = $minbufsize; - } - - $s->{maxbufsize} = $maxbufsize; - } - - $prev; -} # end sub max_buffer_length - - -## Make ofs() synonymous with output_field_separator(). -*ofs = \&output_field_separator; - - -sub open { - my ($self) = @_; - my ( - $errmode, - $errno, - $host, - $ip_addr, - $port, - $s, - $timeout, - %args, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $timeout = $s->{time_out}; - $s->{timedout} = ''; - - if (@_ == 2) { # one positional arg given - $self->host($_[1]); - } - elsif (@_ > 2) { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?host$/i) { - $self->host($args{$_}); - } - elsif (/^-?port$/i) { - $self->port($args{$_}) - or return; - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - } - else { - &_croak($self, "bad named parameter \"$_\" given ", - "to " . ref($self) . "::open()"); - } - } - } - - ## If any args given, override corresponding instance data. - local $s->{errormode} = $errmode - if defined $errmode; - - ## Get host and port. - $host = $self->host; - $port = $self->port; - - ## Ensure we're already closed. - $self->close; - - ## Connect with or without a timeout. - if (defined($timeout) and &_have_alarm) { # use a timeout - ## Convert possible absolute timeout to relative timeout. - if ($timeout >= $^T) { # it's an absolute time - $timeout = $timeout - time; - } - - ## Ensure a valid timeout value for alarm. - if ($timeout < 1) { - $timeout = 1; - } - $timeout = int($timeout + 1.5); - - ## Connect to server, timing out if it takes too long. - eval { - ## Turn on timer. - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{ALRM} = sub { die "timed-out\n" }; - alarm $timeout; - - ## Lookup server's IP address. - $ip_addr = inet_aton $host - or die "unknown remote host: $host\n"; - - ## Create a socket and attach the filehandle to it. - socket $self, AF_INET, SOCK_STREAM, 0 - or die "problem creating socket: $!\n"; - - ## Open connection to server. - connect $self, sockaddr_in($port, $ip_addr) - or die "problem connecting to \"$host\", port $port: $!\n"; - }; - alarm 0; - - ## Check for error. - if ($@ =~ /^timed-out$/) { # time out failure - $s->{timedout} = 1; - $self->close; - if (!$ip_addr) { - return $self->error("unknown remote host: $host: ", - "name lookup timed-out"); - } - else { - return $self->error("problem connecting to \"$host\", ", - "port $port: connect timed-out"); - } - } - elsif ($@) { # hostname lookup or connect failure - $self->close; - chomp $@; - return $self->error($@); - } - } - else { # don't use a timeout - $timeout = undef; - - ## Lookup server's IP address. - $ip_addr = inet_aton $host - or return $self->error("unknown remote host: $host"); - - ## Create a socket and attach the filehandle to it. - socket $self, AF_INET, SOCK_STREAM, 0 - or return $self->error("problem creating socket: $!"); - - ## Open connection to server. - connect $self, sockaddr_in($port, $ip_addr) - or do { - $errno = "$!"; - $self->close; - return $self->error("problem connecting to \"$host\", ", - "port $port: $errno"); - }; - } - - select((select($self), $|=1)[$[]); # don't buffer writes - $s->{blksize} = &_optimal_blksize((stat $self)[11]); - $s->{buf} = ""; - $s->{eofile} = ''; - $s->{errormsg} = ""; - vec($s->{fdmask}='', fileno($self), 1) = 1; - $s->{last_line} = ""; - $s->{num_wrote} = 0; - $s->{opened} = 1; - $s->{pending_errormsg} = ""; - $s->{pushback_buf} = ""; - $s->{timedout} = ''; - $s->{unsent_opts} = ""; - &_reset_options($s->{opts}); - - 1; -} # end sub open - - -sub option_accept { - my ($self, @args) = @_; - my ( - $arg, - $option, - $s, - @opt_args, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - - ## Parse the named args. - while (($_, $arg) = splice @args, 0, 2) { - ## Verify and save arguments. - if (/^-?do$/i) { - ## Make sure a callback is defined. - return $self->error("usage: an option callback must already ", - "be defined when enabling with $_") - unless $s->{opt_cback}; - - $option = &_verify_telopt_arg($self, $arg, $_); - return unless defined $option; - push @opt_args, { option => $option, - is_remote => '', - is_enable => 1, - }; - } - elsif (/^-?dont$/i) { - $option = &_verify_telopt_arg($self, $arg, $_); - return unless defined $option; - push @opt_args, { option => $option, - is_remote => '', - is_enable => '', - }; - } - elsif (/^-?will$/i) { - ## Make sure a callback is defined. - return $self->error("usage: an option callback must already ", - "be defined when enabling with $_") - unless $s->{opt_cback}; - - $option = &_verify_telopt_arg($self, $arg, $_); - return unless defined $option; - push @opt_args, { option => $option, - is_remote => 1, - is_enable => 1, - }; - } - elsif (/^-?wont$/i) { - $option = &_verify_telopt_arg($self, $arg, $_); - return unless defined $option; - push @opt_args, { option => $option, - is_remote => 1, - is_enable => '', - }; - } - else { - return $self->error('usage: $obj->option_accept(' . - '[Do => $telopt,] ', - '[Dont => $telopt,] ', - '[Will => $telopt,] ', - '[Wont => $telopt,]'); - } - } - - ## Set "receive ok" for options specified. - &_opt_accept($self, @opt_args); -} # end sub option_accept - - -sub option_callback { - my ($self, $callback) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{opt_cback}; - - if (@_ >= 2) { - unless (defined $callback and ref($callback) eq "CODE") { - &_carp($self, "ignoring Option_callback argument because it's " . - "not a code ref"); - $callback = $prev; - } - - $s->{opt_cback} = $callback; - } - - $prev; -} # end sub option_callback - - -sub option_log { - my ($self, $name) = @_; - my ( - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $fh = $s->{opt_log}; - - if (@_ >= 2) { - unless (defined $name) { - $name = ""; - } - - $fh = &_fname_to_handle($self, $name) - or return; - $s->{opt_log} = $fh; - } - - $fh; -} # end sub option_log - - -sub option_state { - my ($self, $option) = @_; - my ( - $opt_state, - $s, - %opt_state, - ); - - ## Ensure telnet option is non-negative integer. - $option = &_verify_telopt_arg($self, $option); - return unless defined $option; - - ## Init. - $s = *$self->{net_telnet}; - unless (defined $s->{opts}{$option}) { - &_set_default_option($s, $option); - } - - ## Return hashref to a copy of the values. - $opt_state = $s->{opts}{$option}; - %opt_state = %$opt_state; - \%opt_state; -} # end sub option_state - - -## Make ors() synonymous with output_record_separator(). -*ors = \&output_record_separator; - - -sub output_field_separator { - my ($self, $ofs) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{ofs}; - - if (@_ >= 2) { - unless (defined $ofs) { - $ofs = ""; - } - - $s->{ofs} = $ofs; - } - - $prev; -} # end sub output_field_separator - - -sub output_log { - my ($self, $name) = @_; - my ( - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $fh = $s->{outputlog}; - - if (@_ >= 2) { - unless (defined $name) { - $name = ""; - } - - $fh = &_fname_to_handle($self, $name) - or return; - $s->{outputlog} = $fh; - } - - $fh; -} # end sub output_log - - -sub output_record_separator { - my ($self, $ors) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{ors}; - - if (@_ >= 2) { - unless (defined $ors) { - $ors = ""; - } - - $s->{ors} = $ors; - } - - $prev; -} # end sub output_record_separator - - -sub port { - my ($self, $port) = @_; - my ( - $prev, - $s, - $service, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{port}; - - if (@_ >= 2) { - unless (defined $port) { - $port = ""; - } - - if (!$port) { - &_carp($self, "ignoring bad Port argument \"$port\""); - $port = $prev; - } - elsif ($port !~ /^\d+$/) { # port isn't all digits - $service = $port; - $port = getservbyname($service, "tcp"); - unless ($port) { - &_carp($self, "ignoring bad Port argument \"$service\": " . - "it's an unknown TCP service"); - $port = $prev; - } - } - - $s->{port} = $port; - } - - $prev; -} # end sub port - - -sub print { - my ($self) = shift; - my ( - $buf, - $fh, - $s, - ); - - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - return $self->error("write error: filehandle isn't open") - unless $s->{opened}; - - ## Add field and record separators. - $buf = join($s->{ofs}, @_) . $s->{ors}; - - ## Log the output if requested. - if ($s->{outputlog}) { - &_log_print($s->{outputlog}, $buf); - } - - ## Convert native newlines to CR LF. - if (!$s->{bin_mode}) { - $buf =~ s(\n)(\015\012)g; - } - - ## Escape TELNET IAC and also CR not followed by LF. - if ($s->{telnet_mode}) { - $buf =~ s(\377)(\377\377)g; - &_escape_cr(\$buf); - } - - &_put($self, \$buf, "print"); -} # end sub print - - -sub print_length { - my ($self) = @_; - - *$self->{net_telnet}{num_wrote}; -} # end sub print_length - - -sub prompt { - my ($self, $prompt) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{cmd_prompt}; - - ## Parse args. - if (@_ == 2) { - $s->{cmd_prompt} = &_parse_prompt($self, $prompt); - } - - $prev; -} # end sub prompt - - -sub put { - my ($self) = @_; - my ( - $binmode, - $buf, - $errmode, - $is_timeout_arg, - $s, - $telnetmode, - $timeout, - %args, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - - ## Parse args. - if (@_ == 2) { # one positional arg given - $buf = $_[1]; - } - elsif (@_ > 2) { # named args given - ## Get the named args. - (undef, %args) = @_; - - ## Parse the named args. - foreach (keys %args) { - if (/^-?binmode$/i) { - $binmode = $args{$_}; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $args{$_}); - } - elsif (/^-?string$/i) { - $buf = $args{$_}; - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $args{$_}; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $args{$_}); - $is_timeout_arg = 1; - } - else { - &_croak($self, "bad named parameter \"$_\" given ", - "to " . ref($self) . "::put()"); - } - } - } - - ## If any args given, override corresponding instance data. - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - local $s->{time_out} = $timeout - if defined $is_timeout_arg; - - ## Check for errors. - return $self->error("write error: filehandle isn't open") - unless $s->{opened}; - - ## Log the output if requested. - if ($s->{outputlog}) { - &_log_print($s->{outputlog}, $buf); - } - - ## Convert native newlines to CR LF. - if (!$s->{bin_mode}) { - $buf =~ s(\n)(\015\012)g; - } - - ## Escape TELNET IAC and also CR not followed by LF. - if ($s->{telnet_mode}) { - $buf =~ s(\377)(\377\377)g; - &_escape_cr(\$buf); - } - - &_put($self, \$buf, "print"); -} # end sub put - - -## Make rs() synonymous input_record_separator(). -*rs = \&input_record_separator; - - -sub suboption_callback { - my ($self, $callback) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{subopt_cback}; - - if (@_ >= 2) { - unless (defined $callback and ref($callback) eq "CODE") { - &_carp($self,"ignoring Suboption_callback argument because it's " . - "not a code ref"); - $callback = $prev; - } - - $s->{subopt_cback} = $callback; - } - - $prev; -} # end sub suboption_callback - - -sub telnetmode { - my ($self, $mode) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{telnet_mode}; - - if (@_ >= 2) { - unless (defined $mode) { - $mode = 0; - } - - $s->{telnet_mode} = $mode; - } - - $prev; -} # end sub telnetmode - - -sub timed_out { - my ($self, $value) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{timedout}; - - if (@_ >= 2) { - unless (defined $value) { - $value = ""; - } - - $s->{timedout} = $value; - } - - $prev; -} # end sub timed_out - - -sub timeout { - my ($self, $timeout) = @_; - my ( - $prev, - $s, - ); - - $s = *$self->{net_telnet}; - $prev = $s->{time_out}; - - if (@_ >= 2) { - $s->{time_out} = &_parse_timeout($self, $timeout); - } - - $prev; -} # end sub timeout - - -sub waitfor { - my ($self, @args) = @_; - my ( - $arg, - $binmode, - $endtime, - $errmode, - $len, - $match, - $match_op, - $pos, - $prematch, - $s, - $search, - $search_cond, - $telnetmode, - $timeout, - @match_cond, - @match_ops, - @search_cond, - @string_cond, - @warns, - ); - local $_; - - ## Init. - $s = *$self->{net_telnet}; - $s->{timedout} = ''; - return if $s->{eofile}; - return unless @args; - $timeout = $s->{time_out}; - - ## Code template used to build string match conditional. - ## Values between array elements must be supplied later. - @string_cond = - ('if (($pos = index $s->{buf}, ', ') > -1) { - $len = ', '; - $prematch = substr $s->{buf}, 0, $pos; - $match = substr $s->{buf}, $pos, $len; - substr($s->{buf}, 0, $pos + $len) = ""; - last; - }'); - - ## Code template used to build pattern match conditional. - ## Values between array elements must be supplied later. - @match_cond = - ('if ($s->{buf} =~ ', ') { - $prematch = $`; - $match = $&; - substr($s->{buf}, 0, length($`) + length($&)) = ""; - last; - }'); - - ## Parse args. - if (@_ == 2) { # one positional arg given - $arg = $_[1]; - - ## Fill in the blanks in the code template. - push @match_ops, $arg; - push @search_cond, join("", $match_cond[0], $arg, $match_cond[1]); - } - elsif (@_ > 2) { # named args given - ## Parse the named args. - while (($_, $arg) = splice @args, 0, 2) { - if (/^-?binmode$/i) { - $binmode = $arg; - unless (defined $binmode) { - $binmode = 0; - } - } - elsif (/^-?errmode$/i) { - $errmode = &_parse_errmode($self, $arg); - } - elsif (/^-?match$/i) { - ## Fill in the blanks in the code template. - push @match_ops, $arg; - push @search_cond, join("", - $match_cond[0], $arg, $match_cond[1]); - } - elsif (/^-?string$/i) { - ## Fill in the blanks in the code template. - $arg =~ s/'/\\'/g; # quote ticks - push @search_cond, join("", - $string_cond[0], "'$arg'", - $string_cond[1], length($arg), - $string_cond[2]); - } - elsif (/^-?telnetmode$/i) { - $telnetmode = $arg; - unless (defined $telnetmode) { - $telnetmode = 0; - } - } - elsif (/^-?timeout$/i) { - $timeout = &_parse_timeout($self, $arg); - } - else { - &_croak($self, "bad named parameter \"$_\" given " . - "to " . ref($self) . "::waitfor()"); - } - } - } - - ## If any args given, override corresponding instance data. - local $s->{errormode} = $errmode - if defined $errmode; - local $s->{bin_mode} = $binmode - if defined $binmode; - local $s->{telnet_mode} = $telnetmode - if defined $telnetmode; - - ## Check for bad match operator argument. - foreach $match_op (@match_ops) { - return $self->error("missing opening delimiter of match operator ", - "in argument \"$match_op\" given to ", - ref($self) . "::waitfor()") - unless $match_op =~ m(^\s*/) or $match_op =~ m(^\s*m\s*\W); - } - - ## Construct conditional to check for requested string and pattern matches. - ## Turn subsequent "if"s into "elsif". - $search_cond = join "\n\tels", @search_cond; - - ## Construct loop to fill buffer until string/pattern, timeout, or eof. - $search = join "", " - while (1) {\n\t", - $search_cond, ' - &_fillbuf($self, $s, $endtime) - or do { - last if $s->{timedout}; - $self->close; - last; - }; - }'; - - ## Set wall time when we timeout. - $endtime = &_endtime($timeout); - - ## Run the loop. - { - local $^W = 1; - local $SIG{"__WARN__"} = sub { push @warns, @_ }; - local $s->{errormode} = "return"; - $s->{errormsg} = ""; - eval $search; - } - - ## Check for failure. - return $self->error("pattern match timed-out") if $s->{timedout}; - return $self->error($s->{errormsg}) if $s->{errormsg} ne ""; - return $self->error("pattern match read eof") if $s->{eofile}; - - ## Check for Perl syntax errors or warnings. - if ($@ or @warns) { - foreach $match_op (@match_ops) { - &_match_check($self, $match_op) - or return; - } - return $self->error($@) if $@; - return $self->error(@warns) if @warns; - } - - wantarray ? ($prematch, $match) : 1; -} # end sub waitfor - - -######################## Private Subroutines ######################### - - -sub _append_lineno { - my ($obj, @msgs) = @_; - my ( - $file, - $line, - $pkg, - ); - - ## Find the caller that's not in object's class or one of its base classes. - ($pkg, $file , $line) = &_user_caller($obj); - join("", @msgs, " at ", $file, " line ", $line, "\n"); -} # end sub _append_lineno - - -sub _carp { - warn &_append_lineno(@_); -} # end sub _carp - - -sub _croak { - die &_append_lineno(@_); -} # end sub _croak - - -sub _endtime { - my ($interval) = @_; - - ## Compute wall time when timeout occurs. - if (defined $interval) { - if ($interval >= $^T) { # it's already an absolute time - return $interval; - } - elsif ($interval > 0) { # it's relative to the current time - return int(time + 1.5 + $interval); - } - else { # it's a one time poll - return 0; - } - } - else { # there's no timeout - return undef; - } -} # end sub _endtime - - -sub _escape_cr { - my ($string) = @_; - my ( - $nextchar, - ); - my $pos = 0; - - ## Convert all CR (not followed by LF) to CR NULL. - while (($pos = index($$string, "\015", $pos)) > -1) { - $nextchar = substr $$string, $pos + 1, 1; - - substr($$string, $pos, 1) = "\015\000" - unless $nextchar eq "\012"; - - $pos++; - } - - 1; -} # end sub _escape_cr - - -sub _fillbuf { - my ($self, $s, $endtime) = @_; - my ( - $msg, - $nfound, - $nread, - $pushback_len, - $read_pos, - $ready, - $timed_out, - $timeout, - $unparsed_pos, - ); - - ## If error from last read not yet reported then do it now. - if ($s->{pending_errormsg}) { - $msg = $s->{pending_errormsg}; - $s->{pending_errormsg} = ""; - return $self->error($msg); - } - - return unless $s->{opened}; - - while (1) { - ## Maximum buffer size exceeded? - return $self->error("maximum input buffer length exceeded: ", - $s->{maxbufsize}, " bytes") - unless length($s->{buf}) <= $s->{maxbufsize}; - - ## Determine how long to wait for input ready. - ($timed_out, $timeout) = &_timeout_interval($endtime); - if ($timed_out) { - $s->{timedout} = 1; - return $self->error("read timed-out"); - } - - ## Wait for input ready. - $nfound = select $ready=$s->{fdmask}, "", "", $timeout; - - ## Handle any errors while waiting. - if (!defined $nfound or $nfound <= 0) { # input not ready - if (defined $nfound and $nfound == 0) { # timed-out - $s->{timedout} = 1; - return $self->error("read timed-out"); - } - else { # error waiting for input ready - next if $! =~ /^interrupted/i; - - $s->{opened} = ''; - return $self->error("read error: $!"); - } - } - - ## Append to buffer any partially processed telnet or CR sequence. - $pushback_len = length $s->{pushback_buf}; - if ($pushback_len) { - $s->{buf} .= $s->{pushback_buf}; - $s->{pushback_buf} = ""; - } - - ## Read the waiting data. - $read_pos = length $s->{buf}; - $unparsed_pos = $read_pos - $pushback_len; - $nread = sysread $self, $s->{buf}, $s->{blksize}, $read_pos; - - ## Handle any read errors. - if (!defined $nread) { # read failed - next if $! =~ /^interrupted/i; # restart interrupted syscall - - $s->{opened} = ''; - return $self->error("read error: $!"); - } - - ## Handle eof. - if ($nread == 0) { # eof read - $s->{opened} = ''; - return; - } - - ## Display network traffic if requested. - if ($s->{dumplog}) { - &_log_dump('<', $s->{dumplog}, \$s->{buf}, $read_pos); - } - - ## Process any telnet commands in the data stream. - if ($s->{telnet_mode} and index($s->{buf},"\377",$unparsed_pos) > -1) { - &_interpret_tcmd($self, $s, $unparsed_pos); - } - - ## Process any carriage-return sequences in the data stream. - &_interpret_cr($s, $unparsed_pos); - - ## Read again if all chars read were consumed as telnet cmds. - next if $unparsed_pos >= length $s->{buf}; - - ## Log the input if requested. - if ($s->{inputlog}) { - &_log_print($s->{inputlog}, substr($s->{buf}, $unparsed_pos)); - } - - ## Save the last line read. - &_save_lastline($s); - - ## We've successfully read some data into the buffer. - last; - } # end while(1) - - 1; -} # end sub _fillbuf - - -sub _flush_opts { - my ($self) = @_; - my ( - $option_chars, - ); - my $s = *$self->{net_telnet}; - - ## Get option and clear the output buf. - $option_chars = $s->{unsent_opts}; - $s->{unsent_opts} = ""; - - ## Try to send options without waiting. - { - local $s->{errormode} = "return"; - local $s->{time_out} = 0; - &_put($self, \$option_chars, "telnet option negotiation") - or do { - ## Save chars not printed for later. - substr($option_chars, 0, $self->print_length) = ""; - $s->{unsent_opts} .= $option_chars; - }; - } - - 1; -} # end sub _flush_opts - - -sub _fname_to_handle { - my ($self, $fh) = @_; - my ( - $filename, - ); - - ## Ensure valid input. - return "" - unless defined $fh and (ref $fh or length $fh); - - ## Open a new filehandle if input is a filename. - no strict "refs"; - if (!ref($fh) and !defined(fileno $fh)) { # fh is a filename - $filename = $fh; - $fh = &_new_handle(); - CORE::open $fh, "> $filename" - or return $self->error("problem creating $filename: $!"); - } - - select((select($fh), $|=1)[$[]); # don't buffer writes - $fh; -} # end sub _fname_to_handle - - -sub _have_alarm { - eval { - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{ALRM} = sub { die }; - alarm 0; - }; - - ! $@; -} # end sub _have_alarm - - -sub _interpret_cr { - my ($s, $pos) = @_; - my ( - $nextchar, - ); - - while (($pos = index($s->{buf}, "\015", $pos)) > -1) { - $nextchar = substr($s->{buf}, $pos + 1, 1); - if ($nextchar eq "\0") { - ## Convert CR NULL to CR when in telnet mode. - if ($s->{telnet_mode}) { - substr($s->{buf}, $pos + 1, 1) = ""; - } - } - elsif ($nextchar eq "\012") { - ## Convert CR LF to newline when not in binary mode. - if (!$s->{bin_mode}) { - substr($s->{buf}, $pos, 2) = "\n"; - } - } - elsif (!length($nextchar) and ($s->{telnet_mode} or !$s->{bin_mode})) { - ## Save CR in alt buffer for possible CR LF or CR NULL conversion. - $s->{pushback_buf} .= "\015"; - chop $s->{buf}; - } - - $pos++; - } - - 1; -} # end sub _interpret_cr - - -sub _interpret_tcmd { - my ($self, $s, $offset) = @_; - my ( - $callback, - $endpos, - $nextchar, - $option, - $parameters, - $pos, - $subcmd, - ); - local $_; - - ## Parse telnet commands in the data stream. - $pos = $offset; - while (($pos = index $s->{buf}, "\377", $pos) > -1) { # unprocessed IAC - $nextchar = substr $s->{buf}, $pos + 1, 1; - - ## Save command if it's only partially read. - if (!length $nextchar) { - $s->{pushback_buf} .= "\377"; - chop $s->{buf}; - last; - } - - if ($nextchar eq "\377") { # IAC is escaping "\377" char - ## Remove escape char from data stream. - substr($s->{buf}, $pos, 1) = ""; - $pos++; - } - elsif ($nextchar eq "\375" or $nextchar eq "\373" or - $nextchar eq "\374" or $nextchar eq "\376") { # opt negotiation - $option = substr $s->{buf}, $pos + 2, 1; - - ## Save command if it's only partially read. - if (!length $option) { - $s->{pushback_buf} .= "\377" . $nextchar; - chop $s->{buf}; - chop $s->{buf}; - last; - } - - ## Remove command from data stream. - substr($s->{buf}, $pos, 3) = ""; - - ## Handle option negotiation. - &_negotiate_recv($self, $s, $nextchar, ord($option), $pos); - } - elsif ($nextchar eq "\372") { # start of subnegotiation parameters - ## Save command if it's only partially read. - $endpos = index $s->{buf}, "\360", $pos; - if ($endpos == -1) { - $s->{pushback_buf} .= substr $s->{buf}, $pos; - substr($s->{buf}, $pos) = ""; - last; - } - - ## Remove subnegotiation cmd from buffer. - $subcmd = substr($s->{buf}, $pos, $endpos - $pos + 1); - substr($s->{buf}, $pos, $endpos - $pos + 1) = ""; - - ## Invoke subnegotiation callback. - if ($s->{subopt_cback} and length($subcmd) >= 5) { - $option = unpack "C", substr($subcmd, 2, 1); - if (length($subcmd) >= 6) { - $parameters = substr $subcmd, 3, length($subcmd) - 5; - } - else { - $parameters = ""; - } - - $callback = $s->{subopt_cback}; - &$callback($self, $option, $parameters); - } - } - else { # various two char telnet commands - ## Ignore and remove command from data stream. - substr($s->{buf}, $pos, 2) = ""; - } - } - - ## Try to send any waiting option negotiation. - if (length $s->{unsent_opts}) { - &_flush_opts($self); - } - - 1; -} # end sub _interpret_tcmd - - -sub _io_socket_include { - local $SIG{"__DIE__"} = "DEFAULT"; - eval "require IO::Socket"; -} # end sub io_socket_include - - -sub _log_dump { - my ($direction, $fh, $data, $offset, $len) = @_; - my ( - $addr, - $hexvals, - $line, - ); - - $addr = 0; - $len = length($$data) - $offset - if !defined $len; - return 1 if $len <= 0; - - ## Print data in dump format. - while ($len > 0) { - ## Convert up to the next 16 chars to hex, padding w/ spaces. - if ($len >= 16) { - $line = substr $$data, $offset, 16; - } - else { - $line = substr $$data, $offset, $len; - } - $hexvals = unpack("H*", $line); - $hexvals .= ' ' x (32 - length $hexvals); - - ## Place in 16 columns, each containing two hex digits. - $hexvals = sprintf("%s %s %s %s " x 4, - unpack("a2" x 16, $hexvals)); - - ## For the ASCII column, change unprintable chars to a period. - $line =~ s/[\000-\037,\177-\237]/./g; - - ## Print the line in dump format. - &_log_print($fh, sprintf("%s 0x%5.5lx: %s%s\n", - $direction, $addr, $hexvals, $line)); - - $addr += 16; - $offset += 16; - $len -= 16; - } - - &_log_print($fh, "\n"); - - 1; -} # end sub _log_dump - - -sub _log_option { - my ($fh, $direction, $request, $option) = @_; - my ( - $name, - ); - - if ($option >= 0 and $option <= $#Telopts) { - $name = $Telopts[$option]; - } - else { - $name = $option; - } - - &_log_print($fh, "$direction $request $name\n"); -} # end sub _log_option - - -sub _log_print { - my ($fh, $buf) = @_; - local $\ = ''; - - if (ref($fh) and ref($fh) ne "GLOB") { # fh is blessed ref - $fh->print($buf); - } - else { # fh isn't blessed ref - print $fh $buf; - } -} # end sub _log_print - - -sub _match_check { - my ($self, $code) = @_; - my $error; - my @warns = (); - - ## Use eval to check for syntax errors or warnings. - { - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{"__WARN__"} = sub { push @warns, @_ }; - local $^W = 1; - local $_ = ''; - eval "\$_ =~ $code;"; - } - if ($@) { - ## Remove useless lines numbers from message. - ($error = $@) =~ s/ at \(eval \d+\) line \d+.?//; - chomp $error; - return $self->error("bad match operator: $error"); - } - elsif (@warns) { - ## Remove useless lines numbers from message. - ($error = shift @warns) =~ s/ at \(eval \d+\) line \d+.?//; - $error =~ s/ while "strict subs" in use//; - chomp $error; - return $self->error("bad match operator: $error"); - } - - 1; -} # end sub _match_check - - -sub _negotiate_callback { - my ($self, $opt, $is_remote, $is_enabled, $was_enabled, $opt_bufpos) = @_; - my ( - $callback, - $s, - ); - local $_; - - ## Keep track of remote echo. - if ($is_remote and $opt == &TELOPT_ECHO) { # received WILL or WONT ECHO - $s = *$self->{net_telnet}; - - if ($is_enabled and !$was_enabled) { # received WILL ECHO - $s->{remote_echo} = 1; - } - elsif (!$is_enabled and $was_enabled) { # received WONT ECHO - $s->{remote_echo} = ''; - } - } - - ## Invoke callback, if there is one. - $callback = $self->option_callback; - if ($callback) { - &$callback($self, $opt, $is_remote, - $is_enabled, $was_enabled, $opt_bufpos); - } - - 1; -} # end sub _negotiate_callback - - -sub _negotiate_recv { - my ($self, $s, $opt_request, $opt, $opt_bufpos) = @_; - - ## Ensure data structure exists for this option. - unless (defined $s->{opts}{$opt}) { - &_set_default_option($s, $opt); - } - - ## Process the option. - if ($opt_request eq "\376") { # DONT - &_negotiate_recv_disable($self, $s, $opt, "dont", $opt_bufpos, - $s->{opts}{$opt}{local_enable_ok}, - \$s->{opts}{$opt}{local_enabled}, - \$s->{opts}{$opt}{local_state}); - } - elsif ($opt_request eq "\375") { # DO - &_negotiate_recv_enable($self, $s, $opt, "do", $opt_bufpos, - $s->{opts}{$opt}{local_enable_ok}, - \$s->{opts}{$opt}{local_enabled}, - \$s->{opts}{$opt}{local_state}); - } - elsif ($opt_request eq "\374") { # WONT - &_negotiate_recv_disable($self, $s, $opt, "wont", $opt_bufpos, - $s->{opts}{$opt}{remote_enable_ok}, - \$s->{opts}{$opt}{remote_enabled}, - \$s->{opts}{$opt}{remote_state}); - } - elsif ($opt_request eq "\373") { # WILL - &_negotiate_recv_enable($self, $s, $opt, "will", $opt_bufpos, - $s->{opts}{$opt}{remote_enable_ok}, - \$s->{opts}{$opt}{remote_enabled}, - \$s->{opts}{$opt}{remote_state}); - } - else { # internal error - die; - } - - 1; -} # end sub _negotiate_recv - - -sub _negotiate_recv_disable { - my ($self, $s, $opt, $opt_request, - $opt_bufpos, $enable_ok, $is_enabled, $state) = @_; - my ( - $ack, - $disable_cmd, - $enable_cmd, - $is_remote, - $nak, - $was_enabled, - ); - - ## What do we use to request enable/disable or respond with ack/nak. - if ($opt_request eq "wont") { - $enable_cmd = "\377\375" . pack("C", $opt); # do command - $disable_cmd = "\377\376" . pack("C", $opt); # dont command - $is_remote = 1; - $ack = "DO"; - $nak = "DONT"; - - &_log_option($s->{opt_log}, "RCVD", "WONT", $opt) - if $s->{opt_log}; - } - elsif ($opt_request eq "dont") { - $enable_cmd = "\377\373" . pack("C", $opt); # will command - $disable_cmd = "\377\374" . pack("C", $opt); # wont command - $is_remote = ''; - $ack = "WILL"; - $nak = "WONT"; - - &_log_option($s->{opt_log}, "RCVD", "DONT", $opt) - if $s->{opt_log}; - } - else { # internal error - die; - } - - ## Respond to WONT or DONT based on the current negotiation state. - if ($$state eq "no") { # state is already disabled - } - elsif ($$state eq "yes") { # they're initiating disable - $$is_enabled = ''; - $$state = "no"; - - ## Send positive acknowledgment. - $s->{unsent_opts} .= $disable_cmd; - &_log_option($s->{opt_log}, "SENT", $nak, $opt) - if $s->{opt_log}; - - ## Invoke callbacks. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantno") { # they sent positive ack - $$is_enabled = ''; - $$state = "no"; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantno opposite") { # pos ack but we changed our mind - ## Indicate disabled but now we want to enable. - $$is_enabled = ''; - $$state = "wantyes"; - - ## Send queued request. - $s->{unsent_opts} .= $enable_cmd; - &_log_option($s->{opt_log}, "SENT", $ack, $opt) - if $s->{opt_log}; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantyes") { # they sent negative ack - $$is_enabled = ''; - $$state = "no"; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantyes opposite") { # nak but we changed our mind - $$is_enabled = ''; - $$state = "no"; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } -} # end sub _negotiate_recv_disable - - -sub _negotiate_recv_enable { - my ($self, $s, $opt, $opt_request, - $opt_bufpos, $enable_ok, $is_enabled, $state) = @_; - my ( - $ack, - $disable_cmd, - $enable_cmd, - $is_remote, - $nak, - $was_enabled, - ); - - ## What we use to send enable/disable request or send ack/nak response. - if ($opt_request eq "will") { - $enable_cmd = "\377\375" . pack("C", $opt); # do command - $disable_cmd = "\377\376" . pack("C", $opt); # dont command - $is_remote = 1; - $ack = "DO"; - $nak = "DONT"; - - &_log_option($s->{opt_log}, "RCVD", "WILL", $opt) - if $s->{opt_log}; - } - elsif ($opt_request eq "do") { - $enable_cmd = "\377\373" . pack("C", $opt); # will command - $disable_cmd = "\377\374" . pack("C", $opt); # wont command - $is_remote = ''; - $ack = "WILL"; - $nak = "WONT"; - - &_log_option($s->{opt_log}, "RCVD", "DO", $opt) - if $s->{opt_log}; - } - else { # internal error - die; - } - - ## Save current enabled state. - $was_enabled = $$is_enabled; - - ## Respond to WILL or DO based on the current negotiation state. - if ($$state eq "no") { # they're initiating enable - if ($enable_ok) { # we agree they/us should enable - $$is_enabled = 1; - $$state = "yes"; - - ## Send positive acknowledgment. - $s->{unsent_opts} .= $enable_cmd; - &_log_option($s->{opt_log}, "SENT", $ack, $opt) - if $s->{opt_log}; - - ## Invoke callbacks. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - else { # we disagree they/us should enable - ## Send negative acknowledgment. - $s->{unsent_opts} .= $disable_cmd; - &_log_option($s->{opt_log}, "SENT", $nak, $opt) - if $s->{opt_log}; - } - } - elsif ($$state eq "yes") { # state is already enabled - } - elsif ($$state eq "wantno") { # error: our disable req answered by enable - $$is_enabled = ''; - $$state = "no"; - - ## Invoke callbacks. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantno opposite") { # err: disable req answerd by enable - $$is_enabled = 1; - $$state = "yes"; - - ## Invoke callbacks. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantyes") { # they sent pos ack - $$is_enabled = 1; - $$state = "yes"; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - elsif ($$state eq "wantyes opposite") { # pos ack but we changed our mind - ## Indicate enabled but now we want to disable. - $$is_enabled = 1; - $$state = "wantno"; - - ## Inform other side we changed our mind. - $s->{unsent_opts} .= $disable_cmd; - &_log_option($s->{opt_log}, "SENT", $nak, $opt) - if $s->{opt_log}; - - ## Invoke callback. - &_negotiate_callback($self, $opt, $is_remote, - $$is_enabled, $was_enabled, $opt_bufpos); - } - - 1; -} # end sub _negotiate_recv_enable - - -sub _new_handle { - if ($INC{"IO/Handle.pm"}) { - return IO::Handle->new; - } - else { - require FileHandle; - return FileHandle->new; - } -} # end sub _new_handle - - -sub _next_getlines { - my ($self, $s) = @_; - my ( - $len, - $line, - $pos, - @lines, - ); - - ## Fill buffer and get first line. - $line = $self->getline - or return; - push @lines, $line; - - ## Extract subsequent lines from buffer. - while (($pos = index($s->{buf}, $s->{rs})) != -1) { - $len = $pos + length $s->{rs}; - push @lines, substr($s->{buf}, 0, $len); - substr($s->{buf}, 0, $len) = ""; - } - - @lines; -} # end sub _next_getlines - - -sub _opt_accept { - my ($self, @args) = @_; - my ( - $arg, - $option, - $s, - ); - - ## Init. - $s = *$self->{net_telnet}; - - foreach $arg (@args) { - ## Ensure data structure defined for this option. - $option = $arg->{option}; - if (!defined $s->{opts}{$option}) { - &_set_default_option($s, $option); - } - - ## Save whether we'll accept or reject this option. - if ($arg->{is_remote}) { - $s->{opts}{$option}{remote_enable_ok} = $arg->{is_enable}; - } - else { - $s->{opts}{$option}{local_enable_ok} = $arg->{is_enable}; - } - } - - 1; -} # end sub _opt_accept - - -sub _optimal_blksize { - my ($blksize) = @_; - local $^W = ''; # avoid non-numeric warning for ms-windows blksize of "" - - ## Use default when block size is invalid. - return 8192 - unless defined $blksize and $blksize >= 1 and $blksize <= 1_048_576; - - $blksize; -} # end sub _optimal_blksize - - -sub _parse_cmd_remove_mode { - my ($self, $mode) = @_; - - if (!defined $mode) { - $mode = 0; - } - elsif ($mode =~ /^\s*auto\s*$/i) { - $mode = "auto"; - } - elsif ($mode !~ /^\d+$/) { - &_carp($self, "ignoring bad Cmd_remove_mode " . - "argument \"$mode\": it's not \"auto\" or a " . - "non-negative integer"); - $mode = *$self->{net_telnet}{cmd_rm_mode}; - } - - $mode; -} # end sub _parse_cmd_remove_mode - - -sub _parse_errmode { - my ($self, $errmode) = @_; - - ## Set the error mode. - if (!defined $errmode) { - &_carp($self, "ignoring undefined Errmode argument"); - $errmode = *$self->{net_telnet}{errormode}; - } - elsif ($errmode =~ /^\s*return\s*$/i) { - $errmode = "return"; - } - elsif ($errmode =~ /^\s*die\s*$/i) { - $errmode = "die"; - } - elsif (ref($errmode) eq "CODE") { - } - elsif (ref($errmode) eq "ARRAY") { - unless (ref($errmode->[0]) eq "CODE") { - &_carp($self, "ignoring bad Errmode argument: " . - "first list item isn't a code ref"); - $errmode = *$self->{net_telnet}{errormode}; - } - } - else { - &_carp($self, "ignoring bad Errmode argument \"$errmode\""); - $errmode = *$self->{net_telnet}{errormode}; - } - - $errmode; -} # end sub _parse_errmode - - -sub _parse_input_record_separator { - my ($self, $rs) = @_; - - unless (defined $rs and length $rs) { - &_carp($self, "ignoring null Input_record_separator argument"); - $rs = *$self->{net_telnet}{rs}; - } - - $rs; -} # end sub _parse_input_record_separator - - -sub _parse_prompt { - my ($self, $prompt) = @_; - - unless (defined $prompt) { - $prompt = ""; - } - - unless ($prompt =~ m(^\s*/) or $prompt =~ m(^\s*m\s*\W)) { - &_carp($self, "ignoring bad Prompt argument \"$prompt\": " . - "missing opening delimiter of match operator"); - $prompt = *$self->{net_telnet}{cmd_prompt}; - } - - $prompt; -} # end sub _parse_prompt - - -sub _parse_timeout { - my ($self, $timeout) = @_; - - ## Ensure valid timeout. - if (defined $timeout) { - ## Test for non-numeric or negative values. - eval { - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{"__WARN__"} = sub { die "non-numeric\n" }; - local $^W = 1; - $timeout *= 1; - }; - if ($@) { # timeout arg is non-numeric - &_carp($self, - "ignoring non-numeric Timeout argument \"$timeout\""); - $timeout = *$self->{net_telnet}{time_out}; - } - elsif ($timeout < 0) { # timeout arg is negative - &_carp($self, "ignoring negative Timeout argument \"$timeout\""); - $timeout = *$self->{net_telnet}{time_out}; - } - } - - $timeout; -} # end sub _parse_timeout - - -sub _put { - my ($self, $buf, $subname) = @_; - my ( - $endtime, - $len, - $nfound, - $nwrote, - $offset, - $ready, - $s, - $timed_out, - $timeout, - $zero_wrote_count, - ); - - ## Init. - $s = *$self->{net_telnet}; - $s->{num_wrote} = 0; - $zero_wrote_count = 0; - $offset = 0; - $len = length $$buf; - $endtime = &_endtime($s->{time_out}); - - return $self->error("write error: filehandle isn't open") - unless $s->{opened}; - - ## Try to send any waiting option negotiation. - if (length $s->{unsent_opts}) { - &_flush_opts($self); - } - - ## Write until all data blocks written. - while ($len) { - ## Determine how long to wait for output ready. - ($timed_out, $timeout) = &_timeout_interval($endtime); - if ($timed_out) { - $s->{timedout} = 1; - return $self->error("$subname timed-out"); - } - - ## Wait for output ready. - $nfound = select "", $ready=$s->{fdmask}, "", $timeout; - - ## Handle any errors while waiting. - if (!defined $nfound or $nfound <= 0) { # output not ready - if (defined $nfound and $nfound == 0) { # timed-out - $s->{timedout} = 1; - return $self->error("$subname timed-out"); - } - else { # error waiting for output ready - next if $! =~ /^interrupted/i; - - $s->{opened} = ''; - return $self->error("write error: $!"); - } - } - - ## Write the data. - $nwrote = syswrite $self, $$buf, $len, $offset; - - ## Handle any write errors. - if (!defined $nwrote) { # write failed - next if $! =~ /^interrupted/i; # restart interrupted syscall - - $s->{opened} = ''; - return $self->error("write error: $!"); - } - elsif ($nwrote == 0) { # zero chars written - ## Try ten more times to write the data. - if ($zero_wrote_count++ <= 10) { - &_sleep(0.01); - next; - } - - $s->{opened} = ''; - return $self->error("write error: zero length write: $!"); - } - - ## Display network traffic if requested. - if ($s->{dumplog}) { - &_log_dump('>', $s->{dumplog}, $buf, $offset, $nwrote); - } - - ## Increment. - $s->{num_wrote} += $nwrote; - $offset += $nwrote; - $len -= $nwrote; - } - - 1; -} # end sub _put - - -sub _qualify_fh { - my ($obj, $name) = @_; - my ( - $user_class, - ); - local $_; - - ## Get user's package name. - ($user_class) = &_user_caller($obj); - - ## Ensure name is qualified with a package name. - $name = qualify($name, $user_class); - - ## If it's not already, make it a typeglob ref. - if (!ref $name) { - no strict; - local $^W = 0; - - $name =~ s/^\*+//; - $name = eval "\\*$name"; - return unless ref $name; - } - - $name; -} # end sub _qualify_fh - - -sub _reset_options { - my ($opts) = @_; - my ( - $opt, - ); - - foreach $opt (keys %$opts) { - $opts->{$opt}{remote_enabled} = ''; - $opts->{$opt}{remote_state} = "no"; - $opts->{$opt}{local_enabled} = ''; - $opts->{$opt}{local_state} = "no"; - } - - 1; -} # end sub _reset_options - - -sub _save_lastline { - my ($s) = @_; - my ( - $firstpos, - $lastpos, - $len_w_sep, - $len_wo_sep, - $offset, - ); - my $rs = "\n"; - - if (($lastpos = rindex $s->{buf}, $rs) > -1) { # eol found - while (1) { - ## Find beginning of line. - $firstpos = rindex $s->{buf}, $rs, $lastpos - 1; - if ($firstpos == -1) { - $offset = 0; - } - else { - $offset = $firstpos + length $rs; - } - - ## Determine length of line with and without separator. - $len_wo_sep = $lastpos - $offset; - $len_w_sep = $len_wo_sep + length $rs; - - ## Save line if it's not blank. - if (substr($s->{buf}, $offset, $len_wo_sep) - !~ /^\s*$/) - { - $s->{last_line} = substr($s->{buf}, - $offset, - $len_w_sep); - last; - } - - last if $firstpos == -1; - - $lastpos = $firstpos; - } - } - - 1; -} # end sub _save_lastline - - -sub _set_default_option { - my ($s, $option) = @_; - - $s->{opts}{$option} = { - remote_enabled => '', - remote_state => "no", - remote_enable_ok => '', - local_enabled => '', - local_state => "no", - local_enable_ok => '', - }; -} # end sub _set_default_option - - -sub _sleep { - my ($secs) = @_; - my $bitmask = ""; - local *SOCK; - - socket SOCK, AF_INET, SOCK_STREAM, 0; - vec($bitmask, fileno(SOCK), 1) = 1; - select $bitmask, "", "", $secs; - CORE::close SOCK; - - 1; -} # end sub _sleep - - -sub _timeout_interval { - my ($endtime) = @_; - my ( - $timeout, - ); - - ## Return timed-out boolean and timeout interval. - if (defined $endtime) { - ## Is it a one-time poll. - return ('', 0) if $endtime == 0; - - ## Calculate the timeout interval. - $timeout = $endtime - time; - - ## Did we already timeout. - return (1, 0) unless $timeout > 0; - - return ('', $timeout); - } - else { # there is no timeout - return ('', undef); - } -} # end sub _timeout_interval - - -sub _user_caller { - my ($obj) = @_; - my ( - $class, - $curr_pkg, - $file, - $i, - $line, - $pkg, - %isa, - @isa, - ); - local $_; - - ## Create a boolean hash to test for isa. Make sure current - ## package and the object's class are members. - $class = ref $obj; - @isa = eval "\@${class}::ISA"; - push @isa, $class; - ($curr_pkg) = caller 1; - push @isa, $curr_pkg; - %isa = map { $_ => 1 } @isa; - - ## Search back in call frames for a package that's not in isa. - $i = 1; - while (($pkg, $file, $line) = caller ++$i) { - next if $isa{$pkg}; - - return ($pkg, $file, $line); - } - - ## If not found, choose outer most call frame. - ($pkg, $file, $line) = caller --$i; - return ($pkg, $file, $line); -} # end sub _user_caller - - -sub _verify_telopt_arg { - my ($self, $option, $argname) = @_; - - ## If provided, use argument name in error message. - if (defined $argname) { - $argname = "for arg $argname"; - } - else { - $argname = ""; - } - - ## Ensure telnet option is a non-negative integer. - eval { - local $SIG{"__DIE__"} = "DEFAULT"; - local $SIG{"__WARN__"} = sub { die "non-numeric\n" }; - local $^W = 1; - $option = abs(int $option); - }; - return $self->error("bad telnet option $argname: non-numeric") - if $@; - - return $self->error("bad telnet option $argname: option > 255") - unless $option <= 255; - - $option; -} # end sub _verify_telopt_arg - - -######################## Exported Constants ########################## - - -sub TELNET_IAC () {255}; # interpret as command: -sub TELNET_DONT () {254}; # you are not to use option -sub TELNET_DO () {253}; # please, you use option -sub TELNET_WONT () {252}; # I won't use option -sub TELNET_WILL () {251}; # I will use option -sub TELNET_SB () {250}; # interpret as subnegotiation -sub TELNET_GA () {249}; # you may reverse the line -sub TELNET_EL () {248}; # erase the current line -sub TELNET_EC () {247}; # erase the current character -sub TELNET_AYT () {246}; # are you there -sub TELNET_AO () {245}; # abort output--but let prog finish -sub TELNET_IP () {244}; # interrupt process--permanently -sub TELNET_BREAK () {243}; # break -sub TELNET_DM () {242}; # data mark--for connect. cleaning -sub TELNET_NOP () {241}; # nop -sub TELNET_SE () {240}; # end sub negotiation -sub TELNET_EOR () {239}; # end of record (transparent mode) -sub TELNET_ABORT () {238}; # Abort process -sub TELNET_SUSP () {237}; # Suspend process -sub TELNET_EOF () {236}; # End of file -sub TELNET_SYNCH () {242}; # for telfunc calls - -sub TELOPT_BINARY () {0}; # Binary Transmission -sub TELOPT_ECHO () {1}; # Echo -sub TELOPT_RCP () {2}; # Reconnection -sub TELOPT_SGA () {3}; # Suppress Go Ahead -sub TELOPT_NAMS () {4}; # Approx Message Size Negotiation -sub TELOPT_STATUS () {5}; # Status -sub TELOPT_TM () {6}; # Timing Mark -sub TELOPT_RCTE () {7}; # Remote Controlled Trans and Echo -sub TELOPT_NAOL () {8}; # Output Line Width -sub TELOPT_NAOP () {9}; # Output Page Size -sub TELOPT_NAOCRD () {10}; # Output Carriage-Return Disposition -sub TELOPT_NAOHTS () {11}; # Output Horizontal Tab Stops -sub TELOPT_NAOHTD () {12}; # Output Horizontal Tab Disposition -sub TELOPT_NAOFFD () {13}; # Output Formfeed Disposition -sub TELOPT_NAOVTS () {14}; # Output Vertical Tabstops -sub TELOPT_NAOVTD () {15}; # Output Vertical Tab Disposition -sub TELOPT_NAOLFD () {16}; # Output Linefeed Disposition -sub TELOPT_XASCII () {17}; # Extended ASCII -sub TELOPT_LOGOUT () {18}; # Logout -sub TELOPT_BM () {19}; # Byte Macro -sub TELOPT_DET () {20}; # Data Entry Terminal -sub TELOPT_SUPDUP () {21}; # SUPDUP -sub TELOPT_SUPDUPOUTPUT () {22}; # SUPDUP Output -sub TELOPT_SNDLOC () {23}; # Send Location -sub TELOPT_TTYPE () {24}; # Terminal Type -sub TELOPT_EOR () {25}; # End of Record -sub TELOPT_TUID () {26}; # TACACS User Identification -sub TELOPT_OUTMRK () {27}; # Output Marking -sub TELOPT_TTYLOC () {28}; # Terminal Location Number -sub TELOPT_3270REGIME () {29}; # Telnet 3270 Regime -sub TELOPT_X3PAD () {30}; # X.3 PAD -sub TELOPT_NAWS () {31}; # Negotiate About Window Size -sub TELOPT_TSPEED () {32}; # Terminal Speed -sub TELOPT_LFLOW () {33}; # Remote Flow Control -sub TELOPT_LINEMODE () {34}; # Linemode -sub TELOPT_XDISPLOC () {35}; # X Display Location -sub TELOPT_OLD_ENVIRON () {36}; # Environment Option -sub TELOPT_AUTHENTICATION () {37}; # Authentication Option -sub TELOPT_ENCRYPT () {38}; # Encryption Option -sub TELOPT_NEW_ENVIRON () {39}; # New Environment Option -sub TELOPT_EXOPL () {255}; # Extended-Options-List - - -1; -__END__; - - -######################## User Documentation ########################## - - -## To format the following documentation into a more readable format, -## use one of these programs: perldoc; pod2man; pod2html; pod2text. -## For example, to nicely format this documentation for printing, you -## may use pod2man and groff to convert to postscript: -## pod2man Net/Telnet.pm | groff -man -Tps > Net::Telnet.ps - -=head1 NAME - -Net::Telnet - interact with TELNET port or other TCP ports - -=head1 SYNOPSIS - -C - -see METHODS section below - -=head1 DESCRIPTION - -Net::Telnet allows you to make client connections to a TCP port and do -network I/O, especially to a port using the TELNET protocol. Simple -I/O methods such as print, get, and getline are provided. More -sophisticated interactive features are provided because connecting to -a TELNET port ultimately means communicating with a program designed -for human interaction. These interactive features include the ability -to specify a time-out and to wait for patterns to appear in the input -stream, such as the prompt from a shell. - -Other reasons to use this module than strictly with a TELNET port are: - -=over 2 - -=item * - -You're not familiar with sockets and you want a simple way to make -client connections to TCP services. - -=item * - -You want to be able to specify your own time-out while connecting, -reading, or writing. - -=item * - -You're communicating with an interactive program at the other end of -some socket or pipe and you want to wait for certain patterns to -appear. - -=back - -Here's an example that prints who's logged-on to the remote host -sparky. In addition to a username and password, you must also know -the user's shell prompt, which for this example is C - - use Net::Telnet (); - $t = new Net::Telnet (Timeout => 10, - Prompt => '/bash\$ $/'); - $t->open("sparky"); - $t->login($username, $passwd); - @lines = $t->cmd("who"); - print @lines; - -More examples are in the B section below. - -Usage questions should be directed to the Usenet newsgroup -comp.lang.perl.modules. - -Contact me, Jay Rogers , if you find any bugs or have -suggestions for improvement. - -=head2 What To Know Before Using - -=over 2 - -=item * - -All output is flushed while all input is buffered. Each object -contains its own input buffer. - -=item * - -The output record separator for C and C is set to -C<"\n"> by default, so that you don't have to append all your commands -with a newline. To avoid printing a trailing C<"\n"> use C or -set the I to C<"">. - -=item * - -The methods C and C use the I setting in the -object to determine when a login or remote command is complete. Those -methods will fail with a time-out if you don't set the prompt -correctly. - -=item * - -Use a combination of C and C as an alternative to -C or C when they don't do what you want. - -=item * - -Errors such as timing-out are handled according to the error mode -action. The default action is to print an error message to standard -error and have the program die. See the C method for more -information. - -=item * - -When constructing the match operator argument for C or -C, always use single quotes instead of double quotes to -avoid unexpected backslash interpretation (e.g. C<'/bash\$ $/'>). If -you're constructing a DOS like file path, you'll need to use four -backslashes to represent one (e.g. C<'/c:\\\\users\\\\billE$/i'>). - -Of course don't forget about regexp metacharacters like C<.>, C<[>, or -C<$>. You'll only need a single backslash to quote them. The anchor -metacharacters C<^> and C<$> refer to positions in the input buffer. -To avoid matching characters read that look like a prompt, it's a good -idea to end your prompt pattern with the C<$> anchor. That way the -prompt will only match if it's the last thing read. - -=item * - -In the input stream, each sequence of I and I (i.e. C<"\015\012"> or CR LF) is converted to C<"\n">. In the -output stream, each occurrence of C<"\n"> is converted to a sequence -of CR LF. See C to change the behavior. TCP protocols -typically use the ASCII sequence, carriage return and line feed to -designate a newline. - -=item * - -Timing-out while making a connection is disabled for machines that -don't support the C function. Most notably these include -MS-Windows machines. - -=item * - -You'll need to be running at least Perl version 5.002 to use this -module. This module does not require any libraries that don't already -come with a standard Perl distribution. - -If you have the IO:: libraries installed (they come standard with -perl5.004 and later) then IO::Socket::INET is used as a base class, -otherwise FileHandle is used. - -=item * - -Contact me, Jay Rogers , if you find any bugs or have -suggestions for improvement. - -=back - -=head2 Debugging - -The typical usage bug causes a time-out error because you've made -incorrect assumptions about what the remote side actually sends. The -easiest way to reconcile what the remote side sends with your -expectations is to use C or C. - -C allows you to see the data being sent from the remote -side before any translation is done, while C shows you -the results after translation. The translation includes converting -end of line characters, removing and responding to TELNET protocol -commands in the data stream. - -=head2 Style of Named Parameters - -Two different styles of named parameters are supported. This document -only shows the IO:: style: - - Net::Telnet->new(Timeout => 20); - -however the dash-option style is also allowed: - - Net::Telnet->new(-timeout => 20); - -=head2 Connecting to a Remote MS-Windows Machine - -By default MS-Windows doesn't come with a TELNET server. However -third party TELNET servers are available. Unfortunately many of these -servers falsely claim to be a TELNET server. This is especially true -of the so-called "Microsoft Telnet Server" that comes installed with -some newer versions MS-Windows. - -When a TELNET server first accepts a connection, it must use the ASCII -control characters carriage-return and line-feed to start a new line -(see RFC854). A server like the "Microsoft Telnet Server" that -doesn't do this, isn't a TELNET server. These servers send ANSI -terminal escape sequences to position to a column on a subsequent line -and to even position while writing characters that are adjacent to -each other. Worse, when sending output these servers resend -previously sent command output in a misguided attempt to display an -entire terminal screen. - -Connecting Net::Telnet to one of these false TELNET servers makes your -job of parsing command output very difficult. It's better to replace -a false TELNET server with a real TELNET server. The better TELNET -servers for MS-Windows allow you to avoid the ANSI escapes by turning -off something some of them call I. - - -=head1 METHODS - -In the calling sequences below, square brackets B<[]> represent -optional parameters. - -=over 4 - -=item B - create a new Net::Telnet object - - $obj = new Net::Telnet ([$host]); - - $obj = new Net::Telnet ([Binmode => $mode,] - [Cmd_remove_mode => $mode,] - [Dump_Log => $filename,] - [Errmode => $errmode,] - [Fhopen => $filehandle,] - [Host => $host,] - [Input_log => $file,] - [Input_record_separator => $chars,] - [Option_log => $file,] - [Ors => $chars,] - [Output_log => $file,] - [Output_record_separator => $chars,] - [Port => $port,] - [Prompt => $matchop,] - [Rs => $chars,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This is the constructor for Net::Telnet objects. A new object is -returned on success, the error mode action is performed on failure - -see C. The optional arguments are short-cuts to methods of -the same name. - -If the I<$host> argument is given then the object is opened by -connecting to TCP I<$port> on I<$host>. Also see C. The new -object returned is given the following defaults in the absence of -corresponding named parameters: - -=over 4 - -=item - -The default I is C<"localhost"> - -=item - -The default I is C<23> - -=item - -The default I is C<'/[\$%#E] $/'> - -=item - -The default I is C<10> - -=item - -The default I is C<"die"> - -=item - -The default I is C<"\n">. Note that I -is synonymous with I. - -=item - -The default I is C<"\n">. Note that I is -synonymous with I. - -=item - -The default I is C<0>, which means do newline translation. - -=item - -The default I is C<1>, which means respond to TELNET -commands in the data stream. - -=item - -The default I is C<"auto"> - -=item - -The defaults for I, I, I, and -I are C<"">, which means that logging is turned-off. - -=back - -=back - - -=over 4 - -=item B - toggle newline translation - - $mode = $obj->binmode; - - $prev = $obj->binmode($mode); - -This method controls whether or not sequences of carriage returns and -line feeds (CR LF or more specifically C<"\015\012">) are translated. -By default they are translated (i.e. binmode is C<0>). - -If no argument is given, the current mode is returned. - -If I<$mode> is C<1> then binmode is I and newline translation is -not done. - -If I<$mode> is C<0> then binmode is I and newline translation is -done. In the input stream, each sequence of CR LF is converted to -C<"\n"> and in the output stream, each occurrence of C<"\n"> is -converted to a sequence of CR LF. - -Note that input is always buffered. Changing binmode doesn't effect -what's already been read into the buffer. Output is not buffered and -changing binmode will have an immediate effect. - -=back - - -=over 4 - -=item B - send TELNET break character - - $ok = $obj->break; - -This method sends the TELNET break character. This character is -provided because it's a signal outside the ASCII character set which -is currently given local meaning within many systems. It's intended -to indicate that the Break Key or the Attention Key was hit. - -This method returns C<1> on success, or performs the error mode action -on failure. - -=back - - -=over 4 - -=item B - scalar reference to object's input buffer - - $ref = $obj->buffer; - -This method returns a scalar reference to the input buffer for -I<$obj>. Data in the input buffer is data that has been read from the -remote side but has yet to be read by the user. Modifications to the -input buffer are returned by a subsequent read. - -=back - - -=over 4 - -=item B - discard all data in object's input buffer - - $obj->buffer_empty; - -This method removes all data in the input buffer for I<$obj>. - -=back - - -=over 4 - -=item B - close object - - $ok = $obj->close; - -This method closes the socket, file, or pipe associated with the -object. It always returns a value of C<1>. - -=back - - -=over 4 - -=item B - issue command and retrieve output - - $ok = $obj->cmd($string); - $ok = $obj->cmd(String => $string, - [Output => $ref,] - [Cmd_remove_mode => $mode,] - [Errmode => $mode,] - [Input_record_separator => $chars,] - [Ors => $chars,] - [Output_record_separator => $chars,] - [Prompt => $match,] - [Rs => $chars,] - [Timeout => $secs,]); - - @output = $obj->cmd($string); - @output = $obj->cmd(String => $string, - [Output => $ref,] - [Cmd_remove_mode => $mode,] - [Errmode => $mode,] - [Input_record_separator => $chars,] - [Ors => $chars,] - [Output_record_separator => $chars,] - [Prompt => $match,] - [Rs => $chars,] - [Timeout => $secs,]); - -This method sends the command I<$string>, and reads the characters -sent back by the command up until and including the matching prompt. -It's assumed that the program to which you're sending is some kind of -command prompting interpreter such as a shell. - -The command I<$string> is automatically appended with the -output_record_separator, By default that's C<"\n">. This is similar -to someone typing a command and hitting the return key. Set the -output_record_separator to change this behavior. - -In a scalar context, the characters read from the remote side are -discarded and C<1> is returned on success. On time-out, eof, or other -failures, the error mode action is performed. See C. - -In a list context, just the output generated by the command is -returned, one line per element. In other words, all the characters in -between the echoed back command string and the prompt are returned. -If the command happens to return no output, a list containing one -element, the empty string is returned. This is so the list will -indicate true in a boolean context. On time-out, eof, or other -failures, the error mode action is performed. See C. - -The characters that matched the prompt may be retrieved using -C. - -Many command interpreters echo back the command sent. In most -situations, this method removes the first line returned from the -remote side (i.e. the echoed back command). See C -for more control over this feature. - -Use C to debug when this method keeps timing-out and you -don't think it should. - -Consider using a combination of C and C as an -alternative to this method when it doesn't do what you want, e.g. the -command you send prompts for input. - -The I named parameter provides an alternative method of -receiving command output. If you pass a scalar reference, all the -output (even if it contains multiple lines) is returned in the -referenced scalar. If you pass an array or hash reference, the lines -of output are returned in the referenced array or hash. You can use -C to change the notion of what separates a -line. - -Optional named parameters are provided to override the current -settings of cmd_remove_mode, errmode, input_record_separator, ors, -output_record_separator, prompt, rs, and timeout. Rs is synonymous -with input_record_separator and ors is synonymous with -output_record_separator. - -=back - - -=over 4 - -=item B - toggle removal of echoed commands - - $mode = $obj->cmd_remove_mode; - - $prev = $obj->cmd_remove_mode($mode); - -This method controls how to deal with echoed back commands in the -output returned by cmd(). Typically, when you send a command to the -remote side, the first line of output returned is the command echoed -back. Use this mode to remove the first line of output normally -returned by cmd(). - -If no argument is given, the current mode is returned. - -If I<$mode> is C<0> then the command output returned from cmd() has no -lines removed. If I<$mode> is a positive integer, then the first -I<$mode> lines of command output are stripped. - -By default, I<$mode> is set to C<"auto">. Auto means that whether or -not the first line of command output is stripped, depends on whether -or not the remote side offered to echo. By default, Net::Telnet -always accepts an offer to echo by the remote side. You can change -the default to reject such an offer using C. - -A warning is printed to STDERR when attempting to set this attribute -to something that's not C<"auto"> or a non-negative integer. - -=back - - -=over 4 - -=item B - log all I/O in dump format - - $fh = $obj->dump_log; - - $fh = $obj->dump_log($fh); - - $fh = $obj->dump_log($filename); - -This method starts or stops dump format logging of all the object's -input and output. The dump format shows the blocks read and written -in a hexadecimal and printable character format. This method is -useful when debugging, however you might want to first try -C as it's more readable. - -If no argument is given, the current log filehandle is returned. An -empty string indicates logging is off. - -To stop logging, use an empty string as an argument. - -If an open filehandle is given, it is used for logging and returned. -Otherwise, the argument is assumed to be the name of a file, the file -is opened and a filehandle to it is returned. If the file can't be -opened for writing, the error mode action is performed. - -=back - - -=over 4 - -=item B - end of file indicator - - $eof = $obj->eof; - -This method returns C<1> if end of file has been read, otherwise it -returns an empty string. Because the input is buffered this isn't the -same thing as I<$obj> has closed. In other words I<$obj> can be -closed but there still can be stuff in the buffer to be read. Under -this condition you can still read but you won't be able to write. - -=back - - -=over 4 - -=item B - define action to be performed on error - - $mode = $obj->errmode; - - $prev = $obj->errmode($mode); - -This method gets or sets the action used when errors are encountered -using the object. The first calling sequence returns the current -error mode. The second calling sequence sets it to I<$mode> and -returns the previous mode. Valid values for I<$mode> are C<"die"> -(the default), C<"return">, a I, or an I. - -When mode is C<"die"> and an error is encountered using the object, -then an error message is printed to standard error and the program -dies. - -When mode is C<"return"> then the method generating the error places -an error message in the object and returns an undefined value in a -scalar context and an empty list in list context. The error message -may be obtained using C. - -When mode is a I, then when an error is encountered -I is called with the error message as its first argument. -Using this mode you may have your own subroutine handle errors. If -I itself returns then the method generating the error returns -undefined or an empty list depending on context. - -When mode is an I, the first element of the array must be a -I. Any elements that follow are the arguments to I. -When an error is encountered, the I is called with its -arguments. Using this mode you may have your own subroutine handle -errors. If the I itself returns then the method generating -the error returns undefined or an empty list depending on context. - -A warning is printed to STDERR when attempting to set this attribute -to something that's not C<"die">, C<"return">, a I, or an -I whose first element isn't a I. - -=back - - -=over 4 - -=item B - most recent error message - - $msg = $obj->errmsg; - - $prev = $obj->errmsg(@msgs); - -The first calling sequence returns the error message associated with -the object. The empty string is returned if no error has been -encountered yet. The second calling sequence sets the error message -for the object to the concatenation of I<@msgs> and returns the -previous error message. Normally, error messages are set internally -by a method when an error is encountered. - -=back - - -=over 4 - -=item B - perform the error mode action - - $obj->error(@msgs); - -This method concatenates I<@msgs> into a string and places it in the -object as the error message. Also see C. It then performs -the error mode action. Also see C. - -If the error mode doesn't cause the program to die, then an undefined -value or an empty list is returned depending on the context. - -This method is primarily used by this class or a sub-class to perform -the user requested action when an error is encountered. - -=back - - -=over 4 - -=item B - use already open filehandle for I/O - - $ok = $obj->fhopen($fh); - -This method associates the open filehandle I<$fh> with I<$obj> for -further I/O. Filehandle I<$fh> must already be opened. - -Suppose you want to use the features of this module to do I/O to -something other than a TCP port, for example STDIN or a filehandle -opened to read from a process. Instead of opening the object for I/O -to a TCP port by using C or C, call this method -instead. - -The value C<1> is returned success, the error mode action is performed -on failure. - -=back - - -=over 4 - -=item B - read block of data - - $data = $obj->get([Binmode => $mode,] - [Errmode => $errmode,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This method reads a block of data from the object and returns it along -with any buffered data. If no buffered data is available to return, -it will wait for data to read using the timeout specified in the -object. You can override that timeout using I<$secs>. Also see -C. If buffered data is available to return, it also checks -for a block of data that can be immediately read. - -On eof an undefined value is returned. On time-out or other failures, -the error mode action is performed. To distinguish between eof or an -error occurring when the error mode is not set to C<"die">, use -C. - -Optional named parameters are provided to override the current -settings of binmode, errmode, telnetmode, and timeout. - -=back - - -=over 4 - -=item B - read next line - - $line = $obj->getline([Binmode => $mode,] - [Errmode => $errmode,] - [Input_record_separator => $chars,] - [Rs => $chars,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This method reads and returns the next line of data from the object. -You can use C to change the notion of what -separates a line. The default is C<"\n">. If a line isn't -immediately available, this method blocks waiting for a line or a -time-out. - -On eof an undefined value is returned. On time-out or other failures, -the error mode action is performed. To distinguish between eof or an -error occurring when the error mode is not set to C<"die">, use -C. - -Optional named parameters are provided to override the current -settings of binmode, errmode, input_record_separator, rs, telnetmode, -and timeout. Rs is synonymous with input_record_separator. - -=back - - -=over 4 - -=item B - read next lines - - @lines = $obj->getlines([Binmode => $mode,] - [Errmode => $errmode,] - [Input_record_separator => $chars,] - [Rs => $chars,] - [Telnetmode => $mode,] - [Timeout => $secs,] - [All => $boolean,]); - -This method reads and returns all the lines of data from the object -until end of file is read. You can use C to -change the notion of what separates a line. The default is C<"\n">. -A time-out error occurs if all the lines can't be read within the -time-out interval. See C. - -The behavior of this method was changed in version 3.03. Prior to -version 3.03 this method returned just the lines available from the -next read. To get that old behavior, use the optional named parameter -I and set I<$boolean> to C<""> or C<0>. - -If only eof is read then an empty list is returned. On time-out or -other failures, the error mode action is performed. Use C to -distinguish between reading only eof or an error occurring when the -error mode is not set to C<"die">. - -Optional named parameters are provided to override the current -settings of binmode, errmode, input_record_separator, rs, telnetmode, -and timeout. Rs is synonymous with input_record_separator. - -=back - - -=over 4 - -=item B - name of remote host - - $host = $obj->host; - - $prev = $obj->host($host); - -This method designates the remote host for C. With no -argument it returns the current host name set in the object. With an -argument it sets the current host name to I<$host> and returns the -previous host name. You may indicate the remote host using either a -hostname or an IP address. - -The default value is C<"localhost">. It may also be set by C -or C. - -=back - - -=over 4 - -=item B - log all input - - $fh = $obj->input_log; - - $fh = $obj->input_log($fh); - - $fh = $obj->input_log($filename); - -This method starts or stops logging of input. This is useful when -debugging. Also see C. Because most command interpreters -echo back commands received, it's likely all your output will also be -in this log. Note that input logging occurs after newline -translation. See C for details on newline translation. - -If no argument is given, the log filehandle is returned. An empty -string indicates logging is off. - -To stop logging, use an empty string as an argument. - -If an open filehandle is given, it is used for logging and returned. -Otherwise, the argument is assumed to be the name of a file, the file -is opened for logging and a filehandle to it is returned. If the file -can't be opened for writing, the error mode action is performed. - -=back - - -=over 4 - -=item B - input line delimiter - - $chars = $obj->input_record_separator; - - $prev = $obj->input_record_separator($chars); - -This method designates the line delimiter for input. It's used with -C, C, and C to determine lines in the -input. - -With no argument this method returns the current input record -separator set in the object. With an argument it sets the input -record separator to I<$chars> and returns the previous value. Note -that I<$chars> must have length. - -A warning is printed to STDERR when attempting to set this attribute -to a string with no length. - -=back - - -=over 4 - -=item B - last prompt read - - $string = $obj->last_prompt; - - $prev = $obj->last_prompt($string); - -With no argument this method returns the last prompt read by cmd() or -login(). See C. With an argument it sets the last prompt -read to I<$string> and returns the previous value. Normally, only -internal methods set the last prompt. - -=back - - -=over 4 - -=item B - last line read - - $line = $obj->lastline; - - $prev = $obj->lastline($line); - -This method retrieves the last line read from the object. This may be -a useful error message when the remote side abnormally closes the -connection. Typically the remote side will print an error message -before closing. - -With no argument this method returns the last line read from the -object. With an argument it sets the last line read to I<$line> and -returns the previous value. Normally, only internal methods set the -last line. - -=back - - -=over 4 - -=item B - perform standard login - - $ok = $obj->login($username, $password); - - $ok = $obj->login(Name => $username, - Password => $password, - [Errmode => $mode,] - [Prompt => $match,] - [Timeout => $secs,]); - -This method performs a standard login by waiting for a login prompt -and responding with I<$username>, then waiting for the password prompt -and responding with I<$password>, and then waiting for the command -interpreter prompt. If any of those prompts sent by the remote side -don't match what's expected, this method will time-out, unless timeout -is turned off. - -Login prompt must match either of these case insensitive patterns: - - /login[: ]*$/i - /username[: ]*$/i - -Password prompt must match this case insensitive pattern: - - /password[: ]*$/i - -The command interpreter prompt must match the current setting of -prompt. See C. - -Use C to debug when this method keeps timing-out and you -don't think it should. - -Consider using a combination of C and C as an -alternative to this method when it doesn't do what you want, e.g. the -remote host doesn't prompt for a username. - -On success, C<1> is returned. On time out, eof, or other failures, -the error mode action is performed. See C. - -Optional named parameters are provided to override the current -settings of errmode, prompt, and timeout. - -=back - - -=over 4 - -=item B - maximum size of input buffer - - $len = $obj->max_buffer_length; - - $prev = $obj->max_buffer_length($len); - -This method designates the maximum size of the input buffer. An error -is generated when a read causes the buffer to exceed this limit. The -default value is 1,048,576 bytes (1MB). The input buffer can grow -much larger than the block size when you continuously read using -C or C and the data stream contains no newlines -or matching waitfor patterns. - -With no argument, this method returns the current maximum buffer -length set in the object. With an argument it sets the maximum buffer -length to I<$len> and returns the previous value. Values of I<$len> -smaller than 512 will be adjusted to 512. - -A warning is printed to STDERR when attempting to set this attribute -to something that isn't a positive integer. - -=back - - -=over 4 - -=item B - field separator for print - - $chars = $obj->ofs - - $prev = $obj->ofs($chars); - -This method is synonymous with C. - -=back - - -=over 4 - -=item B - connect to port on remote host - - $ok = $obj->open($host); - - $ok = $obj->open([Host => $host,] - [Port => $port,] - [Errmode => $mode,] - [Timeout => $secs,]); - -This method opens a TCP connection to I<$port> on I<$host>. If either -argument is missing then the current value of C or C -is used. Optional named parameters are provided to override the -current setting of errmode and timeout. - -On success C<1> is returned. On time-out or other connection -failures, the error mode action is performed. See C. - -Time-outs don't work for this method on machines that don't implement -SIGALRM - most notably MS-Windows machines. For those machines, an -error is returned when the system reaches its own time-out while -trying to connect. - -A side effect of this method is to reset the alarm interval associated -with SIGALRM. - -=back - - -=over 4 - -=item B - indicate willingness to accept a TELNET option - - $fh = $obj->option_accept([Do => $telopt,] - [Dont => $telopt,] - [Will => $telopt,] - [Wont => $telopt,]); - -This method is used to indicate whether to accept or reject an offer -to enable a TELNET option made by the remote side. If you're using -I or I to indicate a willingness to enable, then a -notification callback must have already been defined by a prior call -to C. See C for details on -receiving enable/disable notification of a TELNET option. - -You can give multiple I, I, I, or I arguments -for different TELNET options in the same call to this method. - -The following example describes the meaning of the named parameters. -A TELNET option, such as C used below, is an integer -constant that you can import from Net::Telnet. See the source in file -Telnet.pm for the complete list. - -=over 4 - -=item - -I => C - -=over 4 - -=item - -we'll accept an offer to enable the echo option on the local side - -=back - -=item - -I => C - -=over 4 - -=item - -we'll reject an offer to enable the echo option on the local side - -=back - -=item - -I => C - -=over 4 - -=item - -we'll accept an offer to enable the echo option on the remote side - -=back - -=item - -I => C - -=over 4 - -=item - -we'll reject an offer to enable the echo option on the remote side - -=back - -=back - -=item - -Use C to send a request to the remote side to enable or -disable a particular TELNET option. - -=back - - -=over 4 - -=item B - define the option negotiation callback - - $coderef = $obj->option_callback; - - $prev = $obj->option_callback($coderef); - -This method defines the callback subroutine that's called when a -TELNET option is enabled or disabled. Once defined, the -I may not be undefined. However, calling this method -with a different I<$coderef> changes it. - -A warning is printed to STDERR when attempting to set this attribute -to something that isn't a coderef. - -Here are the circumstances that invoke I<$coderef>: - -=over 4 - -=item - -An option becomes enabled because the remote side requested an enable -and C had been used to arrange that it be accepted. - -=item - -The remote side arbitrarily decides to disable an option that is -currently enabled. Note that Net::Telnet always accepts a request to -disable from the remote side. - -=item - -C was used to send a request to enable or disable an -option and the response from the remote side has just been received. -Note, that if a request to enable is rejected then I<$coderef> is -still invoked even though the option didn't change. - -=back - -=item - -Here are the arguments passed to I<&$coderef>: - - &$coderef($obj, $option, $is_remote, - $is_enabled, $was_enabled, $buf_position); - -=over 4 - -=item - -1. I<$obj> is the Net::Telnet object - -=item - -2. I<$option> is the TELNET option. Net::Telnet exports constants -for the various TELNET options which just equate to an integer. - -=item - -3. I<$is_remote> is a boolean indicating for which side the option -applies. - -=item - -4. I<$is_enabled> is a boolean indicating the option is enabled or -disabled - -=item - -5. I<$was_enabled> is a boolean indicating the option was previously -enabled or disabled - -=item - -6. I<$buf_position> is an integer indicating the position in the -object's input buffer where the option takes effect. See C -to access the object's input buffer. - -=back - -=back - - -=over 4 - -=item B - log all TELNET options sent or received - - $fh = $obj->option_log; - - $fh = $obj->option_log($fh); - - $fh = $obj->option_log($filename); - -This method starts or stops logging of all TELNET options being sent -or received. This is useful for debugging when you send options via -C or you arrange to accept option requests from the -remote side via C. Also see C. - -If no argument is given, the log filehandle is returned. An empty -string indicates logging is off. - -To stop logging, use an empty string as an argument. - -If an open filehandle is given, it is used for logging and returned. -Otherwise, the argument is assumed to be the name of a file, the file -is opened for logging and a filehandle to it is returned. If the file -can't be opened for writing, the error mode action is performed. - -=back - - -=over 4 - -=item B - send TELNET option negotiation request - - $ok = $obj->option_send([Do => $telopt,] - [Dont => $telopt,] - [Will => $telopt,] - [Wont => $telopt,] - [Async => $boolean,]); - -This method is not yet implemented. Look for it in a future version. - -=back - - -=over 4 - -=item B - get current state of a TELNET option - - $hashref = $obj->option_state($telopt); - -This method returns a hashref containing a copy of the current state -of TELNET option I<$telopt>. - -Here are the values returned in the hash: - -=over 4 - -=item - -I<$hashref>->{remote_enabled} - -=over 4 - -=item - -boolean that indicates if the option is enabled on the remote side. - -=back - -=item - -I<$hashref>->{remote_enable_ok} - -=over 4 - -=item - -boolean that indicates if it's ok to accept an offer to enable this -option on the remote side. - -=back - -=item - -I<$hashref>->{remote_state} - -=over 4 - -=item - -string used to hold the internal state of option negotiation for this -option on the remote side. - -=back - -=item - -I<$hashref>->{local_enabled} - -=over 4 - -=item - -boolean that indicates if the option is enabled on the local side. - -=back - -=item - -I<$hashref>->{local_enable_ok} - -=over 4 - -=item - -boolean that indicates if it's ok to accept an offer to enable this -option on the local side. - -=back - -=item - -I<$hashref>->{local_state} - -=over 4 - -=item - -string used to hold the internal state of option negotiation for this -option on the local side. - -=back - -=back - -=back - - -=over 4 - -=item B - output line delimiter - - $chars = $obj->ors; - - $prev = $obj->ors($chars); - -This method is synonymous with C. - -=back - - -=over 4 - -=item B - field separator for print - - $chars = $obj->output_field_separator; - - $prev = $obj->output_field_separator($chars); - -This method designates the output field separator for C. -Ordinarily the print method simply prints out the comma separated -fields you specify. Set this to specify what's printed between -fields. - -With no argument this method returns the current output field -separator set in the object. With an argument it sets the output -field separator to I<$chars> and returns the previous value. - -By default it's set to an empty string. - -=back - - -=over 4 - -=item B - log all output - - $fh = $obj->output_log; - - $fh = $obj->output_log($fh); - - $fh = $obj->output_log($filename); - -This method starts or stops logging of output. This is useful when -debugging. Also see C. Because most command interpreters -echo back commands received, it's likely all your output would also be -in an input log. See C. Note that output logging occurs -before newline translation. See C for details on newline -translation. - -If no argument is given, the log filehandle is returned. An empty -string indicates logging is off. - -To stop logging, use an empty string as an argument. - -If an open filehandle is given, it is used for logging and returned. -Otherwise, the argument is assumed to be the name of a file, the file -is opened for logging and a filehandle to it is returned. If the file -can't be opened for writing, the error mode action is performed. - -=back - - -=over 4 - -=item B - output line delimiter - - $chars = $obj->output_record_separator; - - $prev = $obj->output_record_separator($chars); - -This method designates the output line delimiter for C and -C. Set this to specify what's printed at the end of C -and C. - -The output record separator is set to C<"\n"> by default, so there's -no need to append all your commands with a newline. To avoid printing -the output_record_separator use C or set the -output_record_separator to an empty string. - -With no argument this method returns the current output record -separator set in the object. With an argument it sets the output -record separator to I<$chars> and returns the previous value. - -=back - - -=over 4 - -=item B - remote port - - $port = $obj->port; - - $prev = $obj->port($port); - -This method designates the remote TCP port. With no argument this -method returns the current port number. With an argument it sets the -current port number to I<$port> and returns the previous port. If -I<$port> is a TCP service name, then it's first converted to a port -number using the perl function C. - -The default value is C<23>. It may also be set by C or -C. - -A warning is printed to STDERR when attempting to set this attribute -to something that's not a positive integer or a valid TCP service -name. - -=back - - -=over 4 - -=item B - write to object - - $ok = $obj->print(@list); - -This method writes I<@list> followed by the I -to the open object and returns C<1> if all data was successfully -written. On time-out or other failures, the error mode action is -performed. See C. - -By default, the C is set to C<"\n"> so all -your commands automatically end with a newline. In most cases your -output is being read by a command interpreter which won't accept a -command until newline is read. This is similar to someone typing a -command and hitting the return key. To avoid printing a trailing -C<"\n"> use C instead or set the output_record_separator to an -empty string. - -On failure, it's possible that some data was written. If you choose -to try and recover from a print timing-out, use C to -determine how much was written before the error occurred. - -You may also use the output field separator to print a string between -the list elements. See C. - -=back - - -=over 4 - -=item B - number of bytes written by print - - $num = $obj->print_length; - -This returns the number of bytes successfully written by the most -recent C or C. - -=back - - -=over 4 - -=item B - pattern to match a prompt - - $matchop = $obj->prompt; - - $prev = $obj->prompt($matchop); - -This method sets the pattern used to find a prompt in the input -stream. It must be a string representing a valid perl pattern match -operator. The methods C and C try to read until -matching the prompt. They will fail with a time-out error if the -pattern you've chosen doesn't match what the remote side sends. - -With no argument this method returns the prompt set in the object. -With an argument it sets the prompt to I<$matchop> and returns the -previous value. - -The default prompt is C<'/[\$%#E] $/'> - -Always use single quotes, instead of double quotes, to construct -I<$matchop> (e.g. C<'/bash\$ $/'>). If you're constructing a DOS like -file path, you'll need to use four backslashes to represent one -(e.g. C<'/c:\\\\users\\\\billE$/i'>). - -Of course don't forget about regexp metacharacters like C<.>, C<[>, or -C<$>. You'll only need a single backslash to quote them. The anchor -metacharacters C<^> and C<$> refer to positions in the input buffer. - -A warning is printed to STDERR when attempting to set this attribute -with a match operator missing its opening delimiter. - -=back - - -=over 4 - -=item B - write to object - - $ok = $obj->put($string); - - $ok = $obj->put(String => $string, - [Binmode => $mode,] - [Errmode => $errmode,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This method writes I<$string> to the opened object and returns C<1> if -all data was successfully written. This method is like C -except that it doesn't write the trailing output_record_separator -("\n" by default). On time-out or other failures, the error mode -action is performed. See C. - -On failure, it's possible that some data was written. If you choose -to try and recover from a put timing-out, use C to -determine how much was written before the error occurred. - -Optional named parameters are provided to override the current -settings of binmode, errmode, telnetmode, and timeout. - -=back - - -=over 4 - -=item B - input line delimiter - - $chars = $obj->rs; - - $prev = $obj->rs($chars); - -This method is synonymous with C. - -=back - - -=over 4 - -=item B - turn off/on telnet command interpretation - - $mode = $obj->telnetmode; - - $prev = $obj->telnetmode($mode); - -This method controls whether or not TELNET commands in the data stream -are recognized and handled. The TELNET protocol uses certain -character sequences sent in the data stream to control the session. -If the port you're connecting to isn't using the TELNET protocol, then -you should turn this mode off. The default is I. - -If no argument is given, the current mode is returned. - -If I<$mode> is C<0> then telnet mode is off. If I<$mode> is C<1> then -telnet mode is on. - -=back - - -=over 4 - -=item B - time-out indicator - - $boolean = $obj->timed_out; - - $prev = $obj->timed_out($boolean); - -This method indicates if a previous read, write, or open method -timed-out. Remember that timing-out is itself an error. To be able -to invoke C after a time-out error, you'd have to change -the default error mode to something other than C<"die">. See -C. - -With no argument this method returns C<1> if the previous method -timed-out. With an argument it sets the indicator. Normally, only -internal methods set this indicator. - -=back - - -=over 4 - -=item B - I/O time-out interval - - $secs = $obj->timeout; - - $prev = $obj->timeout($secs); - -This method sets the timeout interval that's used when performing I/O -or connecting to a port. When a method doesn't complete within the -timeout interval then it's an error and the error mode action is -performed. - -A timeout may be expressed as a relative or absolute value. If -I<$secs> is greater than or equal to the time the program started, as -determined by $^T, then it's an absolute time value for when time-out -occurs. The perl function C may be used to obtain an absolute -time value. For a relative time-out value less than $^T, time-out -happens I<$secs> from when the method begins. - -If I<$secs> is C<0> then time-out occurs if the data cannot be -immediately read or written. Use the undefined value to turn off -timing-out completely. - -With no argument this method returns the timeout set in the object. -With an argument it sets the timeout to I<$secs> and returns the -previous value. The default timeout value is C<10> seconds. - -A warning is printed to STDERR when attempting to set this attribute -to something that's not an C or a non-negative integer. - -=back - - -=over 4 - -=item B - wait for pattern in the input - - $ok = $obj->waitfor($matchop); - $ok = $obj->waitfor([Match => $matchop,] - [String => $string,] - [Binmode => $mode,] - [Errmode => $errmode,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - - ($prematch, $match) = $obj->waitfor($matchop); - ($prematch, $match) = $obj->waitfor([Match => $matchop,] - [String => $string,] - [Binmode => $mode,] - [Errmode => $errmode,] - [Telnetmode => $mode,] - [Timeout => $secs,]); - -This method reads until a pattern match or string is found in the -input stream. All the characters before and including the match are -removed from the input stream. - -In a list context the characters before the match and the matched -characters are returned in I<$prematch> and I<$match>. In a scalar -context, the matched characters and all characters before it are -discarded and C<1> is returned on success. On time-out, eof, or other -failures, for both list and scalar context, the error mode action is -performed. See C. - -You can specify more than one pattern or string by simply providing -multiple I and/or I named parameters. A I<$matchop> -must be a string representing a valid Perl pattern match operator. -The I<$string> is just a substring to find in the input stream. - -Use C to debug when this method keeps timing-out and you -don't think it should. - -An optional named parameter is provided to override the current -setting of timeout. - -To avoid unexpected backslash interpretation, always use single quotes -instead of double quotes to construct a match operator argument for -C and C (e.g. C<'/bash\$ $/'>). If you're -constructing a DOS like file path, you'll need to use four backslashes -to represent one (e.g. C<'/c:\\\\users\\\\billE$/i'>). - -Of course don't forget about regexp metacharacters like C<.>, C<[>, or -C<$>. You'll only need a single backslash to quote them. The anchor -metacharacters C<^> and C<$> refer to positions in the input buffer. - -Optional named parameters are provided to override the current -settings of binmode, errmode, telnetmode, and timeout. - -=back - - -=head1 SEE ALSO - -=over 2 - -=item RFC 854 - -S - -S - -=item RFC 1143 - -S - -S - -=item TELNET Option Assignments - -S - -=back - - -=head1 EXAMPLES - -This example gets the current weather forecast for Brainerd, Minnesota. - - my ($forecast, $t); - - use Net::Telnet (); - $t = new Net::Telnet; - $t->open("rainmaker.wunderground.com"); - - ## Wait for first prompt and "hit return". - $t->waitfor('/continue:.*$/'); - $t->print(""); - - ## Wait for second prompt and respond with city code. - $t->waitfor('/city code.*$/'); - $t->print("BRD"); - - ## Read and print the first page of forecast. - ($forecast) = $t->waitfor('/[ \t]+press return to continue/i'); - print $forecast; - - exit; - - -This example checks a POP server to see if you have mail. - - my ($hostname, $line, $passwd, $pop, $username); - - $hostname = "your_destination_host_here"; - $username = "your_username_here"; - $passwd = "your_password_here"; - - use Net::Telnet (); - $pop = new Net::Telnet (Telnetmode => 0); - $pop->open(Host => $hostname, - Port => 110); - - - ## Read connection message. - $line = $pop->getline; - die $line unless $line =~ /^\+OK/; - - ## Send user name. - $pop->print("user $username"); - $line = $pop->getline; - die $line unless $line =~ /^\+OK/; - - ## Send password. - $pop->print("pass $passwd"); - $line = $pop->getline; - die $line unless $line =~ /^\+OK/; - - ## Request status of messages. - $pop->print("list"); - $line = $pop->getline; - print $line; - - exit; - - -Here's an example that uses the ssh program to connect to a remote -host. Because the ssh program reads and writes to its controlling -terminal, the IO::Pty module is used to create a new pseudo terminal -for use by ssh. A new Net::Telnet object is then created to read and -write to that pseudo terminal. To use the code below, substitute -"changeme" with the actual host, user, password, and command prompt. - - ## Main program. - { - my ($pty, $ssh, @lines); - my $host = "changeme"; - my $user = "changeme"; - my $password = "changeme"; - my $prompt = '/changeme:~> $/'; - - ## Start ssh program. - $pty = &spawn("ssh", "-l", $user, $host); # spawn() defined below - - ## Create a Net::Telnet object to perform I/O on ssh's tty. - use Net::Telnet; - $ssh = new Net::Telnet (-fhopen => $pty, - -prompt => $prompt, - -telnetmode => 0, - -cmd_remove_mode => 1, - -output_record_separator => "\r"); - - ## Login to remote host. - $ssh->waitfor(-match => '/password: ?$/i', - -errmode => "return") - or die "problem connecting to host: ", $ssh->lastline; - $ssh->print($password); - $ssh->waitfor(-match => $ssh->prompt, - -errmode => "return") - or die "login failed: ", $ssh->lastline; - - ## Send command, get and print its output. - @lines = $ssh->cmd("who"); - print @lines; - - exit; - } # end main program - - sub spawn { - my(@cmd) = @_; - my($pid, $pty, $tty, $tty_fd); - - ## Create a new pseudo terminal. - use IO::Pty (); - $pty = new IO::Pty - or die $!; - - ## Execute the program in another process. - unless ($pid = fork) { # child process - die "problem spawning program: $!\n" unless defined $pid; - - ## Disassociate process from existing controlling terminal. - use POSIX (); - POSIX::setsid - or die "setsid failed: $!"; - - ## Associate process with a new controlling terminal. - $tty = $pty->slave; - $tty_fd = $tty->fileno; - close $pty; - - ## Make stdio use the new controlling terminal. - open STDIN, "<&$tty_fd" or die $!; - open STDOUT, ">&$tty_fd" or die $!; - open STDERR, ">&STDOUT" or die $!; - close $tty; - - ## Execute requested program. - exec @cmd - or die "problem executing $cmd[0]\n"; - } # end child process - - $pty; - } # end sub spawn - - -Here's an example that changes a user's login password. Because the -passwd program always prompts for passwords on its controlling -terminal, the IO::Pty module is used to create a new pseudo terminal -for use by passwd. A new Net::Telnet object is then created to read -and write to that pseudo terminal. To use the code below, substitute -"changeme" with the actual old and new passwords. - - my ($pty, $passwd); - my $oldpw = "changeme"; - my $newpw = "changeme"; - - ## Start passwd program. - $pty = &spawn("passwd"); # spawn() defined above - - ## Create a Net::Telnet object to perform I/O on passwd's tty. - use Net::Telnet; - $passwd = new Net::Telnet (-fhopen => $pty, - -timeout => 2, - -output_record_separator => "\r", - -telnetmode => 0, - -cmd_remove_mode => 1); - $passwd->errmode("return"); - - ## Send existing password. - $passwd->waitfor('/password: ?$/i') - or die "no old password prompt: ", $passwd->lastline; - $passwd->print($oldpw); - - ## Send new password. - $passwd->waitfor('/new password: ?$/i') - or die "bad old password: ", $passwd->lastline; - $passwd->print($newpw); - - ## Send new password verification. - $passwd->waitfor('/new password: ?$/i') - or die "bad new password: ", $passwd->lastline; - $passwd->print($newpw); - - ## Display success or failure. - $passwd->waitfor('/changed/') - or die "bad new password: ", $passwd->lastline; - print $passwd->lastline; - - $passwd->close; - exit; - - -Here's an example you can use to down load a file of any type. The -file is read from the remote host's standard output using cat. To -prevent any output processing, the remote host's standard output is -put in raw mode using the Bourne shell. The Bourne shell is used -because some shells, notably tcsh, prevent changing tty modes. Upon -completion, FTP style statistics are printed to stderr. - - my ($block, $filename, $host, $hostname, $k_per_sec, $line, - $num_read, $passwd, $prevblock, $prompt, $size, $size_bsd, - $size_sysv, $start_time, $total_time, $username); - - $hostname = "your_destination_host_here"; - $username = "your_username_here"; - $passwd = "your_password_here"; - $filename = "your_download_file_here"; - - ## Connect and login. - use Net::Telnet (); - $host = new Net::Telnet (Timeout => 30, - Prompt => '/[%#>] $/'); - $host->open($hostname); - $host->login($username, $passwd); - - ## Make sure prompt won't match anything in send data. - $prompt = "_funkyPrompt_"; - $host->prompt("/$prompt\$/"); - $host->cmd("set prompt = '$prompt'"); - - ## Get size of file. - ($line) = $host->cmd("/bin/ls -l $filename"); - ($size_bsd, $size_sysv) = (split ' ', $line)[3,4]; - if ($size_sysv =~ /^\d+$/) { - $size = $size_sysv; - } - elsif ($size_bsd =~ /^\d+$/) { - $size = $size_bsd; - } - else { - die "$filename: no such file on $hostname"; - } - - ## Start sending the file. - binmode STDOUT; - $host->binmode(1); - $host->print("/bin/sh -c 'stty raw; cat $filename'"); - $host->getline; # discard echoed back line - - ## Read file a block at a time. - $num_read = 0; - $prevblock = ""; - $start_time = time; - while (($block = $host->get) and ($block !~ /$prompt$/o)) { - if (length $block >= length $prompt) { - print $prevblock; - $num_read += length $prevblock; - $prevblock = $block; - } - else { - $prevblock .= $block; - } - - } - $host->close; - - ## Print last block without trailing prompt. - $prevblock .= $block; - $prevblock =~ s/$prompt$//; - print $prevblock; - $num_read += length $prevblock; - die "error: expected size $size, received size $num_read\n" - unless $num_read == $size; - - ## Print totals. - $total_time = (time - $start_time) || 1; - $k_per_sec = ($size / 1024) / $total_time; - $k_per_sec = sprintf "%3.1f", $k_per_sec; - warn("$num_read bytes received in $total_time seconds ", - "($k_per_sec Kbytes/s)\n"); - - exit; - - -=head1 AUTHOR - -Jay Rogers - - -=head1 COPYRIGHT - -Copyright 1997, 2000, 2002 by Jay Rogers. All rights reserved. -This program is free software; you can redistribute it and/or -modify it under the same terms as Perl itself. diff --git a/libs/Time/HiRes.1.59.pm b/libs/Time/HiRes.1.59.pm deleted file mode 100644 index 98d31429..00000000 --- a/libs/Time/HiRes.1.59.pm +++ /dev/null @@ -1,359 +0,0 @@ -package Time::HiRes; - -use strict; -use vars qw($VERSION $XS_VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); - -require Exporter; -require DynaLoader; - -@ISA = qw(Exporter DynaLoader); - -@EXPORT = qw( ); -@EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval - getitimer setitimer - ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF - d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer - d_nanosleep); - -$VERSION = '1.59'; -$XS_VERSION = $VERSION; -$VERSION = eval $VERSION; - -sub AUTOLOAD { - my $constname; - ($constname = $AUTOLOAD) =~ s/.*:://; - die "&Time::HiRes::constant not defined" if $constname eq 'constant'; - my ($error, $val) = constant($constname); - if ($error) { die $error; } - { - no strict 'refs'; - *$AUTOLOAD = sub { $val }; - } - goto &$AUTOLOAD; -} - -bootstrap Time::HiRes; - -# Preloaded methods go here. - -sub tv_interval { - # probably could have been done in C - my ($a, $b) = @_; - $b = [gettimeofday()] unless defined($b); - (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000); -} - -# Autoload methods go after =cut, and are processed by the autosplit program. - -1; -__END__ - -=head1 NAME - -Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers - -=head1 SYNOPSIS - - use Time::HiRes qw( usleep ualarm gettimeofday tv_interval ); - - usleep ($microseconds); - - ualarm ($microseconds); - ualarm ($microseconds, $interval_microseconds); - - $t0 = [gettimeofday]; - ($seconds, $microseconds) = gettimeofday; - - $elapsed = tv_interval ( $t0, [$seconds, $microseconds]); - $elapsed = tv_interval ( $t0, [gettimeofday]); - $elapsed = tv_interval ( $t0 ); - - use Time::HiRes qw ( time alarm sleep ); - - $now_fractions = time; - sleep ($floating_seconds); - alarm ($floating_seconds); - alarm ($floating_seconds, $floating_interval); - - use Time::HiRes qw( setitimer getitimer - ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF ); - - setitimer ($which, $floating_seconds, $floating_interval ); - getitimer ($which); - -=head1 DESCRIPTION - -The C module implements a Perl interface to the C, -C, C, and C/C system calls, in other -words, high resolution time and timers. See the L section below -and the test scripts for usage; see your system documentation for the -description of the underlying C or C, C, -C, and C/C calls. - -If your system lacks C or an emulation of it you don't -get C or the one-argument form of C. If your system lacks all of -C, C, and C, you don't get -C or C. If your system lacks both -C and C you don't get -C or C. - -If you try to import an unimplemented function in the C statement -it will fail at compile time. - -If your subsecond sleeping is implemented with C instead of -C, you can mix subsecond sleeping with signals since -C does not use signals. This, however is unportable, and you -should first check for the truth value of C<&Time::HiRes::d_nanosleep> to -see whether you have nanosleep, and then carefully read your -C C API documentation for any peculiarities. (There is no -separate interface to call C; just use C -or C with small enough values.) - -Unless using C for mixing sleeping with signals, give -some thought to whether Perl is the tool you should be using for work -requiring nanosecond accuracies. - -The following functions can be imported from this module. -No functions are exported by default. - -=over 4 - -=item gettimeofday () - -In array context returns a two-element array with the seconds and -microseconds since the epoch. In scalar context returns floating -seconds like C (see below). - -=item usleep ( $useconds ) - -Sleeps for the number of microseconds specified. Returns the number -of microseconds actually slept. Can sleep for more than one second, -unlike the C system call. See also C below. - -=item ualarm ( $useconds [, $interval_useconds ] ) - -Issues a C call; the C<$interval_useconds> is optional and -will be zero if unspecified, resulting in C-like behaviour. - -=item tv_interval - -tv_interval ( $ref_to_gettimeofday [, $ref_to_later_gettimeofday] ) - -Returns the floating seconds between the two times, which should have -been returned by C. If the second argument is omitted, -then the current time is used. - -=item time () - -Returns a floating seconds since the epoch. This function can be -imported, resulting in a nice drop-in replacement for the C below. - -B: This higher resolution timer can return values either less -or more than the core C, depending on whether your platform -rounds the higher resolution timer values up, down, or to the nearest second -to get the core C, but naturally the difference should be never -more than half a second. - -B: Since Sunday, September 9th, 2001 at 01:46:40 AM GMT, when -the C seconds since epoch rolled over to 1_000_000_000, the -default floating point format of Perl and the seconds since epoch have -conspired to produce an apparent bug: if you print the value of -C you seem to be getting only five decimals, not six -as promised (microseconds). Not to worry, the microseconds are there -(assuming your platform supports such granularity in first place). -What is going on is that the default floating point format of Perl -only outputs 15 digits. In this case that means ten digits before the -decimal separator and five after. To see the microseconds you can use -either C/C with C<"%.6f">, or the C function in -list context, which will give you the seconds and microseconds as two -separate values. - -=item sleep ( $floating_seconds ) - -Sleeps for the specified amount of seconds. Returns the number of -seconds actually slept (a floating point value). This function can be -imported, resulting in a nice drop-in replacement for the C -provided with perl, see the L below. - -=item alarm ( $floating_seconds [, $interval_floating_seconds ] ) - -The C signal is sent after the specified number of seconds. -Implemented using C. The C<$interval_floating_seconds> argument -is optional and will be zero if unspecified, resulting in C-like -behaviour. This function can be imported, resulting in a nice drop-in -replacement for the C provided with perl, see the L below. - -B: With some operating system and Perl release combinations -C restarts C, instead of interuping it. -This means that an C followed by a C -may together take the sum of the times specified for the the -C and the C, not just the time of the C. - -=item setitimer ( $which, $floating_seconds [, $interval_floating_seconds ] ) - -Start up an interval timer: after a certain time, a signal arrives, -and more signals may keep arriving at certain intervals. To disable a -timer, use C<$floating_seconds> of zero. If the C<$interval_floating_seconds> -is set to zero (or unspecified), the timer is disabled B the -next delivered signal. - -Use of interval timers may interfere with C, C, -and C. In standard-speak the "interaction is unspecified", -which means that I may happen: it may work, it may not. - -In scalar context, the remaining time in the timer is returned. - -In list context, both the remaining time and the interval are returned. - -There are usually three or four interval timers available: the C<$which> -can be C, C, C, or C. -Note that which ones are available depends: true UNIX platforms usually -have the first three, but (for example) Win32 and Cygwin have only -C, and only Solaris seems to have C (which is -used to profile multithreaded programs). - -C results in C-like behavior. Time is counted in -I; that is, wallclock time. C is delivered when -the timer expires. - -C counts time in (process) I; that is, only -when the process is running. In multiprocessor/user/CPU systems this -may be more or less than real or wallclock time. (This time is also -known as the I.) C is delivered when the timer expires. - -C counts time when either the process virtual time or when -the operating system is running on behalf of the process (such as I/O). -(This time is also known as the I.) (The sum of user -time and system time is known as the I.) C is -delivered when the timer expires. C can interrupt system calls. - -The semantics of interval timers for multithreaded programs are -system-specific, and some systems may support additional interval -timers. See your C documentation. - -=item getitimer ( $which ) - -Return the remaining time in the interval timer specified by C<$which>. - -In scalar context, the remaining time is returned. - -In list context, both the remaining time and the interval are returned. -The interval is always what you put in using C. - -=back - -=head1 EXAMPLES - - use Time::HiRes qw(usleep ualarm gettimeofday tv_interval); - - $microseconds = 750_000; - usleep $microseconds; - - # signal alarm in 2.5s & every .1s thereafter - ualarm 2_500_000, 100_000; - - # get seconds and microseconds since the epoch - ($s, $usec) = gettimeofday; - - # measure elapsed time - # (could also do by subtracting 2 gettimeofday return values) - $t0 = [gettimeofday]; - # do bunch of stuff here - $t1 = [gettimeofday]; - # do more stuff here - $t0_t1 = tv_interval $t0, $t1; - - $elapsed = tv_interval ($t0, [gettimeofday]); - $elapsed = tv_interval ($t0); # equivalent code - - # - # replacements for time, alarm and sleep that know about - # floating seconds - # - use Time::HiRes; - $now_fractions = Time::HiRes::time; - Time::HiRes::sleep (2.5); - Time::HiRes::alarm (10.6666666); - - use Time::HiRes qw ( time alarm sleep ); - $now_fractions = time; - sleep (2.5); - alarm (10.6666666); - - # Arm an interval timer to go off first at 10 seconds and - # after that every 2.5 seconds, in process virtual time - - use Time::HiRes qw ( setitimer ITIMER_VIRTUAL time ); - - $SIG{VTALRM} = sub { print time, "\n" }; - setitimer(ITIMER_VIRTUAL, 10, 2.5); - -=head1 C API - -In addition to the perl API described above, a C API is available for -extension writers. The following C functions are available in the -modglobal hash: - - name C prototype - --------------- ---------------------- - Time::NVtime double (*)() - Time::U2time void (*)(UV ret[2]) - -Both functions return equivalent information (like C) -but with different representations. The names C and C -were selected mainly because they are operating system independent. -(C is Unix-centric, though some platforms like VMS have -emulations for it.) - -Here is an example of using C from C: - - double (*myNVtime)(); - SV **svp = hv_fetch(PL_modglobal, "Time::NVtime", 12, 0); - if (!svp) croak("Time::HiRes is required"); - if (!SvIOK(*svp)) croak("Time::NVtime isn't a function pointer"); - myNVtime = INT2PTR(double(*)(), SvIV(*svp)); - printf("The current time is: %f\n", (*myNVtime)()); - -=head1 DIAGNOSTICS - -=head2 negative time not invented yet - -You tried to use a negative time argument. - -=head2 internal error: useconds < 0 (unsigned ... signed ...) - -Something went horribly wrong-- the number of microseconds that cannot -become negative just became negative. Maybe your compiler is broken? - -=head1 CAVEATS - -Notice that the core C maybe rounding rather than truncating. -What this means is that the core C may be reporting the time -as one second later than C and C. - -Adjusting the system clock (either manually or by services like ntp) -may cause problems, especially for long running programs that assume -a monotonously increasing time (note that all platforms do not adjust -time as gracefully as UNIX ntp does). For example in Win32 (and derived -platforms like Cygwin and MinGW) the Time::HiRes::time() may temporarily -drift off from the system clock (and the original time()) by up to 0.5 -seconds. Time::HiRes will notice this eventually and recalibrate. - -=head1 AUTHORS - -D. Wegscheid -R. Schertler -J. Hietaniemi -G. Aas - -=head1 COPYRIGHT AND LICENSE - -Copyright (c) 1996-2002 Douglas E. Wegscheid. All rights reserved. - -Copyright (c) 2002,2003,2004 Jarkko Hietaniemi. All rights reserved. - -This program is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut diff --git a/libs/Time/HiRes.1.65.pm b/libs/Time/HiRes.1.65.pm deleted file mode 100644 index e47e09c7..00000000 --- a/libs/Time/HiRes.1.65.pm +++ /dev/null @@ -1,369 +0,0 @@ -package Time::HiRes; - -use strict; -use vars qw($VERSION $XS_VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); - -require Exporter; -require DynaLoader; - -@ISA = qw(Exporter DynaLoader); - -@EXPORT = qw( ); -@EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval - getitimer setitimer - ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF - d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer - d_nanosleep); - -$VERSION = '1.65'; -$XS_VERSION = $VERSION; -$VERSION = eval $VERSION; - -sub AUTOLOAD { - my $constname; - ($constname = $AUTOLOAD) =~ s/.*:://; - die "&Time::HiRes::constant not defined" if $constname eq 'constant'; - my ($error, $val) = constant($constname); - if ($error) { die $error; } - { - no strict 'refs'; - *$AUTOLOAD = sub { $val }; - } - goto &$AUTOLOAD; -} - -bootstrap Time::HiRes; - -# Preloaded methods go here. - -sub tv_interval { - # probably could have been done in C - my ($a, $b) = @_; - $b = [gettimeofday()] unless defined($b); - (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000); -} - -# Autoload methods go after =cut, and are processed by the autosplit program. - -1; -__END__ - -=head1 NAME - -Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers - -=head1 SYNOPSIS - - use Time::HiRes qw( usleep ualarm gettimeofday tv_interval ); - - usleep ($microseconds); - - ualarm ($microseconds); - ualarm ($microseconds, $interval_microseconds); - - $t0 = [gettimeofday]; - ($seconds, $microseconds) = gettimeofday; - - $elapsed = tv_interval ( $t0, [$seconds, $microseconds]); - $elapsed = tv_interval ( $t0, [gettimeofday]); - $elapsed = tv_interval ( $t0 ); - - use Time::HiRes qw ( time alarm sleep ); - - $now_fractions = time; - sleep ($floating_seconds); - alarm ($floating_seconds); - alarm ($floating_seconds, $floating_interval); - - use Time::HiRes qw( setitimer getitimer - ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF ); - - setitimer ($which, $floating_seconds, $floating_interval ); - getitimer ($which); - -=head1 DESCRIPTION - -The C module implements a Perl interface to the -C, C, C, and C/C -system calls, in other words, high resolution time and timers. See the -L section below and the test scripts for usage; see your -system documentation for the description of the underlying -C or C, C, C, and -C/C calls. - -If your system lacks C or an emulation of it you don't -get C or the one-argument form of C. -If your system lacks all of C, C, and -C, you don't get C or -C. If your system lacks both C and -C you don't get C or -C. - -If you try to import an unimplemented function in the C statement -it will fail at compile time. - -If your subsecond sleeping is implemented with C instead -of C, you can mix subsecond sleeping with signals since -C does not use signals. This, however, is not portable, -and you should first check for the truth value of -C<&Time::HiRes::d_nanosleep> to see whether you have nanosleep, and -then carefully read your C C API documentation for any -peculiarities. (There is no separate interface to call -C; just use C or -C with small enough values.) - -Unless using C for mixing sleeping with signals, give -some thought to whether Perl is the tool you should be using for -work requiring nanosecond accuracies. - -The following functions can be imported from this module. -No functions are exported by default. - -=over 4 - -=item gettimeofday () - -In array context returns a two-element array with the seconds and -microseconds since the epoch. In scalar context returns floating -seconds like C (see below). - -=item usleep ( $useconds ) - -Sleeps for the number of microseconds specified. Returns the number -of microseconds actually slept. Can sleep for more than one second, -unlike the C system call. See also C below. - -=item ualarm ( $useconds [, $interval_useconds ] ) - -Issues a C call; the C<$interval_useconds> is optional and -will be zero if unspecified, resulting in C-like behaviour. - -Note that the interaction between alarms and sleeps are unspecified. - -=item tv_interval - -tv_interval ( $ref_to_gettimeofday [, $ref_to_later_gettimeofday] ) - -Returns the floating seconds between the two times, which should have -been returned by C. If the second argument is omitted, -then the current time is used. - -=item time () - -Returns a floating seconds since the epoch. This function can be -imported, resulting in a nice drop-in replacement for the C